linux-safety.lists.elisa.tech archive mirror
 help / color / mirror / Atom feed
* [linux-safety] [PATCH] rtc: pcf8523: Use PTR_ERR_OR_ZERO
@ 2020-11-16 17:02 Sudip Mukherjee
  0 siblings, 0 replies; only message in thread
From: Sudip Mukherjee @ 2020-11-16 17:02 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: linux-kernel, linux-safety, linux-rtc, Sudip Mukherjee

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



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#171): https://lists.elisa.tech/g/linux-safety/message/171
Mute This Topic: https://lists.elisa.tech/mt/78296613/5278000
Group Owner: linux-safety+owner@lists.elisa.tech
Unsubscribe: https://lists.elisa.tech/g/linux-safety/unsub [linux-safety@archiver.kernel.org]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-16 17:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 17:02 [linux-safety] [PATCH] rtc: pcf8523: Use PTR_ERR_OR_ZERO Sudip Mukherjee

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).