usb: gadget: udc: atmel: Also get regmap for at91sam9x5-pmc
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Mon, 13 Jun 2016 08:47:30 +0000 (10:47 +0200)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 21 Jun 2016 07:52:22 +0000 (10:52 +0300)
The "atmel,at91sam9g45-udc" compatible UDC is also used on at91sam9x5 so it
is also necessary to try to get the syscon for at91sam9x5-pmc.

Fixes: 4747639f01c9 ("usb: gadget: atmel: access the PMC using regmap")
Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/udc/atmel_usba_udc.c

index 18569de06b0495762950fcc724f69d05f10047af..bb1f6c8f0f01ab492c6b5c0d1852c655d2cc26ee 100644 (file)
@@ -1920,6 +1920,8 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
 
        udc->errata = match->data;
        udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9g45-pmc");
+       if (IS_ERR(udc->pmc))
+               udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9x5-pmc");
        if (udc->errata && IS_ERR(udc->pmc))
                return ERR_CAST(udc->pmc);