aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2015-02-07 11:48:49 -0500
committerGuenter Roeck <linux@roeck-us.net>2015-03-15 11:54:05 -0400
commit48e9318256da995681e6420732055e34f93bddc1 (patch)
treef20dea565d177107de28f8fb6fd5c44fb1d8dc63 /drivers
parentf6906edeac16bb33b80d41fac84261767f18c14a (diff)
hwmon: (nct6775) Convert to use SIMPLE_DEV_PM_OPS
Get rid of #ifdef CONFIG_PM by using SIMPLE_DEV_PM_OPS and declaring suspend and resume functions with __maybe_unused. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/hwmon/nct6775.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index 1be41177b620..db6a68efc389 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
@@ -880,12 +880,11 @@ struct nct6775_data {
880 u16 have_temp; 880 u16 have_temp;
881 u16 have_temp_fixed; 881 u16 have_temp_fixed;
882 u16 have_in; 882 u16 have_in;
883#ifdef CONFIG_PM 883
884 /* Remember extra register values over suspend/resume */ 884 /* Remember extra register values over suspend/resume */
885 u8 vbat; 885 u8 vbat;
886 u8 fandiv1; 886 u8 fandiv1;
887 u8 fandiv2; 887 u8 fandiv2;
888#endif
889}; 888};
890 889
891struct nct6775_sio_data { 890struct nct6775_sio_data {
@@ -3989,8 +3988,7 @@ static void nct6791_enable_io_mapping(int sioaddr)
3989 } 3988 }
3990} 3989}
3991 3990
3992#ifdef CONFIG_PM 3991static int __maybe_unused nct6775_suspend(struct device *dev)
3993static int nct6775_suspend(struct device *dev)
3994{ 3992{
3995 struct nct6775_data *data = nct6775_update_device(dev); 3993 struct nct6775_data *data = nct6775_update_device(dev);
3996 3994
@@ -4005,7 +4003,7 @@ static int nct6775_suspend(struct device *dev)
4005 return 0; 4003 return 0;
4006} 4004}
4007 4005
4008static int nct6775_resume(struct device *dev) 4006static int __maybe_unused nct6775_resume(struct device *dev)
4009{ 4007{
4010 struct nct6775_data *data = dev_get_drvdata(dev); 4008 struct nct6775_data *data = dev_get_drvdata(dev);
4011 int i, j, err = 0; 4009 int i, j, err = 0;
@@ -4066,22 +4064,12 @@ abort:
4066 return err; 4064 return err;
4067} 4065}
4068 4066
4069static const struct dev_pm_ops nct6775_dev_pm_ops = { 4067static SIMPLE_DEV_PM_OPS(nct6775_dev_pm_ops, nct6775_suspend, nct6775_resume);
4070 .suspend = nct6775_suspend,
4071 .resume = nct6775_resume,
4072 .freeze = nct6775_suspend,
4073 .restore = nct6775_resume,
4074};
4075
4076#define NCT6775_DEV_PM_OPS (&nct6775_dev_pm_ops)
4077#else
4078#define NCT6775_DEV_PM_OPS NULL
4079#endif /* CONFIG_PM */
4080 4068
4081static struct platform_driver nct6775_driver = { 4069static struct platform_driver nct6775_driver = {
4082 .driver = { 4070 .driver = {
4083 .name = DRVNAME, 4071 .name = DRVNAME,
4084 .pm = NCT6775_DEV_PM_OPS, 4072 .pm = &nct6775_dev_pm_ops,
4085 }, 4073 },
4086 .probe = nct6775_probe, 4074 .probe = nct6775_probe,
4087}; 4075};