Skip to content

Commit

Permalink
nvmem: fix a 'makes pointer from integer without a cast' build warning
Browse files Browse the repository at this point in the history
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 <[email protected]>
Fixes: 2a127da ("nvmem: add support for the write-protect pin")
Signed-off-by: Bartosz Golaszewski <[email protected]>
Acked-by: Srinivas Kandagatla <[email protected]>
  • Loading branch information
brgl committed Jan 10, 2020
1 parent 1c89074 commit a99d2c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/nvmem/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a99d2c6

Please sign in to comment.