All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 2/2] Staging: usb: gadget: Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR.
@ 2016-02-27 12:24 Sandhya Bankar
  0 siblings, 0 replies; only message in thread
From: Sandhya Bankar @ 2016-02-27 12:24 UTC (permalink / raw)
  To: outreachy-kernel

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

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
changes in v2:
* Add missing return.
 drivers/usb/gadget/udc/at91_udc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/udc/at91_udc.c b/drivers/usb/gadget/udc/at91_udc.c
index d0d1894..87f6f52 100644
--- a/drivers/usb/gadget/udc/at91_udc.c
+++ b/drivers/usb/gadget/udc/at91_udc.c
@@ -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)
-- 
1.8.3.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-02-27 20:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-27 12:24 [PATCH v2 2/2] Staging: usb: gadget: Use PTR_ERR_OR_ZERO instead of if(IS_ERR(...)) + PTR_ERR Sandhya Bankar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.