diff options
author | Brian Norris <computersforpeace@gmail.com> | 2015-11-15 20:30:53 -0800 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-11-15 20:31:29 -0800 |
commit | 617f41836c17688141e1c66f4156c2084f8ca86d (patch) | |
tree | e57d631bb3bb061a0ff2e99bc85f94bd1c30598f /drivers/w1/masters/w1-gpio.c | |
parent | 26add94cd535d1e000e7871fe69c7bb89e942d67 (diff) | |
parent | 8005c49d9aea74d382f474ce11afbbc7d7130bec (diff) |
Merge v4.4-rc1 into MTD development
Sync up with the upstream development.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/w1/masters/w1-gpio.c')
-rw-r--r-- | drivers/w1/masters/w1-gpio.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c index 8f7848c62811..a373ae69d9f6 100644 --- a/drivers/w1/masters/w1-gpio.c +++ b/drivers/w1/masters/w1-gpio.c @@ -198,11 +198,9 @@ static int w1_gpio_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM - -static int w1_gpio_suspend(struct platform_device *pdev, pm_message_t state) +static int __maybe_unused w1_gpio_suspend(struct device *dev) { - struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); + struct w1_gpio_platform_data *pdata = dev_get_platdata(dev); if (pdata->enable_external_pullup) pdata->enable_external_pullup(0); @@ -210,9 +208,9 @@ static int w1_gpio_suspend(struct platform_device *pdev, pm_message_t state) return 0; } -static int w1_gpio_resume(struct platform_device *pdev) +static int __maybe_unused w1_gpio_resume(struct device *dev) { - struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); + struct w1_gpio_platform_data *pdata = dev_get_platdata(dev); if (pdata->enable_external_pullup) pdata->enable_external_pullup(1); @@ -220,20 +218,16 @@ static int w1_gpio_resume(struct platform_device *pdev) return 0; } -#else -#define w1_gpio_suspend NULL -#define w1_gpio_resume NULL -#endif +static SIMPLE_DEV_PM_OPS(w1_gpio_pm_ops, w1_gpio_suspend, w1_gpio_resume); static struct platform_driver w1_gpio_driver = { .driver = { .name = "w1-gpio", + .pm = &w1_gpio_pm_ops, .of_match_table = of_match_ptr(w1_gpio_dt_ids), }, .probe = w1_gpio_probe, - .remove = w1_gpio_remove, - .suspend = w1_gpio_suspend, - .resume = w1_gpio_resume, + .remove = w1_gpio_remove, }; module_platform_driver(w1_gpio_driver); |