diff options
author | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2020-01-10 09:19:29 +0100 |
---|---|---|
committer | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2020-01-10 12:11:30 +0100 |
commit | a99d2c6ccd15570a74a39992efa82fd169026b4c (patch) | |
tree | 4c78ee59c167e2c1ab7108fe96c61d77d28b2cf9 /drivers/nvmem/core.c | |
parent | 1c89074bf85068d1b86f2e0f0c2110fdd9b83c9f (diff) |
nvmem: fix a 'makes pointer from integer without a cast' build warning
nvmem_register() returns a pointer, not a long int. Use ERR_CAST() to
cast the struct gpio_desc pointer to struct nvmem_device.
Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 2a127da461a9 ("nvmem: add support for the write-protect pin")
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Diffstat (limited to 'drivers/nvmem/core.c')
-rw-r--r-- | drivers/nvmem/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 3e1c94c4eee8..408ce702347e 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -351,7 +351,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) nvmem->wp_gpio = gpiod_get_optional(config->dev, "wp", GPIOD_OUT_HIGH); if (IS_ERR(nvmem->wp_gpio)) - return PTR_ERR(nvmem->wp_gpio); + return ERR_CAST(nvmem->wp_gpio); kref_init(&nvmem->refcnt); |