nvmem: core: remove nvmem_config wp_gpio
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 27 Jan 2023 10:40:09 +0000 (10:40 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:26:45 +0000 (11:26 +0100)
commit 569653f022a29a1a44ea9de5308b657228303fa5 upstream.

No one provides wp_gpio, so let's remove it to avoid issues with
the nvmem core putting this gpio.

Cc: stable@vger.kernel.org
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230127104015.23839-5-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/core.c
include/linux/nvmem-provider.h

index 2aa57dcf6a8a7da46d8c831a999f9604945746be..d5446b80c65cf843ee7fffa4a14810f995dc5919 100644 (file)
@@ -768,9 +768,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
 
        nvmem->id = rval;
 
-       if (config->wp_gpio)
-               nvmem->wp_gpio = config->wp_gpio;
-       else if (!config->ignore_wp)
+       if (!config->ignore_wp)
                nvmem->wp_gpio = gpiod_get_optional(config->dev, "wp",
                                                    GPIOD_OUT_HIGH);
        if (IS_ERR(nvmem->wp_gpio)) {
index 87932bdb25d7b95b351d315ee96481087e6cc199..089597600e26ce98309d32b8bec6bc4246ff3a79 100644 (file)
@@ -66,7 +66,6 @@ struct nvmem_keepout {
  * @word_size: Minimum read/write access granularity.
  * @stride:    Minimum read/write access stride.
  * @priv:      User context passed to read/write callbacks.
- * @wp-gpio:   Write protect pin
  * @ignore_wp:  Write Protect pin is managed by the provider.
  *
  * Note: A default "nvmem<id>" name will be assigned to the device if
@@ -81,7 +80,6 @@ struct nvmem_config {
        const char              *name;
        int                     id;
        struct module           *owner;
-       struct gpio_desc        *wp_gpio;
        const struct nvmem_cell_info    *cells;
        int                     ncells;
        const struct nvmem_keepout *keepout;