From b34e092097a727ad3bb2eea81e9b6791dda61280 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 18 Feb 2023 09:12:29 +0000 Subject: [PATCH] Revert "nvmem: core: Fix a conflict between MTD and NVMEM on wp-gpios property" This reverts commit 34ec4c7831c416ac56619477f1701986634a7efc which is commit f6c052afe6f802d87c74153b7a57c43b2e9faf07 upstream. It breaks the Android kernel api, and isn't even really needed in the 5.10.y kernel tree yet, as there are no users of the new field. So revert it for now. If it is needed, it can be brought back in an abi-safe way in the future. Bug: 161946584 Change-Id: I85af757d31cf1d9ef5b0ac3c36d8c2ee67f9bc7f Signed-off-by: Greg Kroah-Hartman --- drivers/nvmem/core.c | 2 +- include/linux/nvmem-provider.h | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 48fbe49e3772..7b281ae540ad 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -629,7 +629,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) if (config->wp_gpio) nvmem->wp_gpio = config->wp_gpio; - else if (!config->ignore_wp) + else nvmem->wp_gpio = gpiod_get_optional(config->dev, "wp", GPIOD_OUT_HIGH); if (IS_ERR(nvmem->wp_gpio)) { diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 39ec67689898..06409a6c40bc 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -49,8 +49,7 @@ enum nvmem_type { * @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. + * @wp-gpio: Write protect pin * * Note: A default "nvmem" name will be assigned to the device if * no name is specified in its configuration. In such case "" is @@ -70,7 +69,6 @@ struct nvmem_config { enum nvmem_type type; bool read_only; bool root_only; - bool ignore_wp; bool no_of_node; nvmem_reg_read_t reg_read; nvmem_reg_write_t reg_write;