From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>,
Khouloud Touil <ktouil@baylibre.com>,
Stephen Rothwell <sfr@canb.auug.org.au>
Cc: linux-kernel@vger.kernel.org,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
kbuild test robot <lkp@intel.com>
Subject: [PATCH -next] nvmem: fix a 'makes pointer from integer without a cast' build warning
Date: Fri, 10 Jan 2020 09:24:41 +0100 [thread overview]
Message-ID: <20200110082441.8300-1-brgl@bgdev.pl> (raw)
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
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>
---
drivers/nvmem/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.23.0
next reply other threads:[~2020-01-10 8:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-10 8:24 Bartosz Golaszewski [this message]
2020-01-10 8:26 ` Bartosz Golaszewski
2020-01-10 10:16 ` Srinivas Kandagatla
2020-01-10 11:13 ` Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200110082441.8300-1-brgl@bgdev.pl \
--to=brgl@bgdev.pl \
--cc=bgolaszewski@baylibre.com \
--cc=ktouil@baylibre.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=sfr@canb.auug.org.au \
--cc=srinivas.kandagatla@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®