Commit a99d2c6c authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -351,7 +351,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config)
		nvmem->wp_gpio = gpiod_get_optional(config->dev, "wp",
		nvmem->wp_gpio = gpiod_get_optional(config->dev, "wp",
						    GPIOD_OUT_HIGH);
						    GPIOD_OUT_HIGH);
	if (IS_ERR(nvmem->wp_gpio))
	if (IS_ERR(nvmem->wp_gpio))
		return PTR_ERR(nvmem->wp_gpio);
		return ERR_CAST(nvmem->wp_gpio);




	kref_init(&nvmem->refcnt);
	kref_init(&nvmem->refcnt);