From: Wei Yongjun <weiyj.lk@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Rob Herring <robh@kernel.org>, Nishanth Menon <nm@ti.com>,
Lokesh Vutla <lokeshvutla@ti.com>,
Tony Lindgren <tony@atomide.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>, linux-gpio@vger.kernel.org
Subject: [PATCH -next] pinctrl: ti-iodelay: Fix return value check in ti_iodelay_probe()
Date: Tue, 17 Jan 2017 14:41:47 +0000 [thread overview]
Message-ID: <20170117144147.18540-1-weiyj.lk@gmail.com> (raw)
From: Wei Yongjun <weiyongjun1@huawei.com>
In case of error, the function pinctrl_register() returns
NULL not ERR_PTR(). The IS_ERR() test in the return value
check should be replaced with NULL test.
Fixes: 003910ebc83b ("pinctrl: Introduce TI IOdelay configuration driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
index 3b86d3d..8899f5e 100644
--- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
+++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
@@ -892,9 +892,9 @@ static int ti_iodelay_probe(struct platform_device *pdev)
iod->desc.owner = THIS_MODULE;
iod->pctl = pinctrl_register(&iod->desc, dev, iod);
- if (!iod->pctl) {
+ if (IS_ERR(iod->pctl)) {
dev_err(dev, "Failed to register pinctrl\n");
- ret = -ENODEV;
+ ret = PTR_ERR(iod->pctl);
goto exit_out;
}
next reply other threads:[~2017-01-17 14:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-17 14:41 Wei Yongjun [this message]
2017-01-17 23:02 ` [PATCH -next] pinctrl: ti-iodelay: Fix return value check in ti_iodelay_probe() Tony Lindgren
2017-01-18 23:29 ` Linus Walleij
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=20170117144147.18540-1-weiyj.lk@gmail.com \
--to=weiyj.lk@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=lokeshvutla@ti.com \
--cc=nm@ti.com \
--cc=robh@kernel.org \
--cc=tony@atomide.com \
--cc=weiyongjun1@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).