Commit a99d2c6c authored by Bartosz Golaszewski's avatar Bartosz Golaszewski

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: default avatarkbuild test robot <lkp@intel.com>
Fixes: 2a127da4 ("nvmem: add support for the write-protect pin")
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Acked-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
parent 1c89074b
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment