USB: host: ohci-at91: merge ohci_at91_of_init in ohci_hcd_at91_drv_probe
As device tree support is now mandatory, merge ohci_at91_of_init() in ohci_hcd_at91_drv_probe(). Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
be12be546b
commit
bd73bfcd44
|
@ -449,17 +449,18 @@ static const struct of_device_id at91_ohci_dt_ids[] = {
|
|||
|
||||
MODULE_DEVICE_TABLE(of, at91_ohci_dt_ids);
|
||||
|
||||
static int ohci_at91_of_init(struct platform_device *pdev)
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *np = pdev->dev.of_node;
|
||||
int i, gpio, ret;
|
||||
enum of_gpio_flags flags;
|
||||
struct at91_usbh_data *pdata;
|
||||
int i;
|
||||
int gpio;
|
||||
int ret;
|
||||
enum of_gpio_flags flags;
|
||||
u32 ports;
|
||||
|
||||
if (!np)
|
||||
return 0;
|
||||
|
||||
/* Right now device-tree probed devices don't get dma_mask set.
|
||||
* Since shared usb code relies on it, set it here for now.
|
||||
* Once we have dma capability bindings this can go away.
|
||||
|
@ -489,25 +490,6 @@ static int ohci_at91_of_init(struct platform_device *pdev)
|
|||
|
||||
pdev->dev.platform_data = pdata;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
|
||||
static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct at91_usbh_data *pdata;
|
||||
int i;
|
||||
int gpio;
|
||||
int ret;
|
||||
|
||||
ret = ohci_at91_of_init(pdev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
pdata = dev_get_platdata(&pdev->dev);
|
||||
|
||||
if (pdata) {
|
||||
at91_for_each_port(i) {
|
||||
/*
|
||||
* do not configure PIO if not in relation with
|
||||
|
@ -573,7 +555,6 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
|
|||
"can't get gpio IRQ for overcurrent\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
device_init_wakeup(&pdev->dev, 1);
|
||||
return usb_hcd_at91_probe(&ohci_at91_hc_driver, pdev);
|
||||
|
|
Loading…
Reference in New Issue