Thread (2 messages) 2 messages, 2 authors, 2018-05-21
STALE2932d

[PATCH] rtc: nvmem: don't use IS_ERR_OR_NULL

From: Uwe Kleine-König <hidden>
Date: 2018-05-20 15:26:47
Subsystem: real time clock (rtc) subsystem, the rest · Maintainers: Alexandre Belloni, Linus Torvalds

nvmem_register() never returns NULL, so IS_ERR is good enough here.

Signed-off-by: Uwe Kleine-König <redacted>
---
Some people don't like IS_ERR_OR_NULL because it is a hint that an API
is badly designed or it it used in a wrong way. In this case it's the
latter. :-)

Best regards
Uwe

 drivers/rtc/nvmem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/nvmem.c b/drivers/rtc/nvmem.c
index 17ec4c8d0fad..36ab183c42f1 100644
--- a/drivers/rtc/nvmem.c
+++ b/drivers/rtc/nvmem.c
@@ -94,7 +94,7 @@ int rtc_nvmem_register(struct rtc_device *rtc,
 	nvmem_config->dev = rtc->dev.parent;
 	nvmem_config->owner = rtc->owner;
 	rtc->nvmem = nvmem_register(nvmem_config);
-	if (IS_ERR_OR_NULL(rtc->nvmem))
+	if (IS_ERR(rtc->nvmem))
 		return PTR_ERR(rtc->nvmem);
 
 	/* Register the old ABI */
-- 
2.17.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help