diff mbox

nvmem: lpc18xx_otp: fix ptr_ret.cocci warnings

Message ID 20180304130428.GA11571@lkp-hsx02 (mailing list archive)
State Not Applicable
Headers show

Commit Message

kernel test robot March 4, 2018, 1:04 p.m. UTC
From: Fengguang Wu <fengguang.wu@intel.com>

drivers/nvmem/lpc18xx_otp.c:90:1-3: WARNING: PTR_ERR_OR_ZERO can be used


 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: e738282235ec ("nvmem: lpc18xx_otp: Convert to use devm_nvmem_register()")
CC: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 lpc18xx_otp.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox

Patch

--- a/drivers/nvmem/lpc18xx_otp.c
+++ b/drivers/nvmem/lpc18xx_otp.c
@@ -87,10 +87,7 @@  static int lpc18xx_otp_probe(struct plat
 	lpc18xx_otp_nvmem_config.priv = otp;
 
 	nvmem = devm_nvmem_register(&pdev->dev, &lpc18xx_otp_nvmem_config);
-	if (IS_ERR(nvmem))
-		return PTR_ERR(nvmem);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(nvmem);
 }
 
 static const struct of_device_id lpc18xx_otp_dt_ids[] = {