Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae40d64b authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Felipe Balbi
Browse files

usb: gadget: at91_udc: call at91udc_of_init only when needed



This avoids a build error in at91sam9261_9g10_defconfig:

drivers/usb/gadget/at91_udc.c: In function 'at91udc_probe':
drivers/usb/gadget/at91_udc.c:1685:34: warning: 'flags' may be used uninitialized in this
function [-Wmaybe-uninitialized]
  board->vbus_active_low = (flags & OF_GPIO_ACTIVE_LOW) ? 1 : 0;
                                  ^
drivers/usb/gadget/at91_udc.c:1678:21: note: 'flags' was declared here
  enum of_gpio_flags flags;
                     ^

Making the call to at91udc_of_init conditinal also reduces
the object code size without sacrificing build coverage.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent cdcedd69
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1725,7 +1725,7 @@ static int at91udc_probe(struct platform_device *pdev)
	/* init software state */
	udc = &controller;
	udc->gadget.dev.parent = dev;
	if (pdev->dev.of_node)
	if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node)
		at91udc_of_init(udc, pdev->dev.of_node);
	else
		memcpy(&udc->board, dev->platform_data,