Skip to contentSkip to conversation

Staging: usb: gadget: Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR.

PATCH New Sandhya Bankar 1 participant 1 message Feb 27, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 2/2 Staging: usb: gadget: Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR.

Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR.

---
changes in v2:
* Add missing return.

 drivers/usb/gadget/udc/at91_udc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/usb/gadget/udc/at91_udc.c +1 -3
index d0d1894..87f6f52 100644
@@ -1726,10 +1726,8 @@ static int at91sam9261_udc_init(struct at91_udc *udc)
 
 	udc->matrix = syscon_regmap_lookup_by_phandle(udc->pdev->dev.of_node,
 						      "atmel,matrix");
-	if (IS_ERR(udc->matrix))
-		return PTR_ERR(udc->matrix);
 
-	return 0;
+	return PTR_ERR_OR_ZERO(udc->matrix);
 }
 
 static void at91sam9261_udc_pullup(struct at91_udc *udc, int is_on)
Signature · 1 line
1.8.3.4