Skip to content

Commit

Permalink
usb: convert r8a66597-hcd to dev_pm_ops
Browse files Browse the repository at this point in the history
Convert the r8a66597-hcd driver to dev_pm_ops. This makes
the driver a good PM citizen and removes a warning printout.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Jul 19, 2009
1 parent 78af08d commit ae1cef6
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions drivers/usb/host/r8a66597-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2305,9 +2305,9 @@ static struct hc_driver r8a66597_hc_driver = {
};

#if defined(CONFIG_PM)
static int r8a66597_suspend(struct platform_device *pdev, pm_message_t state)
static int r8a66597_suspend(struct device *dev)
{
struct r8a66597 *r8a66597 = dev_get_drvdata(&pdev->dev);
struct r8a66597 *r8a66597 = dev_get_drvdata(dev);
int port;

dbg("%s", __func__);
Expand All @@ -2323,9 +2323,9 @@ static int r8a66597_suspend(struct platform_device *pdev, pm_message_t state)
return 0;
}

static int r8a66597_resume(struct platform_device *pdev)
static int r8a66597_resume(struct device *dev)
{
struct r8a66597 *r8a66597 = dev_get_drvdata(&pdev->dev);
struct r8a66597 *r8a66597 = dev_get_drvdata(dev);
struct usb_hcd *hcd = r8a66597_to_hcd(r8a66597);

dbg("%s", __func__);
Expand All @@ -2335,9 +2335,15 @@ static int r8a66597_resume(struct platform_device *pdev)

return 0;
}

static struct dev_pm_ops r8a66597_dev_pm_ops = {
.suspend = r8a66597_suspend,
.resume = r8a66597_resume,
};

#define R8A66597_DEV_PM_OPS (&r8a66597_dev_pm_ops)
#else /* if defined(CONFIG_PM) */
#define r8a66597_suspend NULL
#define r8a66597_resume NULL
#define R8A66597_DEV_PM_OPS NULL
#endif

static int __init_or_module r8a66597_remove(struct platform_device *pdev)
Expand Down Expand Up @@ -2473,11 +2479,10 @@ static int __devinit r8a66597_probe(struct platform_device *pdev)
static struct platform_driver r8a66597_driver = {
.probe = r8a66597_probe,
.remove = r8a66597_remove,
.suspend = r8a66597_suspend,
.resume = r8a66597_resume,
.driver = {
.name = (char *) hcd_name,
.owner = THIS_MODULE,
.pm = R8A66597_DEV_PM_OPS,
},
};

Expand Down

0 comments on commit ae1cef6

Please sign in to comment.