From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Alessandro Zummo <a.zummo@towertech.it>,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-kernel@vger.kernel.org, linux-safety@lists.elisa.tech,
linux-rtc@vger.kernel.org,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH] rtc: pcf8523: Use PTR_ERR_OR_ZERO
Date: Mon, 16 Nov 2020 17:02:09 +0000 [thread overview]
Message-ID: <20201116170209.31584-1-sudipm.mukherjee@gmail.com> (raw)
Coccinelle suggested using PTR_ERR_OR_ZERO() and looking at the code,
we can use PTR_ERR_OR_ZERO() instead of checking IS_ERR() and then
doing 'return 0'.
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
drivers/rtc/rtc-pcf8523.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-pcf8523.c b/drivers/rtc/rtc-pcf8523.c
index 57d351dfe272..94f182599438 100644
--- a/drivers/rtc/rtc-pcf8523.c
+++ b/drivers/rtc/rtc-pcf8523.c
@@ -358,10 +358,8 @@ static int pcf8523_probe(struct i2c_client *client,
rtc = devm_rtc_device_register(&client->dev, DRIVER_NAME,
&pcf8523_rtc_ops, THIS_MODULE);
- if (IS_ERR(rtc))
- return PTR_ERR(rtc);
- return 0;
+ return PTR_ERR_OR_ZERO(rtc);
}
static const struct i2c_device_id pcf8523_id[] = {
--
2.11.0
reply other threads:[~2020-11-16 17:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20201116170209.31584-1-sudipm.mukherjee@gmail.com \
--to=sudipm.mukherjee@gmail.com \
--cc=a.zummo@towertech.it \
--cc=alexandre.belloni@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-safety@lists.elisa.tech \
/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®