staging: fpgaboot: fix coccinelle warnings

Author: Fengguang Wu <fengguang.wu@intel.com>

drivers/staging/gs_fpgaboot/gs_fpgaboot.c:305:1-3: WARNING: PTR_RET can be used

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

Generated by: coccinelle/api/ptr_ret.cocci

CC: Insop Song 
Signed-off-by: Fengguang Wu 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
 
diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
index fee2f61..31a6741 100644
--- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
+++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
@@ -302,10 +302,7 @@ static int init_driver(void)
 {
 	firmware_pdev = platform_device_register_simple("fpgaboot", -1,
 							 NULL, 0);
-	if (IS_ERR(firmware_pdev))
-		return PTR_ERR(firmware_pdev);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(firmware_pdev);
 }
 
 static void finish_driver(void)
BtrLinux
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.