Commit d8fd7d5a authored by Amardeep Rai's avatar Amardeep Rai Committed by Greg Kroah-Hartman

usb: spear-ehci/ohci: Do clk_get using dev-id

We used to get clk using con-id, but now we have device struct available for
these devices as they are probed using DT. And so must get clk using dev-id.
Signed-off-by: default avatarAmardeep Rai <amardeep.rai-ext@st.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bc13364b
...@@ -109,8 +109,6 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev) ...@@ -109,8 +109,6 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
struct clk *usbh_clk; struct clk *usbh_clk;
const struct hc_driver *driver = &ehci_spear_hc_driver; const struct hc_driver *driver = &ehci_spear_hc_driver;
int irq, retval; int irq, retval;
char clk_name[20] = "usbh_clk";
static int instance = -1;
if (usb_disabled()) if (usb_disabled())
return -ENODEV; return -ENODEV;
...@@ -129,16 +127,7 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev) ...@@ -129,16 +127,7 @@ static int spear_ehci_hcd_drv_probe(struct platform_device *pdev)
if (!pdev->dev.dma_mask) if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &spear_ehci_dma_mask; pdev->dev.dma_mask = &spear_ehci_dma_mask;
/* usbh_clk = clk_get(&pdev->dev, NULL);
* Increment the device instance, when probing via device-tree
*/
if (pdev->id < 0)
instance++;
else
instance = pdev->id;
sprintf(clk_name, "usbh.%01d_clk", instance);
usbh_clk = clk_get(NULL, clk_name);
if (IS_ERR(usbh_clk)) { if (IS_ERR(usbh_clk)) {
dev_err(&pdev->dev, "Error getting interface clock\n"); dev_err(&pdev->dev, "Error getting interface clock\n");
retval = PTR_ERR(usbh_clk); retval = PTR_ERR(usbh_clk);
......
...@@ -101,8 +101,6 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev) ...@@ -101,8 +101,6 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev)
struct spear_ohci *ohci_p; struct spear_ohci *ohci_p;
struct resource *res; struct resource *res;
int retval, irq; int retval, irq;
char clk_name[20] = "usbh_clk";
static int instance = -1;
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
...@@ -118,16 +116,7 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev) ...@@ -118,16 +116,7 @@ static int spear_ohci_hcd_drv_probe(struct platform_device *pdev)
if (!pdev->dev.dma_mask) if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &spear_ohci_dma_mask; pdev->dev.dma_mask = &spear_ohci_dma_mask;
/* usbh_clk = clk_get(&pdev->dev, NULL);
* Increment the device instance, when probing via device-tree
*/
if (pdev->id < 0)
instance++;
else
instance = pdev->id;
sprintf(clk_name, "usbh.%01d_clk", instance);
usbh_clk = clk_get(NULL, clk_name);
if (IS_ERR(usbh_clk)) { if (IS_ERR(usbh_clk)) {
dev_err(&pdev->dev, "Error getting interface clock\n"); dev_err(&pdev->dev, "Error getting interface clock\n");
retval = PTR_ERR(usbh_clk); retval = PTR_ERR(usbh_clk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment