Skip to content

Commit

Permalink
usb: musb: Remove extra PM runtime calls from 2430 glue layer
Browse files Browse the repository at this point in the history
With PM runtime behaving, these are all now unnecessary.
Doing pm_runtime_get(musb->controller) will keep the parent
glue layer also active.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Tony Lindgren authored and Greg Kroah-Hartman committed Jun 1, 2016
1 parent 12b7db2 commit 87326e8
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions drivers/usb/musb/omap2430.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,8 @@ static void omap_musb_mailbox_work(struct work_struct *mailbox_work)
{
struct omap2430_glue *glue = container_of(mailbox_work,
struct omap2430_glue, omap_musb_mailbox_work);
struct musb *musb = glue_to_musb(glue);
struct device *dev = musb->controller;

pm_runtime_get_sync(dev);
omap_musb_set_mailbox(glue);
pm_runtime_mark_last_busy(dev);
pm_runtime_put_autosuspend(dev);
}

static irqreturn_t omap2430_musb_interrupt(int irq, void *__hci)
Expand Down Expand Up @@ -343,16 +338,6 @@ static int omap2430_musb_init(struct musb *musb)
musb->isr = omap2430_musb_interrupt;
phy_init(musb->phy);

/*
* Enable runtime PM for musb parent (this driver). We can't
* do it earlier as struct musb is not yet allocated and we
* need to touch the musb registers for runtime PM.
*/
pm_runtime_enable(glue->dev);
status = pm_runtime_get_sync(glue->dev);
if (status < 0)
goto err1;

l = musb_readl(musb->mregs, OTG_INTERFSEL);

if (data->interface_type == MUSB_INTERFACE_UTMI) {
Expand All @@ -376,11 +361,7 @@ static int omap2430_musb_init(struct musb *musb)
if (glue->status != MUSB_UNKNOWN)
omap_musb_set_mailbox(glue);

pm_runtime_put(glue->dev);
return 0;

err1:
return status;
}

static void omap2430_musb_enable(struct musb *musb)
Expand Down Expand Up @@ -588,11 +569,9 @@ static int omap2430_probe(struct platform_device *pdev)
goto err2;
}

/*
* Note that we cannot enable PM runtime yet for this
* driver as we need struct musb initialized first.
* See omap2430_musb_init above.
*/
pm_runtime_enable(glue->dev);
pm_runtime_use_autosuspend(glue->dev);
pm_runtime_set_autosuspend_delay(glue->dev, 500);

ret = platform_device_add(musb);
if (ret) {
Expand All @@ -618,6 +597,7 @@ static int omap2430_remove(struct platform_device *pdev)
platform_device_unregister(glue->musb);
omap2430_set_power(musb, false, false);
pm_runtime_put_sync(glue->dev);
pm_runtime_dont_use_autosuspend(glue->dev);
pm_runtime_disable(glue->dev);

return 0;
Expand Down

0 comments on commit 87326e8

Please sign in to comment.