diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-07-30 04:13:06 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2013-08-12 01:10:39 -0400 |
commit | a8b3a3a53f9a814e9938ea9cc179086ff5c0a387 (patch) | |
tree | 6905bf9311520248db9cdd63b8d7e1a1840b10b8 | |
parent | f58876ac8c73f91c28f7825dee37ad64092eccf7 (diff) |
hwmon: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/ads7828.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/ds620.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/f71805f.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/f71882fg.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/f75375s.c | 3 | ||||
-rw-r--r-- | drivers/hwmon/g762.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/gpio-fan.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/ina2xx.c | 4 | ||||
-rw-r--r-- | drivers/hwmon/it87.c | 6 | ||||
-rw-r--r-- | drivers/hwmon/lm87.c | 4 | ||||
-rw-r--r-- | drivers/hwmon/max197.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/max6639.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/mcp3021.c | 7 | ||||
-rw-r--r-- | drivers/hwmon/nct6775.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/ntc_thermistor.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/pc87427.c | 4 | ||||
-rw-r--r-- | drivers/hwmon/pmbus/pmbus_core.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/s3c-hwmon.c | 6 | ||||
-rw-r--r-- | drivers/hwmon/sht15.c | 4 | ||||
-rw-r--r-- | drivers/hwmon/smsc47m1.c | 4 | ||||
-rw-r--r-- | drivers/hwmon/w83627ehf.c | 20 | ||||
-rw-r--r-- | drivers/hwmon/w83627hf.c | 6 |
22 files changed, 46 insertions, 44 deletions
diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c index ba962ac4b81f..7092c78f814f 100644 --- a/drivers/hwmon/ads7828.c +++ b/drivers/hwmon/ads7828.c | |||
@@ -145,7 +145,7 @@ static int ads7828_remove(struct i2c_client *client) | |||
145 | static int ads7828_probe(struct i2c_client *client, | 145 | static int ads7828_probe(struct i2c_client *client, |
146 | const struct i2c_device_id *id) | 146 | const struct i2c_device_id *id) |
147 | { | 147 | { |
148 | struct ads7828_platform_data *pdata = client->dev.platform_data; | 148 | struct ads7828_platform_data *pdata = dev_get_platdata(&client->dev); |
149 | struct ads7828_data *data; | 149 | struct ads7828_data *data; |
150 | int err; | 150 | int err; |
151 | 151 | ||
diff --git a/drivers/hwmon/ds620.c b/drivers/hwmon/ds620.c index f1d6b422cf06..0918b9136588 100644 --- a/drivers/hwmon/ds620.c +++ b/drivers/hwmon/ds620.c | |||
@@ -77,7 +77,7 @@ struct ds620_data { | |||
77 | 77 | ||
78 | static void ds620_init_client(struct i2c_client *client) | 78 | static void ds620_init_client(struct i2c_client *client) |
79 | { | 79 | { |
80 | struct ds620_platform_data *ds620_info = client->dev.platform_data; | 80 | struct ds620_platform_data *ds620_info = dev_get_platdata(&client->dev); |
81 | u16 conf, new_conf; | 81 | u16 conf, new_conf; |
82 | 82 | ||
83 | new_conf = conf = | 83 | new_conf = conf = |
diff --git a/drivers/hwmon/f71805f.c b/drivers/hwmon/f71805f.c index 0c9f3da242bf..15b7f5281def 100644 --- a/drivers/hwmon/f71805f.c +++ b/drivers/hwmon/f71805f.c | |||
@@ -1375,7 +1375,7 @@ static void f71805f_init_device(struct f71805f_data *data) | |||
1375 | 1375 | ||
1376 | static int f71805f_probe(struct platform_device *pdev) | 1376 | static int f71805f_probe(struct platform_device *pdev) |
1377 | { | 1377 | { |
1378 | struct f71805f_sio_data *sio_data = pdev->dev.platform_data; | 1378 | struct f71805f_sio_data *sio_data = dev_get_platdata(&pdev->dev); |
1379 | struct f71805f_data *data; | 1379 | struct f71805f_data *data; |
1380 | struct resource *res; | 1380 | struct resource *res; |
1381 | int i, err; | 1381 | int i, err; |
diff --git a/drivers/hwmon/f71882fg.c b/drivers/hwmon/f71882fg.c index cfb02dd91aad..31b221eeee6c 100644 --- a/drivers/hwmon/f71882fg.c +++ b/drivers/hwmon/f71882fg.c | |||
@@ -2267,7 +2267,7 @@ static int f71882fg_create_fan_sysfs_files( | |||
2267 | static int f71882fg_probe(struct platform_device *pdev) | 2267 | static int f71882fg_probe(struct platform_device *pdev) |
2268 | { | 2268 | { |
2269 | struct f71882fg_data *data; | 2269 | struct f71882fg_data *data; |
2270 | struct f71882fg_sio_data *sio_data = pdev->dev.platform_data; | 2270 | struct f71882fg_sio_data *sio_data = dev_get_platdata(&pdev->dev); |
2271 | int nr_fans = f71882fg_nr_fans[sio_data->type]; | 2271 | int nr_fans = f71882fg_nr_fans[sio_data->type]; |
2272 | int nr_temps = f71882fg_nr_temps[sio_data->type]; | 2272 | int nr_temps = f71882fg_nr_temps[sio_data->type]; |
2273 | int err, i; | 2273 | int err, i; |
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c index 9e300e567f15..a837b94977f4 100644 --- a/drivers/hwmon/f75375s.c +++ b/drivers/hwmon/f75375s.c | |||
@@ -832,7 +832,8 @@ static int f75375_probe(struct i2c_client *client, | |||
832 | const struct i2c_device_id *id) | 832 | const struct i2c_device_id *id) |
833 | { | 833 | { |
834 | struct f75375_data *data; | 834 | struct f75375_data *data; |
835 | struct f75375s_platform_data *f75375s_pdata = client->dev.platform_data; | 835 | struct f75375s_platform_data *f75375s_pdata = |
836 | dev_get_platdata(&client->dev); | ||
836 | int err; | 837 | int err; |
837 | 838 | ||
838 | if (!i2c_check_functionality(client->adapter, | 839 | if (!i2c_check_functionality(client->adapter, |
diff --git a/drivers/hwmon/g762.c b/drivers/hwmon/g762.c index 73adf01b0ef2..b4b8b5bef718 100644 --- a/drivers/hwmon/g762.c +++ b/drivers/hwmon/g762.c | |||
@@ -717,7 +717,7 @@ static void g762_of_clock_disable(struct i2c_client *client) { } | |||
717 | 717 | ||
718 | static int g762_pdata_prop_import(struct i2c_client *client) | 718 | static int g762_pdata_prop_import(struct i2c_client *client) |
719 | { | 719 | { |
720 | struct g762_platform_data *pdata = client->dev.platform_data; | 720 | struct g762_platform_data *pdata = dev_get_platdata(&client->dev); |
721 | int ret; | 721 | int ret; |
722 | 722 | ||
723 | if (!pdata) | 723 | if (!pdata) |
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c index 3104149795c5..b7d6a5704eb2 100644 --- a/drivers/hwmon/gpio-fan.c +++ b/drivers/hwmon/gpio-fan.c | |||
@@ -495,7 +495,7 @@ static int gpio_fan_probe(struct platform_device *pdev) | |||
495 | { | 495 | { |
496 | int err; | 496 | int err; |
497 | struct gpio_fan_data *fan_data; | 497 | struct gpio_fan_data *fan_data; |
498 | struct gpio_fan_platform_data *pdata = pdev->dev.platform_data; | 498 | struct gpio_fan_platform_data *pdata = dev_get_platdata(&pdev->dev); |
499 | 499 | ||
500 | #ifdef CONFIG_OF_GPIO | 500 | #ifdef CONFIG_OF_GPIO |
501 | if (!pdata) { | 501 | if (!pdata) { |
diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c index d917a2d8c30f..18c062360ca7 100644 --- a/drivers/hwmon/ina2xx.c +++ b/drivers/hwmon/ina2xx.c | |||
@@ -232,9 +232,9 @@ static int ina2xx_probe(struct i2c_client *client, | |||
232 | if (!data) | 232 | if (!data) |
233 | return -ENOMEM; | 233 | return -ENOMEM; |
234 | 234 | ||
235 | if (client->dev.platform_data) { | 235 | if (dev_get_platdata(&client->dev)) { |
236 | pdata = | 236 | pdata = |
237 | (struct ina2xx_platform_data *)client->dev.platform_data; | 237 | (struct ina2xx_platform_data *)dev_get_platdata(&client->dev); |
238 | shunt = pdata->shunt_uohms; | 238 | shunt = pdata->shunt_uohms; |
239 | } else if (!of_property_read_u32(client->dev.of_node, | 239 | } else if (!of_property_read_u32(client->dev.of_node, |
240 | "shunt-resistor", &val)) { | 240 | "shunt-resistor", &val)) { |
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 72b21d5b1c62..29ffa27c60b8 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -1962,7 +1962,7 @@ exit: | |||
1962 | static void it87_remove_files(struct device *dev) | 1962 | static void it87_remove_files(struct device *dev) |
1963 | { | 1963 | { |
1964 | struct it87_data *data = platform_get_drvdata(pdev); | 1964 | struct it87_data *data = platform_get_drvdata(pdev); |
1965 | struct it87_sio_data *sio_data = dev->platform_data; | 1965 | struct it87_sio_data *sio_data = dev_get_platdata(dev); |
1966 | int i; | 1966 | int i; |
1967 | 1967 | ||
1968 | sysfs_remove_group(&dev->kobj, &it87_group); | 1968 | sysfs_remove_group(&dev->kobj, &it87_group); |
@@ -2014,7 +2014,7 @@ static int it87_probe(struct platform_device *pdev) | |||
2014 | struct it87_data *data; | 2014 | struct it87_data *data; |
2015 | struct resource *res; | 2015 | struct resource *res; |
2016 | struct device *dev = &pdev->dev; | 2016 | struct device *dev = &pdev->dev; |
2017 | struct it87_sio_data *sio_data = dev->platform_data; | 2017 | struct it87_sio_data *sio_data = dev_get_platdata(dev); |
2018 | int err = 0, i; | 2018 | int err = 0, i; |
2019 | int enable_pwm_interface; | 2019 | int enable_pwm_interface; |
2020 | int fan_beep_need_rw; | 2020 | int fan_beep_need_rw; |
@@ -2316,7 +2316,7 @@ static int it87_check_pwm(struct device *dev) | |||
2316 | /* Called when we have found a new IT87. */ | 2316 | /* Called when we have found a new IT87. */ |
2317 | static void it87_init_device(struct platform_device *pdev) | 2317 | static void it87_init_device(struct platform_device *pdev) |
2318 | { | 2318 | { |
2319 | struct it87_sio_data *sio_data = pdev->dev.platform_data; | 2319 | struct it87_sio_data *sio_data = dev_get_platdata(&pdev->dev); |
2320 | struct it87_data *data = platform_get_drvdata(pdev); | 2320 | struct it87_data *data = platform_get_drvdata(pdev); |
2321 | int tmp, i; | 2321 | int tmp, i; |
2322 | u8 mask; | 2322 | u8 mask; |
diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c index 16e45d702152..333092ce2465 100644 --- a/drivers/hwmon/lm87.c +++ b/drivers/hwmon/lm87.c | |||
@@ -855,8 +855,8 @@ static void lm87_init_client(struct i2c_client *client) | |||
855 | { | 855 | { |
856 | struct lm87_data *data = i2c_get_clientdata(client); | 856 | struct lm87_data *data = i2c_get_clientdata(client); |
857 | 857 | ||
858 | if (client->dev.platform_data) { | 858 | if (dev_get_platdata(&client->dev)) { |
859 | data->channel = *(u8 *)client->dev.platform_data; | 859 | data->channel = *(u8 *)dev_get_platdata(&client->dev); |
860 | lm87_write_value(client, | 860 | lm87_write_value(client, |
861 | LM87_REG_CHANNEL_MODE, data->channel); | 861 | LM87_REG_CHANNEL_MODE, data->channel); |
862 | } else { | 862 | } else { |
diff --git a/drivers/hwmon/max197.c b/drivers/hwmon/max197.c index b5ebb9198c75..96dccaf919d1 100644 --- a/drivers/hwmon/max197.c +++ b/drivers/hwmon/max197.c | |||
@@ -261,7 +261,7 @@ static int max197_probe(struct platform_device *pdev) | |||
261 | { | 261 | { |
262 | int ch, ret; | 262 | int ch, ret; |
263 | struct max197_data *data; | 263 | struct max197_data *data; |
264 | struct max197_platform_data *pdata = pdev->dev.platform_data; | 264 | struct max197_platform_data *pdata = dev_get_platdata(&pdev->dev); |
265 | enum max197_chips chip = platform_get_device_id(pdev)->driver_data; | 265 | enum max197_chips chip = platform_get_device_id(pdev)->driver_data; |
266 | 266 | ||
267 | if (pdata == NULL) { | 267 | if (pdata == NULL) { |
diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c index 3e7b4269f5b9..066e587a18a5 100644 --- a/drivers/hwmon/max6639.c +++ b/drivers/hwmon/max6639.c | |||
@@ -428,7 +428,7 @@ static int max6639_init_client(struct i2c_client *client) | |||
428 | { | 428 | { |
429 | struct max6639_data *data = i2c_get_clientdata(client); | 429 | struct max6639_data *data = i2c_get_clientdata(client); |
430 | struct max6639_platform_data *max6639_info = | 430 | struct max6639_platform_data *max6639_info = |
431 | client->dev.platform_data; | 431 | dev_get_platdata(&client->dev); |
432 | int i; | 432 | int i; |
433 | int rpm_range = 1; /* default: 4000 RPM */ | 433 | int rpm_range = 1; /* default: 4000 RPM */ |
434 | int err; | 434 | int err; |
diff --git a/drivers/hwmon/mcp3021.c b/drivers/hwmon/mcp3021.c index eedb32292d6d..d219c06a857b 100644 --- a/drivers/hwmon/mcp3021.c +++ b/drivers/hwmon/mcp3021.c | |||
@@ -143,12 +143,13 @@ static int mcp3021_probe(struct i2c_client *client, | |||
143 | break; | 143 | break; |
144 | } | 144 | } |
145 | 145 | ||
146 | if (client->dev.platform_data) { | 146 | if (dev_get_platdata(&client->dev)) { |
147 | data->vdd = *(u32 *)client->dev.platform_data; | 147 | data->vdd = *(u32 *)dev_get_platdata(&client->dev); |
148 | if (data->vdd > MCP3021_VDD_MAX || data->vdd < MCP3021_VDD_MIN) | 148 | if (data->vdd > MCP3021_VDD_MAX || data->vdd < MCP3021_VDD_MIN) |
149 | return -EINVAL; | 149 | return -EINVAL; |
150 | } else | 150 | } else { |
151 | data->vdd = MCP3021_VDD_REF; | 151 | data->vdd = MCP3021_VDD_REF; |
152 | } | ||
152 | 153 | ||
153 | err = sysfs_create_file(&client->dev.kobj, &dev_attr_in0_input.attr); | 154 | err = sysfs_create_file(&client->dev.kobj, &dev_attr_in0_input.attr); |
154 | if (err) | 155 | if (err) |
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c index 25e2c7bea48c..a0ace075e918 100644 --- a/drivers/hwmon/nct6775.c +++ b/drivers/hwmon/nct6775.c | |||
@@ -3285,7 +3285,7 @@ static void add_temp_sensors(struct nct6775_data *data, const u16 *regp, | |||
3285 | static int nct6775_probe(struct platform_device *pdev) | 3285 | static int nct6775_probe(struct platform_device *pdev) |
3286 | { | 3286 | { |
3287 | struct device *dev = &pdev->dev; | 3287 | struct device *dev = &pdev->dev; |
3288 | struct nct6775_sio_data *sio_data = dev->platform_data; | 3288 | struct nct6775_sio_data *sio_data = dev_get_platdata(dev); |
3289 | struct nct6775_data *data; | 3289 | struct nct6775_data *data; |
3290 | struct resource *res; | 3290 | struct resource *res; |
3291 | int i, s, err = 0; | 3291 | int i, s, err = 0; |
diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c index 830a842d796a..8c23203915af 100644 --- a/drivers/hwmon/ntc_thermistor.c +++ b/drivers/hwmon/ntc_thermistor.c | |||
@@ -424,7 +424,7 @@ static int ntc_thermistor_probe(struct platform_device *pdev) | |||
424 | if (IS_ERR(pdata)) | 424 | if (IS_ERR(pdata)) |
425 | return PTR_ERR(pdata); | 425 | return PTR_ERR(pdata); |
426 | else if (pdata == NULL) | 426 | else if (pdata == NULL) |
427 | pdata = pdev->dev.platform_data; | 427 | pdata = dev_get_platdata(&pdev->dev); |
428 | 428 | ||
429 | if (!pdata) { | 429 | if (!pdata) { |
430 | dev_err(&pdev->dev, "No platform init data supplied.\n"); | 430 | dev_err(&pdev->dev, "No platform init data supplied.\n"); |
diff --git a/drivers/hwmon/pc87427.c b/drivers/hwmon/pc87427.c index ea606860d2b2..6e6ea4437bb6 100644 --- a/drivers/hwmon/pc87427.c +++ b/drivers/hwmon/pc87427.c | |||
@@ -983,7 +983,7 @@ static int pc87427_request_regions(struct platform_device *pdev, | |||
983 | 983 | ||
984 | static void pc87427_init_device(struct device *dev) | 984 | static void pc87427_init_device(struct device *dev) |
985 | { | 985 | { |
986 | struct pc87427_sio_data *sio_data = dev->platform_data; | 986 | struct pc87427_sio_data *sio_data = dev_get_platdata(dev); |
987 | struct pc87427_data *data = dev_get_drvdata(dev); | 987 | struct pc87427_data *data = dev_get_drvdata(dev); |
988 | int i; | 988 | int i; |
989 | u8 reg; | 989 | u8 reg; |
@@ -1075,7 +1075,7 @@ static void pc87427_remove_files(struct device *dev) | |||
1075 | 1075 | ||
1076 | static int pc87427_probe(struct platform_device *pdev) | 1076 | static int pc87427_probe(struct platform_device *pdev) |
1077 | { | 1077 | { |
1078 | struct pc87427_sio_data *sio_data = pdev->dev.platform_data; | 1078 | struct pc87427_sio_data *sio_data = dev_get_platdata(&pdev->dev); |
1079 | struct pc87427_data *data; | 1079 | struct pc87427_data *data; |
1080 | int i, err, res_count; | 1080 | int i, err, res_count; |
1081 | 1081 | ||
diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c index 9add60920ac0..9319fcf142d9 100644 --- a/drivers/hwmon/pmbus/pmbus_core.c +++ b/drivers/hwmon/pmbus/pmbus_core.c | |||
@@ -1726,7 +1726,7 @@ int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id, | |||
1726 | struct pmbus_driver_info *info) | 1726 | struct pmbus_driver_info *info) |
1727 | { | 1727 | { |
1728 | struct device *dev = &client->dev; | 1728 | struct device *dev = &client->dev; |
1729 | const struct pmbus_platform_data *pdata = dev->platform_data; | 1729 | const struct pmbus_platform_data *pdata = dev_get_platdata(dev); |
1730 | struct pmbus_data *data; | 1730 | struct pmbus_data *data; |
1731 | int ret; | 1731 | int ret; |
1732 | 1732 | ||
diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c index a9f7e804f1e4..73bd64e8c30a 100644 --- a/drivers/hwmon/s3c-hwmon.c +++ b/drivers/hwmon/s3c-hwmon.c | |||
@@ -165,7 +165,7 @@ static ssize_t s3c_hwmon_ch_show(struct device *dev, | |||
165 | { | 165 | { |
166 | struct sensor_device_attribute *sen_attr = to_sensor_dev_attr(attr); | 166 | struct sensor_device_attribute *sen_attr = to_sensor_dev_attr(attr); |
167 | struct s3c_hwmon *hwmon = platform_get_drvdata(to_platform_device(dev)); | 167 | struct s3c_hwmon *hwmon = platform_get_drvdata(to_platform_device(dev)); |
168 | struct s3c_hwmon_pdata *pdata = dev->platform_data; | 168 | struct s3c_hwmon_pdata *pdata = dev_get_platdata(dev); |
169 | struct s3c_hwmon_chcfg *cfg; | 169 | struct s3c_hwmon_chcfg *cfg; |
170 | int ret; | 170 | int ret; |
171 | 171 | ||
@@ -194,7 +194,7 @@ static ssize_t s3c_hwmon_label_show(struct device *dev, | |||
194 | char *buf) | 194 | char *buf) |
195 | { | 195 | { |
196 | struct sensor_device_attribute *sen_attr = to_sensor_dev_attr(attr); | 196 | struct sensor_device_attribute *sen_attr = to_sensor_dev_attr(attr); |
197 | struct s3c_hwmon_pdata *pdata = dev->platform_data; | 197 | struct s3c_hwmon_pdata *pdata = dev_get_platdata(dev); |
198 | struct s3c_hwmon_chcfg *cfg; | 198 | struct s3c_hwmon_chcfg *cfg; |
199 | 199 | ||
200 | cfg = pdata->in[sen_attr->index]; | 200 | cfg = pdata->in[sen_attr->index]; |
@@ -274,7 +274,7 @@ static void s3c_hwmon_remove_attr(struct device *dev, | |||
274 | */ | 274 | */ |
275 | static int s3c_hwmon_probe(struct platform_device *dev) | 275 | static int s3c_hwmon_probe(struct platform_device *dev) |
276 | { | 276 | { |
277 | struct s3c_hwmon_pdata *pdata = dev->dev.platform_data; | 277 | struct s3c_hwmon_pdata *pdata = dev_get_platdata(&dev->dev); |
278 | struct s3c_hwmon *hwmon; | 278 | struct s3c_hwmon *hwmon; |
279 | int ret = 0; | 279 | int ret = 0; |
280 | int i; | 280 | int i; |
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c index 2507f902fb7a..883d291ff49a 100644 --- a/drivers/hwmon/sht15.c +++ b/drivers/hwmon/sht15.c | |||
@@ -940,11 +940,11 @@ static int sht15_probe(struct platform_device *pdev) | |||
940 | data->dev = &pdev->dev; | 940 | data->dev = &pdev->dev; |
941 | init_waitqueue_head(&data->wait_queue); | 941 | init_waitqueue_head(&data->wait_queue); |
942 | 942 | ||
943 | if (pdev->dev.platform_data == NULL) { | 943 | if (dev_get_platdata(&pdev->dev) == NULL) { |
944 | dev_err(&pdev->dev, "no platform data supplied\n"); | 944 | dev_err(&pdev->dev, "no platform data supplied\n"); |
945 | return -EINVAL; | 945 | return -EINVAL; |
946 | } | 946 | } |
947 | data->pdata = pdev->dev.platform_data; | 947 | data->pdata = dev_get_platdata(&pdev->dev); |
948 | data->supply_uv = data->pdata->supply_mv * 1000; | 948 | data->supply_uv = data->pdata->supply_mv * 1000; |
949 | if (data->pdata->checksum) | 949 | if (data->pdata->checksum) |
950 | data->checksumming = true; | 950 | data->checksumming = true; |
diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c index 6d8255ccf07a..05cb814539cb 100644 --- a/drivers/hwmon/smsc47m1.c +++ b/drivers/hwmon/smsc47m1.c | |||
@@ -668,7 +668,7 @@ static void smsc47m1_remove_files(struct device *dev) | |||
668 | static int __init smsc47m1_probe(struct platform_device *pdev) | 668 | static int __init smsc47m1_probe(struct platform_device *pdev) |
669 | { | 669 | { |
670 | struct device *dev = &pdev->dev; | 670 | struct device *dev = &pdev->dev; |
671 | struct smsc47m1_sio_data *sio_data = dev->platform_data; | 671 | struct smsc47m1_sio_data *sio_data = dev_get_platdata(dev); |
672 | struct smsc47m1_data *data; | 672 | struct smsc47m1_data *data; |
673 | struct resource *res; | 673 | struct resource *res; |
674 | int err; | 674 | int err; |
@@ -940,7 +940,7 @@ exit_device: | |||
940 | static void __exit sm_smsc47m1_exit(void) | 940 | static void __exit sm_smsc47m1_exit(void) |
941 | { | 941 | { |
942 | platform_driver_unregister(&smsc47m1_driver); | 942 | platform_driver_unregister(&smsc47m1_driver); |
943 | smsc47m1_restore(pdev->dev.platform_data); | 943 | smsc47m1_restore(dev_get_platdata(&pdev->dev)); |
944 | platform_device_unregister(pdev); | 944 | platform_device_unregister(pdev); |
945 | } | 945 | } |
946 | 946 | ||
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c index 004801e6fbb9..286ca7bae97c 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c | |||
@@ -673,7 +673,7 @@ static void w83627ehf_write_fan_div(struct w83627ehf_data *data, int nr) | |||
673 | static void w83627ehf_write_fan_div_common(struct device *dev, | 673 | static void w83627ehf_write_fan_div_common(struct device *dev, |
674 | struct w83627ehf_data *data, int nr) | 674 | struct w83627ehf_data *data, int nr) |
675 | { | 675 | { |
676 | struct w83627ehf_sio_data *sio_data = dev->platform_data; | 676 | struct w83627ehf_sio_data *sio_data = dev_get_platdata(dev); |
677 | 677 | ||
678 | if (sio_data->kind == nct6776) | 678 | if (sio_data->kind == nct6776) |
679 | ; /* no dividers, do nothing */ | 679 | ; /* no dividers, do nothing */ |
@@ -724,7 +724,7 @@ static void w83627ehf_update_fan_div(struct w83627ehf_data *data) | |||
724 | static void w83627ehf_update_fan_div_common(struct device *dev, | 724 | static void w83627ehf_update_fan_div_common(struct device *dev, |
725 | struct w83627ehf_data *data) | 725 | struct w83627ehf_data *data) |
726 | { | 726 | { |
727 | struct w83627ehf_sio_data *sio_data = dev->platform_data; | 727 | struct w83627ehf_sio_data *sio_data = dev_get_platdata(dev); |
728 | 728 | ||
729 | if (sio_data->kind == nct6776) | 729 | if (sio_data->kind == nct6776) |
730 | ; /* no dividers, do nothing */ | 730 | ; /* no dividers, do nothing */ |
@@ -781,7 +781,7 @@ static void w83627ehf_update_pwm(struct w83627ehf_data *data) | |||
781 | static void w83627ehf_update_pwm_common(struct device *dev, | 781 | static void w83627ehf_update_pwm_common(struct device *dev, |
782 | struct w83627ehf_data *data) | 782 | struct w83627ehf_data *data) |
783 | { | 783 | { |
784 | struct w83627ehf_sio_data *sio_data = dev->platform_data; | 784 | struct w83627ehf_sio_data *sio_data = dev_get_platdata(dev); |
785 | 785 | ||
786 | if (sio_data->kind == nct6775 || sio_data->kind == nct6776) | 786 | if (sio_data->kind == nct6775 || sio_data->kind == nct6776) |
787 | nct6775_update_pwm(data); | 787 | nct6775_update_pwm(data); |
@@ -792,7 +792,7 @@ static void w83627ehf_update_pwm_common(struct device *dev, | |||
792 | static struct w83627ehf_data *w83627ehf_update_device(struct device *dev) | 792 | static struct w83627ehf_data *w83627ehf_update_device(struct device *dev) |
793 | { | 793 | { |
794 | struct w83627ehf_data *data = dev_get_drvdata(dev); | 794 | struct w83627ehf_data *data = dev_get_drvdata(dev); |
795 | struct w83627ehf_sio_data *sio_data = dev->platform_data; | 795 | struct w83627ehf_sio_data *sio_data = dev_get_platdata(dev); |
796 | 796 | ||
797 | int i; | 797 | int i; |
798 | 798 | ||
@@ -1392,7 +1392,7 @@ store_pwm_mode(struct device *dev, struct device_attribute *attr, | |||
1392 | { | 1392 | { |
1393 | struct w83627ehf_data *data = dev_get_drvdata(dev); | 1393 | struct w83627ehf_data *data = dev_get_drvdata(dev); |
1394 | struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); | 1394 | struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); |
1395 | struct w83627ehf_sio_data *sio_data = dev->platform_data; | 1395 | struct w83627ehf_sio_data *sio_data = dev_get_platdata(dev); |
1396 | int nr = sensor_attr->index; | 1396 | int nr = sensor_attr->index; |
1397 | unsigned long val; | 1397 | unsigned long val; |
1398 | int err; | 1398 | int err; |
@@ -1448,7 +1448,7 @@ store_pwm_enable(struct device *dev, struct device_attribute *attr, | |||
1448 | const char *buf, size_t count) | 1448 | const char *buf, size_t count) |
1449 | { | 1449 | { |
1450 | struct w83627ehf_data *data = dev_get_drvdata(dev); | 1450 | struct w83627ehf_data *data = dev_get_drvdata(dev); |
1451 | struct w83627ehf_sio_data *sio_data = dev->platform_data; | 1451 | struct w83627ehf_sio_data *sio_data = dev_get_platdata(dev); |
1452 | struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); | 1452 | struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); |
1453 | int nr = sensor_attr->index; | 1453 | int nr = sensor_attr->index; |
1454 | unsigned long val; | 1454 | unsigned long val; |
@@ -1527,7 +1527,7 @@ store_tolerance(struct device *dev, struct device_attribute *attr, | |||
1527 | const char *buf, size_t count) | 1527 | const char *buf, size_t count) |
1528 | { | 1528 | { |
1529 | struct w83627ehf_data *data = dev_get_drvdata(dev); | 1529 | struct w83627ehf_data *data = dev_get_drvdata(dev); |
1530 | struct w83627ehf_sio_data *sio_data = dev->platform_data; | 1530 | struct w83627ehf_sio_data *sio_data = dev_get_platdata(dev); |
1531 | struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); | 1531 | struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); |
1532 | int nr = sensor_attr->index; | 1532 | int nr = sensor_attr->index; |
1533 | u16 reg; | 1533 | u16 reg; |
@@ -2065,7 +2065,7 @@ w83627ehf_check_fan_inputs(const struct w83627ehf_sio_data *sio_data, | |||
2065 | static int w83627ehf_probe(struct platform_device *pdev) | 2065 | static int w83627ehf_probe(struct platform_device *pdev) |
2066 | { | 2066 | { |
2067 | struct device *dev = &pdev->dev; | 2067 | struct device *dev = &pdev->dev; |
2068 | struct w83627ehf_sio_data *sio_data = dev->platform_data; | 2068 | struct w83627ehf_sio_data *sio_data = dev_get_platdata(dev); |
2069 | struct w83627ehf_data *data; | 2069 | struct w83627ehf_data *data; |
2070 | struct resource *res; | 2070 | struct resource *res; |
2071 | u8 en_vrm10; | 2071 | u8 en_vrm10; |
@@ -2618,7 +2618,7 @@ static int w83627ehf_remove(struct platform_device *pdev) | |||
2618 | static int w83627ehf_suspend(struct device *dev) | 2618 | static int w83627ehf_suspend(struct device *dev) |
2619 | { | 2619 | { |
2620 | struct w83627ehf_data *data = w83627ehf_update_device(dev); | 2620 | struct w83627ehf_data *data = w83627ehf_update_device(dev); |
2621 | struct w83627ehf_sio_data *sio_data = dev->platform_data; | 2621 | struct w83627ehf_sio_data *sio_data = dev_get_platdata(dev); |
2622 | 2622 | ||
2623 | mutex_lock(&data->update_lock); | 2623 | mutex_lock(&data->update_lock); |
2624 | data->vbat = w83627ehf_read_value(data, W83627EHF_REG_VBAT); | 2624 | data->vbat = w83627ehf_read_value(data, W83627EHF_REG_VBAT); |
@@ -2634,7 +2634,7 @@ static int w83627ehf_suspend(struct device *dev) | |||
2634 | static int w83627ehf_resume(struct device *dev) | 2634 | static int w83627ehf_resume(struct device *dev) |
2635 | { | 2635 | { |
2636 | struct w83627ehf_data *data = dev_get_drvdata(dev); | 2636 | struct w83627ehf_data *data = dev_get_drvdata(dev); |
2637 | struct w83627ehf_sio_data *sio_data = dev->platform_data; | 2637 | struct w83627ehf_sio_data *sio_data = dev_get_platdata(dev); |
2638 | int i; | 2638 | int i; |
2639 | 2639 | ||
2640 | mutex_lock(&data->update_lock); | 2640 | mutex_lock(&data->update_lock); |
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c index 3b9ef2d23452..cb9cd326ecb5 100644 --- a/drivers/hwmon/w83627hf.c +++ b/drivers/hwmon/w83627hf.c | |||
@@ -1415,7 +1415,7 @@ static const struct attribute_group w83627hf_group_opt = { | |||
1415 | static int w83627hf_probe(struct platform_device *pdev) | 1415 | static int w83627hf_probe(struct platform_device *pdev) |
1416 | { | 1416 | { |
1417 | struct device *dev = &pdev->dev; | 1417 | struct device *dev = &pdev->dev; |
1418 | struct w83627hf_sio_data *sio_data = dev->platform_data; | 1418 | struct w83627hf_sio_data *sio_data = dev_get_platdata(dev); |
1419 | struct w83627hf_data *data; | 1419 | struct w83627hf_data *data; |
1420 | struct resource *res; | 1420 | struct resource *res; |
1421 | int err, i; | 1421 | int err, i; |
@@ -1636,7 +1636,7 @@ static int w83627hf_read_value(struct w83627hf_data *data, u16 reg) | |||
1636 | 1636 | ||
1637 | static int w83627thf_read_gpio5(struct platform_device *pdev) | 1637 | static int w83627thf_read_gpio5(struct platform_device *pdev) |
1638 | { | 1638 | { |
1639 | struct w83627hf_sio_data *sio_data = pdev->dev.platform_data; | 1639 | struct w83627hf_sio_data *sio_data = dev_get_platdata(&pdev->dev); |
1640 | int res = 0xff, sel; | 1640 | int res = 0xff, sel; |
1641 | 1641 | ||
1642 | superio_enter(sio_data); | 1642 | superio_enter(sio_data); |
@@ -1669,7 +1669,7 @@ exit: | |||
1669 | 1669 | ||
1670 | static int w83687thf_read_vid(struct platform_device *pdev) | 1670 | static int w83687thf_read_vid(struct platform_device *pdev) |
1671 | { | 1671 | { |
1672 | struct w83627hf_sio_data *sio_data = pdev->dev.platform_data; | 1672 | struct w83627hf_sio_data *sio_data = dev_get_platdata(&pdev->dev); |
1673 | int res = 0xff; | 1673 | int res = 0xff; |
1674 | 1674 | ||
1675 | superio_enter(sio_data); | 1675 | superio_enter(sio_data); |