nvmem_register() never returns NULL, so IS_ERR is good enough here. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx> --- 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