aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2013-08-21 06:08:14 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2013-08-21 06:08:14 -0400
commit828fa1e60117535d9b1e1b09444842ae66e8424d (patch)
tree281f5bff9a12c760ca947a98569df63c8ca85909 /drivers/mfd
parent09fd86780bb4603df1886e17127f5beb97f70ffb (diff)
parent8a105ca202b1a1061a24f1e980206cd2808e2f8b (diff)
Merge tag 'mfd-lee-3.12-1' of git://git.linaro.org/people/ljones/mfd
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/88pm800.c2
-rw-r--r--drivers/mfd/88pm805.c2
-rw-r--r--drivers/mfd/88pm860x-core.c2
-rw-r--r--drivers/mfd/aat2870-core.c2
-rw-r--r--drivers/mfd/ab3100-core.c2
-rw-r--r--drivers/mfd/ab8500-gpadc.c4
-rw-r--r--drivers/mfd/adp5520.c2
-rw-r--r--drivers/mfd/arizona-core.c2
-rw-r--r--drivers/mfd/as3711.c2
-rw-r--r--drivers/mfd/asic3.c2
-rw-r--r--drivers/mfd/da903x.c2
-rw-r--r--drivers/mfd/da9052-core.c2
-rw-r--r--drivers/mfd/da9055-core.c2
-rw-r--r--drivers/mfd/dm355evm_msp.c4
-rw-r--r--drivers/mfd/ezx-pcap.c6
-rw-r--r--drivers/mfd/htc-egpio.c2
-rw-r--r--drivers/mfd/htc-i2cpld.c10
-rw-r--r--drivers/mfd/htc-pasic3.c2
-rw-r--r--drivers/mfd/intel_msic.c4
-rw-r--r--drivers/mfd/kempld-core.c30
-rw-r--r--drivers/mfd/lm3533-core.c8
-rw-r--r--drivers/mfd/lp8788.c2
-rw-r--r--drivers/mfd/lpc_ich.c2
-rw-r--r--drivers/mfd/max77686.c2
-rw-r--r--drivers/mfd/max77693.c2
-rw-r--r--drivers/mfd/max8925-i2c.c2
-rw-r--r--drivers/mfd/max8997.c18
-rw-r--r--drivers/mfd/max8998.c7
-rw-r--r--drivers/mfd/mcp-sa11x0.c2
-rw-r--r--drivers/mfd/menelaus.c22
-rw-r--r--drivers/mfd/mfd-core.c2
-rw-r--r--drivers/mfd/omap-usb-host.c4
-rw-r--r--drivers/mfd/palmas.c33
-rw-r--r--drivers/mfd/pcf50633-adc.c3
-rw-r--r--drivers/mfd/pcf50633-core.c2
-rw-r--r--drivers/mfd/pm8921-core.c14
-rw-r--r--drivers/mfd/rc5t583.c2
-rw-r--r--drivers/mfd/sec-core.c6
-rw-r--r--drivers/mfd/si476x-i2c.c2
-rw-r--r--drivers/mfd/sm501.c6
-rw-r--r--drivers/mfd/sta2x11-mfd.c4
-rw-r--r--drivers/mfd/stmpe.c3
-rw-r--r--drivers/mfd/t7l66xb.c8
-rw-r--r--drivers/mfd/tc3589x.c2
-rw-r--r--drivers/mfd/tc6387xb.c6
-rw-r--r--drivers/mfd/tc6393xb.c8
-rw-r--r--drivers/mfd/ti-ssp.c2
-rw-r--r--drivers/mfd/ti_am335x_tscadc.c8
-rw-r--r--drivers/mfd/tps6105x.c2
-rw-r--r--drivers/mfd/tps65010.c24
-rw-r--r--drivers/mfd/tps65090.c2
-rw-r--r--drivers/mfd/tps6586x.c2
-rw-r--r--drivers/mfd/tps65912-core.c2
-rw-r--r--drivers/mfd/tps80031.c2
-rw-r--r--drivers/mfd/twl-core.c2
-rw-r--r--drivers/mfd/twl4030-audio.c2
-rw-r--r--drivers/mfd/twl4030-madc.c2
-rw-r--r--drivers/mfd/twl4030-power.c8
-rw-r--r--drivers/mfd/ucb1400_core.c2
-rw-r--r--drivers/mfd/ucb1x00-core.c6
-rw-r--r--drivers/mfd/wl1273-core.c8
-rw-r--r--drivers/mfd/wm5110-tables.c18
-rw-r--r--drivers/mfd/wm831x-core.c2
-rw-r--r--drivers/mfd/wm831x-irq.c2
-rw-r--r--drivers/mfd/wm831x-spi.c1
-rw-r--r--drivers/mfd/wm8350-i2c.c3
-rw-r--r--drivers/mfd/wm8400-core.c2
-rw-r--r--drivers/mfd/wm8994-irq.c2
68 files changed, 209 insertions, 153 deletions
diff --git a/drivers/mfd/88pm800.c b/drivers/mfd/88pm800.c
index 6c954835d61e..cd9e17471232 100644
--- a/drivers/mfd/88pm800.c
+++ b/drivers/mfd/88pm800.c
@@ -541,7 +541,7 @@ static int pm800_probe(struct i2c_client *client,
541{ 541{
542 int ret = 0; 542 int ret = 0;
543 struct pm80x_chip *chip; 543 struct pm80x_chip *chip;
544 struct pm80x_platform_data *pdata = client->dev.platform_data; 544 struct pm80x_platform_data *pdata = dev_get_platdata(&client->dev);
545 struct pm80x_subchip *subchip; 545 struct pm80x_subchip *subchip;
546 546
547 ret = pm80x_init(client); 547 ret = pm80x_init(client);
diff --git a/drivers/mfd/88pm805.c b/drivers/mfd/88pm805.c
index 521602231c7b..0686cdb06b3e 100644
--- a/drivers/mfd/88pm805.c
+++ b/drivers/mfd/88pm805.c
@@ -227,7 +227,7 @@ static int pm805_probe(struct i2c_client *client,
227{ 227{
228 int ret = 0; 228 int ret = 0;
229 struct pm80x_chip *chip; 229 struct pm80x_chip *chip;
230 struct pm80x_platform_data *pdata = client->dev.platform_data; 230 struct pm80x_platform_data *pdata = dev_get_platdata(&client->dev);
231 231
232 ret = pm80x_init(client); 232 ret = pm80x_init(client);
233 if (ret) { 233 if (ret) {
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index eeb481d426b5..7ebe9ef1eba6 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -1130,7 +1130,7 @@ static int pm860x_dt_init(struct device_node *np,
1130static int pm860x_probe(struct i2c_client *client, 1130static int pm860x_probe(struct i2c_client *client,
1131 const struct i2c_device_id *id) 1131 const struct i2c_device_id *id)
1132{ 1132{
1133 struct pm860x_platform_data *pdata = client->dev.platform_data; 1133 struct pm860x_platform_data *pdata = dev_get_platdata(&client->dev);
1134 struct device_node *node = client->dev.of_node; 1134 struct device_node *node = client->dev.of_node;
1135 struct pm860x_chip *chip; 1135 struct pm860x_chip *chip;
1136 int ret; 1136 int ret;
diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index d4f594517521..6f68472e0ca6 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -363,7 +363,7 @@ static inline void aat2870_uninit_debugfs(struct aat2870_data *aat2870)
363static int aat2870_i2c_probe(struct i2c_client *client, 363static int aat2870_i2c_probe(struct i2c_client *client,
364 const struct i2c_device_id *id) 364 const struct i2c_device_id *id)
365{ 365{
366 struct aat2870_platform_data *pdata = client->dev.platform_data; 366 struct aat2870_platform_data *pdata = dev_get_platdata(&client->dev);
367 struct aat2870_data *aat2870; 367 struct aat2870_data *aat2870;
368 int i, j; 368 int i, j;
369 int ret = 0; 369 int ret = 0;
diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
index ddc669d19530..b348ae520629 100644
--- a/drivers/mfd/ab3100-core.c
+++ b/drivers/mfd/ab3100-core.c
@@ -854,7 +854,7 @@ static int ab3100_probe(struct i2c_client *client,
854{ 854{
855 struct ab3100 *ab3100; 855 struct ab3100 *ab3100;
856 struct ab3100_platform_data *ab3100_plf_data = 856 struct ab3100_platform_data *ab3100_plf_data =
857 client->dev.platform_data; 857 dev_get_platdata(&client->dev);
858 int err; 858 int err;
859 int i; 859 int i;
860 860
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
index 7623e9123828..36000f920981 100644
--- a/drivers/mfd/ab8500-gpadc.c
+++ b/drivers/mfd/ab8500-gpadc.c
@@ -867,6 +867,7 @@ static void ab8500_gpadc_read_calibration_data(struct ab8500_gpadc *gpadc)
867 gpadc->cal_data[ADC_INPUT_VBAT].offset); 867 gpadc->cal_data[ADC_INPUT_VBAT].offset);
868} 868}
869 869
870#ifdef CONFIG_PM_RUNTIME
870static int ab8500_gpadc_runtime_suspend(struct device *dev) 871static int ab8500_gpadc_runtime_suspend(struct device *dev)
871{ 872{
872 struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); 873 struct ab8500_gpadc *gpadc = dev_get_drvdata(dev);
@@ -885,7 +886,9 @@ static int ab8500_gpadc_runtime_resume(struct device *dev)
885 dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret); 886 dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret);
886 return ret; 887 return ret;
887} 888}
889#endif
888 890
891#ifdef CONFIG_PM_SLEEP
889static int ab8500_gpadc_suspend(struct device *dev) 892static int ab8500_gpadc_suspend(struct device *dev)
890{ 893{
891 struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); 894 struct ab8500_gpadc *gpadc = dev_get_drvdata(dev);
@@ -913,6 +916,7 @@ static int ab8500_gpadc_resume(struct device *dev)
913 mutex_unlock(&gpadc->ab8500_gpadc_lock); 916 mutex_unlock(&gpadc->ab8500_gpadc_lock);
914 return ret; 917 return ret;
915} 918}
919#endif
916 920
917static int ab8500_gpadc_probe(struct platform_device *pdev) 921static int ab8500_gpadc_probe(struct platform_device *pdev)
918{ 922{
diff --git a/drivers/mfd/adp5520.c b/drivers/mfd/adp5520.c
index 28346ad0b4a6..62501553d63c 100644
--- a/drivers/mfd/adp5520.c
+++ b/drivers/mfd/adp5520.c
@@ -207,7 +207,7 @@ static int adp5520_remove_subdevs(struct adp5520_chip *chip)
207static int adp5520_probe(struct i2c_client *client, 207static int adp5520_probe(struct i2c_client *client,
208 const struct i2c_device_id *id) 208 const struct i2c_device_id *id)
209{ 209{
210 struct adp5520_platform_data *pdata = client->dev.platform_data; 210 struct adp5520_platform_data *pdata = dev_get_platdata(&client->dev);
211 struct platform_device *pdev; 211 struct platform_device *pdev;
212 struct adp5520_chip *chip; 212 struct adp5520_chip *chip;
213 int ret; 213 int ret;
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 89a115301a0c..5ac3aa48473b 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -438,9 +438,9 @@ static int arizona_runtime_suspend(struct device *dev)
438 } 438 }
439 } 439 }
440 440
441 regulator_disable(arizona->dcvdd);
442 regcache_cache_only(arizona->regmap, true); 441 regcache_cache_only(arizona->regmap, true);
443 regcache_mark_dirty(arizona->regmap); 442 regcache_mark_dirty(arizona->regmap);
443 regulator_disable(arizona->dcvdd);
444 444
445 return 0; 445 return 0;
446} 446}
diff --git a/drivers/mfd/as3711.c b/drivers/mfd/as3711.c
index 01e414162702..abd3ab7c0908 100644
--- a/drivers/mfd/as3711.c
+++ b/drivers/mfd/as3711.c
@@ -129,7 +129,7 @@ static int as3711_i2c_probe(struct i2c_client *client,
129 int ret; 129 int ret;
130 130
131 if (!client->dev.of_node) { 131 if (!client->dev.of_node) {
132 pdata = client->dev.platform_data; 132 pdata = dev_get_platdata(&client->dev);
133 if (!pdata) 133 if (!pdata)
134 dev_dbg(&client->dev, "Platform data not found\n"); 134 dev_dbg(&client->dev, "Platform data not found\n");
135 } else { 135 } else {
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index 9532f749412f..fa22154c84e4 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -952,7 +952,7 @@ static void asic3_mfd_remove(struct platform_device *pdev)
952/* Core */ 952/* Core */
953static int __init asic3_probe(struct platform_device *pdev) 953static int __init asic3_probe(struct platform_device *pdev)
954{ 954{
955 struct asic3_platform_data *pdata = pdev->dev.platform_data; 955 struct asic3_platform_data *pdata = dev_get_platdata(&pdev->dev);
956 struct asic3 *asic; 956 struct asic3 *asic;
957 struct resource *mem; 957 struct resource *mem;
958 unsigned long clksel; 958 unsigned long clksel;
diff --git a/drivers/mfd/da903x.c b/drivers/mfd/da903x.c
index f1a316e0d6a6..e0a2e0ee603b 100644
--- a/drivers/mfd/da903x.c
+++ b/drivers/mfd/da903x.c
@@ -494,7 +494,7 @@ failed:
494static int da903x_probe(struct i2c_client *client, 494static int da903x_probe(struct i2c_client *client,
495 const struct i2c_device_id *id) 495 const struct i2c_device_id *id)
496{ 496{
497 struct da903x_platform_data *pdata = client->dev.platform_data; 497 struct da903x_platform_data *pdata = dev_get_platdata(&client->dev);
498 struct da903x_chip *chip; 498 struct da903x_chip *chip;
499 unsigned int tmp; 499 unsigned int tmp;
500 int ret; 500 int ret;
diff --git a/drivers/mfd/da9052-core.c b/drivers/mfd/da9052-core.c
index a3c9613f9166..ea28a33576e4 100644
--- a/drivers/mfd/da9052-core.c
+++ b/drivers/mfd/da9052-core.c
@@ -534,7 +534,7 @@ EXPORT_SYMBOL_GPL(da9052_regmap_config);
534 534
535int da9052_device_init(struct da9052 *da9052, u8 chip_id) 535int da9052_device_init(struct da9052 *da9052, u8 chip_id)
536{ 536{
537 struct da9052_pdata *pdata = da9052->dev->platform_data; 537 struct da9052_pdata *pdata = dev_get_platdata(da9052->dev);
538 int ret; 538 int ret;
539 539
540 mutex_init(&da9052->auxadc_lock); 540 mutex_init(&da9052->auxadc_lock);
diff --git a/drivers/mfd/da9055-core.c b/drivers/mfd/da9055-core.c
index e4c0596723ab..d3670cd3c3c6 100644
--- a/drivers/mfd/da9055-core.c
+++ b/drivers/mfd/da9055-core.c
@@ -379,7 +379,7 @@ static struct regmap_irq_chip da9055_regmap_irq_chip = {
379 379
380int da9055_device_init(struct da9055 *da9055) 380int da9055_device_init(struct da9055 *da9055)
381{ 381{
382 struct da9055_pdata *pdata = da9055->dev->platform_data; 382 struct da9055_pdata *pdata = dev_get_platdata(da9055->dev);
383 int ret; 383 int ret;
384 uint8_t clear_events[3] = {0xFF, 0xFF, 0xFF}; 384 uint8_t clear_events[3] = {0xFF, 0xFF, 0xFF};
385 385
diff --git a/drivers/mfd/dm355evm_msp.c b/drivers/mfd/dm355evm_msp.c
index 7710227d284e..7a55c0071fa8 100644
--- a/drivers/mfd/dm355evm_msp.c
+++ b/drivers/mfd/dm355evm_msp.c
@@ -315,8 +315,8 @@ static int add_children(struct i2c_client *client)
315 } 315 }
316 316
317 /* MMC/SD inputs -- right after the last config input */ 317 /* MMC/SD inputs -- right after the last config input */
318 if (client->dev.platform_data) { 318 if (dev_get_platdata(&client->dev)) {
319 void (*mmcsd_setup)(unsigned) = client->dev.platform_data; 319 void (*mmcsd_setup)(unsigned) = dev_get_platdata(&client->dev);
320 320
321 mmcsd_setup(dm355evm_msp_gpio.base + 8 + 5); 321 mmcsd_setup(dm355evm_msp_gpio.base + 8 + 5);
322 } 322 }
diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c
index 5502106ad515..7245b0c5b794 100644
--- a/drivers/mfd/ezx-pcap.c
+++ b/drivers/mfd/ezx-pcap.c
@@ -177,7 +177,7 @@ static void pcap_msr_work(struct work_struct *work)
177static void pcap_isr_work(struct work_struct *work) 177static void pcap_isr_work(struct work_struct *work)
178{ 178{
179 struct pcap_chip *pcap = container_of(work, struct pcap_chip, isr_work); 179 struct pcap_chip *pcap = container_of(work, struct pcap_chip, isr_work);
180 struct pcap_platform_data *pdata = pcap->spi->dev.platform_data; 180 struct pcap_platform_data *pdata = dev_get_platdata(&pcap->spi->dev);
181 u32 msr, isr, int_sel, service; 181 u32 msr, isr, int_sel, service;
182 int irq; 182 int irq;
183 183
@@ -394,7 +394,7 @@ static int pcap_add_subdev(struct pcap_chip *pcap,
394static int ezx_pcap_remove(struct spi_device *spi) 394static int ezx_pcap_remove(struct spi_device *spi)
395{ 395{
396 struct pcap_chip *pcap = spi_get_drvdata(spi); 396 struct pcap_chip *pcap = spi_get_drvdata(spi);
397 struct pcap_platform_data *pdata = spi->dev.platform_data; 397 struct pcap_platform_data *pdata = dev_get_platdata(&spi->dev);
398 int i, adc_irq; 398 int i, adc_irq;
399 399
400 /* remove all registered subdevs */ 400 /* remove all registered subdevs */
@@ -420,7 +420,7 @@ static int ezx_pcap_remove(struct spi_device *spi)
420 420
421static int ezx_pcap_probe(struct spi_device *spi) 421static int ezx_pcap_probe(struct spi_device *spi)
422{ 422{
423 struct pcap_platform_data *pdata = spi->dev.platform_data; 423 struct pcap_platform_data *pdata = dev_get_platdata(&spi->dev);
424 struct pcap_chip *pcap; 424 struct pcap_chip *pcap;
425 int i, adc_irq; 425 int i, adc_irq;
426 int ret = -ENODEV; 426 int ret = -ENODEV;
diff --git a/drivers/mfd/htc-egpio.c b/drivers/mfd/htc-egpio.c
index 26aca545084b..49f39feca784 100644
--- a/drivers/mfd/htc-egpio.c
+++ b/drivers/mfd/htc-egpio.c
@@ -261,7 +261,7 @@ static void egpio_write_cache(struct egpio_info *ei)
261 261
262static int __init egpio_probe(struct platform_device *pdev) 262static int __init egpio_probe(struct platform_device *pdev)
263{ 263{
264 struct htc_egpio_platform_data *pdata = pdev->dev.platform_data; 264 struct htc_egpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
265 struct resource *res; 265 struct resource *res;
266 struct egpio_info *ei; 266 struct egpio_info *ei;
267 struct gpio_chip *chip; 267 struct gpio_chip *chip;
diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c
index c9dfce6ae0c2..d7b2a75aca3e 100644
--- a/drivers/mfd/htc-i2cpld.c
+++ b/drivers/mfd/htc-i2cpld.c
@@ -340,7 +340,7 @@ static int htcpld_setup_chip_irq(
340 int ret = 0; 340 int ret = 0;
341 341
342 /* Get the platform and driver data */ 342 /* Get the platform and driver data */
343 pdata = dev->platform_data; 343 pdata = dev_get_platdata(dev);
344 htcpld = platform_get_drvdata(pdev); 344 htcpld = platform_get_drvdata(pdev);
345 chip = &htcpld->chip[chip_index]; 345 chip = &htcpld->chip[chip_index];
346 plat_chip_data = &pdata->chip[chip_index]; 346 plat_chip_data = &pdata->chip[chip_index];
@@ -375,7 +375,7 @@ static int htcpld_register_chip_i2c(
375 struct i2c_board_info info; 375 struct i2c_board_info info;
376 376
377 /* Get the platform and driver data */ 377 /* Get the platform and driver data */
378 pdata = dev->platform_data; 378 pdata = dev_get_platdata(dev);
379 htcpld = platform_get_drvdata(pdev); 379 htcpld = platform_get_drvdata(pdev);
380 chip = &htcpld->chip[chip_index]; 380 chip = &htcpld->chip[chip_index];
381 plat_chip_data = &pdata->chip[chip_index]; 381 plat_chip_data = &pdata->chip[chip_index];
@@ -447,7 +447,7 @@ static int htcpld_register_chip_gpio(
447 int ret = 0; 447 int ret = 0;
448 448
449 /* Get the platform and driver data */ 449 /* Get the platform and driver data */
450 pdata = dev->platform_data; 450 pdata = dev_get_platdata(dev);
451 htcpld = platform_get_drvdata(pdev); 451 htcpld = platform_get_drvdata(pdev);
452 chip = &htcpld->chip[chip_index]; 452 chip = &htcpld->chip[chip_index];
453 plat_chip_data = &pdata->chip[chip_index]; 453 plat_chip_data = &pdata->chip[chip_index];
@@ -509,7 +509,7 @@ static int htcpld_setup_chips(struct platform_device *pdev)
509 int i; 509 int i;
510 510
511 /* Get the platform and driver data */ 511 /* Get the platform and driver data */
512 pdata = dev->platform_data; 512 pdata = dev_get_platdata(dev);
513 htcpld = platform_get_drvdata(pdev); 513 htcpld = platform_get_drvdata(pdev);
514 514
515 /* Setup each chip's output GPIOs */ 515 /* Setup each chip's output GPIOs */
@@ -574,7 +574,7 @@ static int htcpld_core_probe(struct platform_device *pdev)
574 if (!dev) 574 if (!dev)
575 return -ENODEV; 575 return -ENODEV;
576 576
577 pdata = dev->platform_data; 577 pdata = dev_get_platdata(dev);
578 if (!pdata) { 578 if (!pdata) {
579 dev_warn(dev, "Platform data not found for htcpld core!\n"); 579 dev_warn(dev, "Platform data not found for htcpld core!\n");
580 return -ENXIO; 580 return -ENXIO;
diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c
index 0a5e85fd8517..6bf92a507b95 100644
--- a/drivers/mfd/htc-pasic3.c
+++ b/drivers/mfd/htc-pasic3.c
@@ -126,7 +126,7 @@ static struct mfd_cell ds1wm_cell __initdata = {
126 126
127static int __init pasic3_probe(struct platform_device *pdev) 127static int __init pasic3_probe(struct platform_device *pdev)
128{ 128{
129 struct pasic3_platform_data *pdata = pdev->dev.platform_data; 129 struct pasic3_platform_data *pdata = dev_get_platdata(&pdev->dev);
130 struct device *dev = &pdev->dev; 130 struct device *dev = &pdev->dev;
131 struct pasic3_data *asic; 131 struct pasic3_data *asic;
132 struct resource *r; 132 struct resource *r;
diff --git a/drivers/mfd/intel_msic.c b/drivers/mfd/intel_msic.c
index 4f2462f0963e..9203d47cdbb1 100644
--- a/drivers/mfd/intel_msic.c
+++ b/drivers/mfd/intel_msic.c
@@ -310,7 +310,7 @@ EXPORT_SYMBOL_GPL(intel_msic_irq_read);
310static int intel_msic_init_devices(struct intel_msic *msic) 310static int intel_msic_init_devices(struct intel_msic *msic)
311{ 311{
312 struct platform_device *pdev = msic->pdev; 312 struct platform_device *pdev = msic->pdev;
313 struct intel_msic_platform_data *pdata = pdev->dev.platform_data; 313 struct intel_msic_platform_data *pdata = dev_get_platdata(&pdev->dev);
314 int ret, i; 314 int ret, i;
315 315
316 if (pdata->gpio) { 316 if (pdata->gpio) {
@@ -372,7 +372,7 @@ static void intel_msic_remove_devices(struct intel_msic *msic)
372 372
373static int intel_msic_probe(struct platform_device *pdev) 373static int intel_msic_probe(struct platform_device *pdev)
374{ 374{
375 struct intel_msic_platform_data *pdata = pdev->dev.platform_data; 375 struct intel_msic_platform_data *pdata = dev_get_platdata(&pdev->dev);
376 struct intel_msic *msic; 376 struct intel_msic *msic;
377 struct resource *res; 377 struct resource *res;
378 u8 id0, id1; 378 u8 id0, id1;
diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
index 686a4565acb6..d3e23278d299 100644
--- a/drivers/mfd/kempld-core.c
+++ b/drivers/mfd/kempld-core.c
@@ -258,7 +258,7 @@ EXPORT_SYMBOL_GPL(kempld_write32);
258 */ 258 */
259void kempld_get_mutex(struct kempld_device_data *pld) 259void kempld_get_mutex(struct kempld_device_data *pld)
260{ 260{
261 struct kempld_platform_data *pdata = pld->dev->platform_data; 261 struct kempld_platform_data *pdata = dev_get_platdata(pld->dev);
262 262
263 mutex_lock(&pld->lock); 263 mutex_lock(&pld->lock);
264 pdata->get_hardware_mutex(pld); 264 pdata->get_hardware_mutex(pld);
@@ -271,7 +271,7 @@ EXPORT_SYMBOL_GPL(kempld_get_mutex);
271 */ 271 */
272void kempld_release_mutex(struct kempld_device_data *pld) 272void kempld_release_mutex(struct kempld_device_data *pld)
273{ 273{
274 struct kempld_platform_data *pdata = pld->dev->platform_data; 274 struct kempld_platform_data *pdata = dev_get_platdata(pld->dev);
275 275
276 pdata->release_hardware_mutex(pld); 276 pdata->release_hardware_mutex(pld);
277 mutex_unlock(&pld->lock); 277 mutex_unlock(&pld->lock);
@@ -288,7 +288,7 @@ EXPORT_SYMBOL_GPL(kempld_release_mutex);
288 */ 288 */
289static int kempld_get_info(struct kempld_device_data *pld) 289static int kempld_get_info(struct kempld_device_data *pld)
290{ 290{
291 struct kempld_platform_data *pdata = pld->dev->platform_data; 291 struct kempld_platform_data *pdata = dev_get_platdata(pld->dev);
292 292
293 return pdata->get_info(pld); 293 return pdata->get_info(pld);
294} 294}
@@ -302,7 +302,7 @@ static int kempld_get_info(struct kempld_device_data *pld)
302 */ 302 */
303static int kempld_register_cells(struct kempld_device_data *pld) 303static int kempld_register_cells(struct kempld_device_data *pld)
304{ 304{
305 struct kempld_platform_data *pdata = pld->dev->platform_data; 305 struct kempld_platform_data *pdata = dev_get_platdata(pld->dev);
306 306
307 return pdata->register_cells(pld); 307 return pdata->register_cells(pld);
308} 308}
@@ -357,7 +357,7 @@ static int kempld_detect_device(struct kempld_device_data *pld)
357 357
358static int kempld_probe(struct platform_device *pdev) 358static int kempld_probe(struct platform_device *pdev)
359{ 359{
360 struct kempld_platform_data *pdata = pdev->dev.platform_data; 360 struct kempld_platform_data *pdata = dev_get_platdata(&pdev->dev);
361 struct device *dev = &pdev->dev; 361 struct device *dev = &pdev->dev;
362 struct kempld_device_data *pld; 362 struct kempld_device_data *pld;
363 struct resource *ioport; 363 struct resource *ioport;
@@ -394,7 +394,7 @@ static int kempld_probe(struct platform_device *pdev)
394static int kempld_remove(struct platform_device *pdev) 394static int kempld_remove(struct platform_device *pdev)
395{ 395{
396 struct kempld_device_data *pld = platform_get_drvdata(pdev); 396 struct kempld_device_data *pld = platform_get_drvdata(pdev);
397 struct kempld_platform_data *pdata = pld->dev->platform_data; 397 struct kempld_platform_data *pdata = dev_get_platdata(pld->dev);
398 398
399 mfd_remove_devices(&pdev->dev); 399 mfd_remove_devices(&pdev->dev);
400 pdata->release_hardware_mutex(pld); 400 pdata->release_hardware_mutex(pld);
@@ -413,6 +413,15 @@ static struct platform_driver kempld_driver = {
413 413
414static struct dmi_system_id __initdata kempld_dmi_table[] = { 414static struct dmi_system_id __initdata kempld_dmi_table[] = {
415 { 415 {
416 .ident = "BHL6",
417 .matches = {
418 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"),
419 DMI_MATCH(DMI_BOARD_NAME, "COMe-bHL6"),
420 },
421 .driver_data = (void *)&kempld_platform_data_generic,
422 .callback = kempld_create_platform_device,
423 },
424 {
416 .ident = "CCR2", 425 .ident = "CCR2",
417 .matches = { 426 .matches = {
418 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), 427 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"),
@@ -596,6 +605,15 @@ static struct dmi_system_id __initdata kempld_dmi_table[] = {
596 .driver_data = (void *)&kempld_platform_data_generic, 605 .driver_data = (void *)&kempld_platform_data_generic,
597 .callback = kempld_create_platform_device, 606 .callback = kempld_create_platform_device,
598 }, 607 },
608 {
609 .ident = "UTH6",
610 .matches = {
611 DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"),
612 DMI_MATCH(DMI_BOARD_NAME, "COMe-cTH6"),
613 },
614 .driver_data = (void *)&kempld_platform_data_generic,
615 .callback = kempld_create_platform_device,
616 },
599 {} 617 {}
600}; 618};
601MODULE_DEVICE_TABLE(dmi, kempld_dmi_table); 619MODULE_DEVICE_TABLE(dmi, kempld_dmi_table);
diff --git a/drivers/mfd/lm3533-core.c b/drivers/mfd/lm3533-core.c
index 4b7e6dac1de8..8c29f7b27324 100644
--- a/drivers/mfd/lm3533-core.c
+++ b/drivers/mfd/lm3533-core.c
@@ -384,7 +384,7 @@ static struct attribute_group lm3533_attribute_group = {
384 384
385static int lm3533_device_als_init(struct lm3533 *lm3533) 385static int lm3533_device_als_init(struct lm3533 *lm3533)
386{ 386{
387 struct lm3533_platform_data *pdata = lm3533->dev->platform_data; 387 struct lm3533_platform_data *pdata = dev_get_platdata(lm3533->dev);
388 int ret; 388 int ret;
389 389
390 if (!pdata->als) 390 if (!pdata->als)
@@ -407,7 +407,7 @@ static int lm3533_device_als_init(struct lm3533 *lm3533)
407 407
408static int lm3533_device_bl_init(struct lm3533 *lm3533) 408static int lm3533_device_bl_init(struct lm3533 *lm3533)
409{ 409{
410 struct lm3533_platform_data *pdata = lm3533->dev->platform_data; 410 struct lm3533_platform_data *pdata = dev_get_platdata(lm3533->dev);
411 int i; 411 int i;
412 int ret; 412 int ret;
413 413
@@ -436,7 +436,7 @@ static int lm3533_device_bl_init(struct lm3533 *lm3533)
436 436
437static int lm3533_device_led_init(struct lm3533 *lm3533) 437static int lm3533_device_led_init(struct lm3533 *lm3533)
438{ 438{
439 struct lm3533_platform_data *pdata = lm3533->dev->platform_data; 439 struct lm3533_platform_data *pdata = dev_get_platdata(lm3533->dev);
440 int i; 440 int i;
441 int ret; 441 int ret;
442 442
@@ -481,7 +481,7 @@ static int lm3533_device_setup(struct lm3533 *lm3533,
481 481
482static int lm3533_device_init(struct lm3533 *lm3533) 482static int lm3533_device_init(struct lm3533 *lm3533)
483{ 483{
484 struct lm3533_platform_data *pdata = lm3533->dev->platform_data; 484 struct lm3533_platform_data *pdata = dev_get_platdata(lm3533->dev);
485 int ret; 485 int ret;
486 486
487 dev_dbg(lm3533->dev, "%s\n", __func__); 487 dev_dbg(lm3533->dev, "%s\n", __func__);
diff --git a/drivers/mfd/lp8788.c b/drivers/mfd/lp8788.c
index c3d3c9b4d3ad..0f1221911018 100644
--- a/drivers/mfd/lp8788.c
+++ b/drivers/mfd/lp8788.c
@@ -173,7 +173,7 @@ static const struct regmap_config lp8788_regmap_config = {
173static int lp8788_probe(struct i2c_client *cl, const struct i2c_device_id *id) 173static int lp8788_probe(struct i2c_client *cl, const struct i2c_device_id *id)
174{ 174{
175 struct lp8788 *lp; 175 struct lp8788 *lp;
176 struct lp8788_platform_data *pdata = cl->dev.platform_data; 176 struct lp8788_platform_data *pdata = dev_get_platdata(&cl->dev);
177 int ret; 177 int ret;
178 178
179 lp = devm_kzalloc(&cl->dev, sizeof(struct lp8788), GFP_KERNEL); 179 lp = devm_kzalloc(&cl->dev, sizeof(struct lp8788), GFP_KERNEL);
diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c
index 24033324c17a..9483bc8472a5 100644
--- a/drivers/mfd/lpc_ich.c
+++ b/drivers/mfd/lpc_ich.c
@@ -213,7 +213,7 @@ enum lpc_chipsets {
213 LPC_COLETO, /* Coleto Creek */ 213 LPC_COLETO, /* Coleto Creek */
214}; 214};
215 215
216struct lpc_ich_info lpc_chipset_info[] = { 216static struct lpc_ich_info lpc_chipset_info[] = {
217 [LPC_ICH] = { 217 [LPC_ICH] = {
218 .name = "ICH", 218 .name = "ICH",
219 .iTCO_version = 1, 219 .iTCO_version = 1,
diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c
index f27a21831583..522be67b2e68 100644
--- a/drivers/mfd/max77686.c
+++ b/drivers/mfd/max77686.c
@@ -77,7 +77,7 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
77 const struct i2c_device_id *id) 77 const struct i2c_device_id *id)
78{ 78{
79 struct max77686_dev *max77686 = NULL; 79 struct max77686_dev *max77686 = NULL;
80 struct max77686_platform_data *pdata = i2c->dev.platform_data; 80 struct max77686_platform_data *pdata = dev_get_platdata(&i2c->dev);
81 unsigned int data; 81 unsigned int data;
82 int ret = 0; 82 int ret = 0;
83 83
diff --git a/drivers/mfd/max77693.c b/drivers/mfd/max77693.c
index 9e60fed5ff82..c04723efc707 100644
--- a/drivers/mfd/max77693.c
+++ b/drivers/mfd/max77693.c
@@ -110,7 +110,7 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
110 const struct i2c_device_id *id) 110 const struct i2c_device_id *id)
111{ 111{
112 struct max77693_dev *max77693; 112 struct max77693_dev *max77693;
113 struct max77693_platform_data *pdata = i2c->dev.platform_data; 113 struct max77693_platform_data *pdata = dev_get_platdata(&i2c->dev);
114 u8 reg_data; 114 u8 reg_data;
115 int ret = 0; 115 int ret = 0;
116 116
diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c
index 8042b3205eaa..de7fb80a6052 100644
--- a/drivers/mfd/max8925-i2c.c
+++ b/drivers/mfd/max8925-i2c.c
@@ -151,7 +151,7 @@ static int max8925_dt_init(struct device_node *np, struct device *dev,
151static int max8925_probe(struct i2c_client *client, 151static int max8925_probe(struct i2c_client *client,
152 const struct i2c_device_id *id) 152 const struct i2c_device_id *id)
153{ 153{
154 struct max8925_platform_data *pdata = client->dev.platform_data; 154 struct max8925_platform_data *pdata = dev_get_platdata(&client->dev);
155 static struct max8925_chip *chip; 155 static struct max8925_chip *chip;
156 struct device_node *node = client->dev.of_node; 156 struct device_node *node = client->dev.of_node;
157 157
diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c
index 14714058f2d2..cee098c0dae3 100644
--- a/drivers/mfd/max8997.c
+++ b/drivers/mfd/max8997.c
@@ -51,7 +51,7 @@ static struct mfd_cell max8997_devs[] = {
51 51
52#ifdef CONFIG_OF 52#ifdef CONFIG_OF
53static struct of_device_id max8997_pmic_dt_match[] = { 53static struct of_device_id max8997_pmic_dt_match[] = {
54 { .compatible = "maxim,max8997-pmic", .data = TYPE_MAX8997 }, 54 { .compatible = "maxim,max8997-pmic", .data = (void *)TYPE_MAX8997 },
55 {}, 55 {},
56}; 56};
57#endif 57#endif
@@ -188,10 +188,11 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
188 const struct i2c_device_id *id) 188 const struct i2c_device_id *id)
189{ 189{
190 struct max8997_dev *max8997; 190 struct max8997_dev *max8997;
191 struct max8997_platform_data *pdata = i2c->dev.platform_data; 191 struct max8997_platform_data *pdata = dev_get_platdata(&i2c->dev);
192 int ret = 0; 192 int ret = 0;
193 193
194 max8997 = kzalloc(sizeof(struct max8997_dev), GFP_KERNEL); 194 max8997 = devm_kzalloc(&i2c->dev, sizeof(struct max8997_dev),
195 GFP_KERNEL);
195 if (max8997 == NULL) 196 if (max8997 == NULL)
196 return -ENOMEM; 197 return -ENOMEM;
197 198
@@ -203,14 +204,12 @@ static int max8997_i2c_probe(struct i2c_client *i2c,
203 204
204 if (max8997->dev->of_node) { 205 if (max8997->dev->of_node) {
205 pdata = max8997_i2c_parse_dt_pdata(max8997->dev); 206 pdata = max8997_i2c_parse_dt_pdata(max8997->dev);
206 if (IS_ERR(pdata)) { 207 if (IS_ERR(pdata))
207 ret = PTR_ERR(pdata); 208 return PTR_ERR(pdata);
208 goto err;
209 }
210 } 209 }
211 210
212 if (!pdata) 211 if (!pdata)
213 goto err; 212 return ret;
214 213
215 max8997->pdata = pdata; 214 max8997->pdata = pdata;
216 max8997->ono = pdata->ono; 215 max8997->ono = pdata->ono;
@@ -250,8 +249,6 @@ err_mfd:
250 i2c_unregister_device(max8997->muic); 249 i2c_unregister_device(max8997->muic);
251 i2c_unregister_device(max8997->haptic); 250 i2c_unregister_device(max8997->haptic);
252 i2c_unregister_device(max8997->rtc); 251 i2c_unregister_device(max8997->rtc);
253err:
254 kfree(max8997);
255 return ret; 252 return ret;
256} 253}
257 254
@@ -263,7 +260,6 @@ static int max8997_i2c_remove(struct i2c_client *i2c)
263 i2c_unregister_device(max8997->muic); 260 i2c_unregister_device(max8997->muic);
264 i2c_unregister_device(max8997->haptic); 261 i2c_unregister_device(max8997->haptic);
265 i2c_unregister_device(max8997->rtc); 262 i2c_unregister_device(max8997->rtc);
266 kfree(max8997);
267 263
268 return 0; 264 return 0;
269} 265}
diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c
index 21af51a499f4..fe6332dcabee 100644
--- a/drivers/mfd/max8998.c
+++ b/drivers/mfd/max8998.c
@@ -184,11 +184,12 @@ static inline int max8998_i2c_get_driver_data(struct i2c_client *i2c,
184static int max8998_i2c_probe(struct i2c_client *i2c, 184static int max8998_i2c_probe(struct i2c_client *i2c,
185 const struct i2c_device_id *id) 185 const struct i2c_device_id *id)
186{ 186{
187 struct max8998_platform_data *pdata = i2c->dev.platform_data; 187 struct max8998_platform_data *pdata = dev_get_platdata(&i2c->dev);
188 struct max8998_dev *max8998; 188 struct max8998_dev *max8998;
189 int ret = 0; 189 int ret = 0;
190 190
191 max8998 = kzalloc(sizeof(struct max8998_dev), GFP_KERNEL); 191 max8998 = devm_kzalloc(&i2c->dev, sizeof(struct max8998_dev),
192 GFP_KERNEL);
192 if (max8998 == NULL) 193 if (max8998 == NULL)
193 return -ENOMEM; 194 return -ENOMEM;
194 195
@@ -246,7 +247,6 @@ err:
246 mfd_remove_devices(max8998->dev); 247 mfd_remove_devices(max8998->dev);
247 max8998_irq_exit(max8998); 248 max8998_irq_exit(max8998);
248 i2c_unregister_device(max8998->rtc); 249 i2c_unregister_device(max8998->rtc);
249 kfree(max8998);
250 return ret; 250 return ret;
251} 251}
252 252
@@ -257,7 +257,6 @@ static int max8998_i2c_remove(struct i2c_client *i2c)
257 mfd_remove_devices(max8998->dev); 257 mfd_remove_devices(max8998->dev);
258 max8998_irq_exit(max8998); 258 max8998_irq_exit(max8998);
259 i2c_unregister_device(max8998->rtc); 259 i2c_unregister_device(max8998->rtc);
260 kfree(max8998);
261 260
262 return 0; 261 return 0;
263} 262}
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c
index 13198d937e36..41c31b3ac940 100644
--- a/drivers/mfd/mcp-sa11x0.c
+++ b/drivers/mfd/mcp-sa11x0.c
@@ -156,7 +156,7 @@ static struct mcp_ops mcp_sa11x0 = {
156 156
157static int mcp_sa11x0_probe(struct platform_device *dev) 157static int mcp_sa11x0_probe(struct platform_device *dev)
158{ 158{
159 struct mcp_plat_data *data = dev->dev.platform_data; 159 struct mcp_plat_data *data = dev_get_platdata(&dev->dev);
160 struct resource *mem0, *mem1; 160 struct resource *mem0, *mem1;
161 struct mcp_sa11x0 *m; 161 struct mcp_sa11x0 *m;
162 struct mcp *mcp; 162 struct mcp *mcp;
diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c
index 998ce8cb3065..ad25bfa3fb02 100644
--- a/drivers/mfd/menelaus.c
+++ b/drivers/mfd/menelaus.c
@@ -442,7 +442,7 @@ void menelaus_unregister_mmc_callback(void)
442 menelaus_remove_irq_work(MENELAUS_MMC_S2D1_IRQ); 442 menelaus_remove_irq_work(MENELAUS_MMC_S2D1_IRQ);
443 443
444 the_menelaus->mmc_callback = NULL; 444 the_menelaus->mmc_callback = NULL;
445 the_menelaus->mmc_callback_data = 0; 445 the_menelaus->mmc_callback_data = NULL;
446} 446}
447EXPORT_SYMBOL(menelaus_unregister_mmc_callback); 447EXPORT_SYMBOL(menelaus_unregister_mmc_callback);
448 448
@@ -466,7 +466,7 @@ static int menelaus_set_voltage(const struct menelaus_vtg *vtg, int mV,
466 struct i2c_client *c = the_menelaus->client; 466 struct i2c_client *c = the_menelaus->client;
467 467
468 mutex_lock(&the_menelaus->lock); 468 mutex_lock(&the_menelaus->lock);
469 if (vtg == 0) 469 if (!vtg)
470 goto set_voltage; 470 goto set_voltage;
471 471
472 ret = menelaus_read_reg(vtg->vtg_reg); 472 ret = menelaus_read_reg(vtg->vtg_reg);
@@ -1189,7 +1189,7 @@ static int menelaus_probe(struct i2c_client *client,
1189 int rev = 0, val; 1189 int rev = 0, val;
1190 int err = 0; 1190 int err = 0;
1191 struct menelaus_platform_data *menelaus_pdata = 1191 struct menelaus_platform_data *menelaus_pdata =
1192 client->dev.platform_data; 1192 dev_get_platdata(&client->dev);
1193 1193
1194 if (the_menelaus) { 1194 if (the_menelaus) {
1195 dev_dbg(&client->dev, "only one %s for now\n", 1195 dev_dbg(&client->dev, "only one %s for now\n",
@@ -1197,7 +1197,7 @@ static int menelaus_probe(struct i2c_client *client,
1197 return -ENODEV; 1197 return -ENODEV;
1198 } 1198 }
1199 1199
1200 menelaus = kzalloc(sizeof *menelaus, GFP_KERNEL); 1200 menelaus = devm_kzalloc(&client->dev, sizeof(*menelaus), GFP_KERNEL);
1201 if (!menelaus) 1201 if (!menelaus)
1202 return -ENOMEM; 1202 return -ENOMEM;
1203 1203
@@ -1210,8 +1210,7 @@ static int menelaus_probe(struct i2c_client *client,
1210 rev = menelaus_read_reg(MENELAUS_REV); 1210 rev = menelaus_read_reg(MENELAUS_REV);
1211 if (rev < 0) { 1211 if (rev < 0) {
1212 pr_err(DRIVER_NAME ": device not found"); 1212 pr_err(DRIVER_NAME ": device not found");
1213 err = -ENODEV; 1213 return -ENODEV;
1214 goto fail1;
1215 } 1214 }
1216 1215
1217 /* Ack and disable all Menelaus interrupts */ 1216 /* Ack and disable all Menelaus interrupts */
@@ -1231,7 +1230,7 @@ static int menelaus_probe(struct i2c_client *client,
1231 if (err) { 1230 if (err) {
1232 dev_dbg(&client->dev, "can't get IRQ %d, err %d\n", 1231 dev_dbg(&client->dev, "can't get IRQ %d, err %d\n",
1233 client->irq, err); 1232 client->irq, err);
1234 goto fail1; 1233 return err;
1235 } 1234 }
1236 } 1235 }
1237 1236
@@ -1242,7 +1241,7 @@ static int menelaus_probe(struct i2c_client *client,
1242 1241
1243 val = menelaus_read_reg(MENELAUS_VCORE_CTRL1); 1242 val = menelaus_read_reg(MENELAUS_VCORE_CTRL1);
1244 if (val < 0) 1243 if (val < 0)
1245 goto fail2; 1244 goto fail;
1246 if (val & (1 << 7)) 1245 if (val & (1 << 7))
1247 menelaus->vcore_hw_mode = 1; 1246 menelaus->vcore_hw_mode = 1;
1248 else 1247 else
@@ -1251,17 +1250,15 @@ static int menelaus_probe(struct i2c_client *client,
1251 if (menelaus_pdata != NULL && menelaus_pdata->late_init != NULL) { 1250 if (menelaus_pdata != NULL && menelaus_pdata->late_init != NULL) {
1252 err = menelaus_pdata->late_init(&client->dev); 1251 err = menelaus_pdata->late_init(&client->dev);
1253 if (err < 0) 1252 if (err < 0)
1254 goto fail2; 1253 goto fail;
1255 } 1254 }
1256 1255
1257 menelaus_rtc_init(menelaus); 1256 menelaus_rtc_init(menelaus);
1258 1257
1259 return 0; 1258 return 0;
1260fail2: 1259fail:
1261 free_irq(client->irq, menelaus); 1260 free_irq(client->irq, menelaus);
1262 flush_work(&menelaus->work); 1261 flush_work(&menelaus->work);
1263fail1:
1264 kfree(menelaus);
1265 return err; 1262 return err;
1266} 1263}
1267 1264
@@ -1271,7 +1268,6 @@ static int __exit menelaus_remove(struct i2c_client *client)
1271 1268
1272 free_irq(client->irq, menelaus); 1269 free_irq(client->irq, menelaus);
1273 flush_work(&menelaus->work); 1270 flush_work(&menelaus->work);
1274 kfree(menelaus);
1275 the_menelaus = NULL; 1271 the_menelaus = NULL;
1276 return 0; 1272 return 0;
1277} 1273}
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 7604f4e5df40..f421586f29fb 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -96,6 +96,8 @@ static int mfd_add_device(struct device *parent, int id,
96 96
97 pdev->dev.parent = parent; 97 pdev->dev.parent = parent;
98 pdev->dev.type = &mfd_dev_type; 98 pdev->dev.type = &mfd_dev_type;
99 pdev->dev.dma_mask = parent->dma_mask;
100 pdev->dev.dma_parms = parent->dma_parms;
99 101
100 if (parent->of_node && cell->of_compatible) { 102 if (parent->of_node && cell->of_compatible) {
101 for_each_child_of_node(parent->of_node, np) { 103 for_each_child_of_node(parent->of_node, np) {
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 759fae3ca7fb..d2b8e7189907 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -232,7 +232,7 @@ err_end:
232static int omap_usbhs_alloc_children(struct platform_device *pdev) 232static int omap_usbhs_alloc_children(struct platform_device *pdev)
233{ 233{
234 struct device *dev = &pdev->dev; 234 struct device *dev = &pdev->dev;
235 struct usbhs_omap_platform_data *pdata = dev->platform_data; 235 struct usbhs_omap_platform_data *pdata = dev_get_platdata(dev);
236 struct platform_device *ehci; 236 struct platform_device *ehci;
237 struct platform_device *ohci; 237 struct platform_device *ohci;
238 struct resource *res; 238 struct resource *res;
@@ -571,7 +571,7 @@ static struct of_device_id usbhs_child_match_table[] = {
571static int usbhs_omap_probe(struct platform_device *pdev) 571static int usbhs_omap_probe(struct platform_device *pdev)
572{ 572{
573 struct device *dev = &pdev->dev; 573 struct device *dev = &pdev->dev;
574 struct usbhs_omap_platform_data *pdata = dev->platform_data; 574 struct usbhs_omap_platform_data *pdata = dev_get_platdata(dev);
575 struct usbhs_hcd_omap *omap; 575 struct usbhs_hcd_omap *omap;
576 struct resource *res; 576 struct resource *res;
577 int ret = 0; 577 int ret = 0;
diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c
index e71fa289eb01..135afabe4ae2 100644
--- a/drivers/mfd/palmas.c
+++ b/drivers/mfd/palmas.c
@@ -326,6 +326,32 @@ static void palmas_dt_to_pdata(struct i2c_client *i2c,
326 PALMAS_POWER_CTRL_ENABLE2_MASK; 326 PALMAS_POWER_CTRL_ENABLE2_MASK;
327 if (i2c->irq) 327 if (i2c->irq)
328 palmas_set_pdata_irq_flag(i2c, pdata); 328 palmas_set_pdata_irq_flag(i2c, pdata);
329
330 pdata->pm_off = of_property_read_bool(node,
331 "ti,system-power-controller");
332}
333
334static struct palmas *palmas_dev;
335static void palmas_power_off(void)
336{
337 unsigned int addr;
338 int ret, slave;
339
340 if (!palmas_dev)
341 return;
342
343 slave = PALMAS_BASE_TO_SLAVE(PALMAS_PMU_CONTROL_BASE);
344 addr = PALMAS_BASE_TO_REG(PALMAS_PMU_CONTROL_BASE, PALMAS_DEV_CTRL);
345
346 ret = regmap_update_bits(
347 palmas_dev->regmap[slave],
348 addr,
349 PALMAS_DEV_CTRL_DEV_ON,
350 0);
351
352 if (ret)
353 pr_err("%s: Unable to write to DEV_CTRL_DEV_ON: %d\n",
354 __func__, ret);
329} 355}
330 356
331static unsigned int palmas_features = PALMAS_PMIC_FEATURE_SMPS10_BOOST; 357static unsigned int palmas_features = PALMAS_PMIC_FEATURE_SMPS10_BOOST;
@@ -520,10 +546,13 @@ no_irq:
520 */ 546 */
521 if (node) { 547 if (node) {
522 ret = of_platform_populate(node, NULL, NULL, &i2c->dev); 548 ret = of_platform_populate(node, NULL, NULL, &i2c->dev);
523 if (ret < 0) 549 if (ret < 0) {
524 goto err_irq; 550 goto err_irq;
525 else 551 } else if (pdata->pm_off && !pm_power_off) {
552 palmas_dev = palmas;
553 pm_power_off = palmas_power_off;
526 return ret; 554 return ret;
555 }
527 } 556 }
528 557
529 return ret; 558 return ret;
diff --git a/drivers/mfd/pcf50633-adc.c b/drivers/mfd/pcf50633-adc.c
index 18b53cb72fea..b8941a556d71 100644
--- a/drivers/mfd/pcf50633-adc.c
+++ b/drivers/mfd/pcf50633-adc.c
@@ -203,7 +203,7 @@ static int pcf50633_adc_probe(struct platform_device *pdev)
203{ 203{
204 struct pcf50633_adc *adc; 204 struct pcf50633_adc *adc;
205 205
206 adc = kzalloc(sizeof(*adc), GFP_KERNEL); 206 adc = devm_kzalloc(&pdev->dev, sizeof(*adc), GFP_KERNEL);
207 if (!adc) 207 if (!adc)
208 return -ENOMEM; 208 return -ENOMEM;
209 209
@@ -236,7 +236,6 @@ static int pcf50633_adc_remove(struct platform_device *pdev)
236 kfree(adc->queue[i]); 236 kfree(adc->queue[i]);
237 237
238 mutex_unlock(&adc->queue_mutex); 238 mutex_unlock(&adc->queue_mutex);
239 kfree(adc);
240 239
241 return 0; 240 return 0;
242} 241}
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index d11567307fbe..6841d6805fd6 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -195,7 +195,7 @@ static int pcf50633_probe(struct i2c_client *client,
195 const struct i2c_device_id *ids) 195 const struct i2c_device_id *ids)
196{ 196{
197 struct pcf50633 *pcf; 197 struct pcf50633 *pcf;
198 struct pcf50633_platform_data *pdata = client->dev.platform_data; 198 struct pcf50633_platform_data *pdata = dev_get_platdata(&client->dev);
199 int i, ret; 199 int i, ret;
200 int version, variant; 200 int version, variant;
201 201
diff --git a/drivers/mfd/pm8921-core.c b/drivers/mfd/pm8921-core.c
index ecc137ffa8c3..a6841f77aa5e 100644
--- a/drivers/mfd/pm8921-core.c
+++ b/drivers/mfd/pm8921-core.c
@@ -14,6 +14,7 @@
14#define pr_fmt(fmt) "%s: " fmt, __func__ 14#define pr_fmt(fmt) "%s: " fmt, __func__
15 15
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/module.h>
17#include <linux/platform_device.h> 18#include <linux/platform_device.h>
18#include <linux/slab.h> 19#include <linux/slab.h>
19#include <linux/err.h> 20#include <linux/err.h>
@@ -106,7 +107,7 @@ static int pm8921_add_subdevices(const struct pm8921_platform_data
106 107
107static int pm8921_probe(struct platform_device *pdev) 108static int pm8921_probe(struct platform_device *pdev)
108{ 109{
109 const struct pm8921_platform_data *pdata = pdev->dev.platform_data; 110 const struct pm8921_platform_data *pdata = dev_get_platdata(&pdev->dev);
110 struct pm8921 *pmic; 111 struct pm8921 *pmic;
111 int rc; 112 int rc;
112 u8 val; 113 u8 val;
@@ -117,7 +118,7 @@ static int pm8921_probe(struct platform_device *pdev)
117 return -EINVAL; 118 return -EINVAL;
118 } 119 }
119 120
120 pmic = kzalloc(sizeof(struct pm8921), GFP_KERNEL); 121 pmic = devm_kzalloc(&pdev->dev, sizeof(struct pm8921), GFP_KERNEL);
121 if (!pmic) { 122 if (!pmic) {
122 pr_err("Cannot alloc pm8921 struct\n"); 123 pr_err("Cannot alloc pm8921 struct\n");
123 return -ENOMEM; 124 return -ENOMEM;
@@ -127,7 +128,7 @@ static int pm8921_probe(struct platform_device *pdev)
127 rc = ssbi_read(pdev->dev.parent, REG_HWREV, &val, sizeof(val)); 128 rc = ssbi_read(pdev->dev.parent, REG_HWREV, &val, sizeof(val));
128 if (rc) { 129 if (rc) {
129 pr_err("Failed to read hw rev reg %d:rc=%d\n", REG_HWREV, rc); 130 pr_err("Failed to read hw rev reg %d:rc=%d\n", REG_HWREV, rc);
130 goto err_read_rev; 131 return rc;
131 } 132 }
132 pr_info("PMIC revision 1: %02X\n", val); 133 pr_info("PMIC revision 1: %02X\n", val);
133 rev = val; 134 rev = val;
@@ -137,7 +138,7 @@ static int pm8921_probe(struct platform_device *pdev)
137 if (rc) { 138 if (rc) {
138 pr_err("Failed to read hw rev 2 reg %d:rc=%d\n", 139 pr_err("Failed to read hw rev 2 reg %d:rc=%d\n",
139 REG_HWREV_2, rc); 140 REG_HWREV_2, rc);
140 goto err_read_rev; 141 return rc;
141 } 142 }
142 pr_info("PMIC revision 2: %02X\n", val); 143 pr_info("PMIC revision 2: %02X\n", val);
143 rev |= val << BITS_PER_BYTE; 144 rev |= val << BITS_PER_BYTE;
@@ -159,9 +160,6 @@ static int pm8921_probe(struct platform_device *pdev)
159 160
160err: 161err:
161 mfd_remove_devices(pmic->dev); 162 mfd_remove_devices(pmic->dev);
162 platform_set_drvdata(pdev, NULL);
163err_read_rev:
164 kfree(pmic);
165 return rc; 163 return rc;
166} 164}
167 165
@@ -179,8 +177,6 @@ static int pm8921_remove(struct platform_device *pdev)
179 pm8xxx_irq_exit(pmic->irq_chip); 177 pm8xxx_irq_exit(pmic->irq_chip);
180 pmic->irq_chip = NULL; 178 pmic->irq_chip = NULL;
181 } 179 }
182 platform_set_drvdata(pdev, NULL);
183 kfree(pmic);
184 180
185 return 0; 181 return 0;
186} 182}
diff --git a/drivers/mfd/rc5t583.c b/drivers/mfd/rc5t583.c
index 14bdaccefbec..346330176afc 100644
--- a/drivers/mfd/rc5t583.c
+++ b/drivers/mfd/rc5t583.c
@@ -250,7 +250,7 @@ static int rc5t583_i2c_probe(struct i2c_client *i2c,
250 const struct i2c_device_id *id) 250 const struct i2c_device_id *id)
251{ 251{
252 struct rc5t583 *rc5t583; 252 struct rc5t583 *rc5t583;
253 struct rc5t583_platform_data *pdata = i2c->dev.platform_data; 253 struct rc5t583_platform_data *pdata = dev_get_platdata(&i2c->dev);
254 int ret; 254 int ret;
255 bool irq_init_success = false; 255 bool irq_init_success = false;
256 256
diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c
index 79c07502db52..f530e4b73f19 100644
--- a/drivers/mfd/sec-core.c
+++ b/drivers/mfd/sec-core.c
@@ -61,7 +61,9 @@ static struct mfd_cell s5m8767_devs[] = {
61static struct mfd_cell s2mps11_devs[] = { 61static struct mfd_cell s2mps11_devs[] = {
62 { 62 {
63 .name = "s2mps11-pmic", 63 .name = "s2mps11-pmic",
64 }, 64 }, {
65 .name = "s2mps11-clk",
66 }
65}; 67};
66 68
67#ifdef CONFIG_OF 69#ifdef CONFIG_OF
@@ -216,7 +218,7 @@ static inline int sec_i2c_get_driver_data(struct i2c_client *i2c,
216static int sec_pmic_probe(struct i2c_client *i2c, 218static int sec_pmic_probe(struct i2c_client *i2c,
217 const struct i2c_device_id *id) 219 const struct i2c_device_id *id)
218{ 220{
219 struct sec_platform_data *pdata = i2c->dev.platform_data; 221 struct sec_platform_data *pdata = dev_get_platdata(&i2c->dev);
220 const struct regmap_config *regmap; 222 const struct regmap_config *regmap;
221 struct sec_pmic_dev *sec_pmic; 223 struct sec_pmic_dev *sec_pmic;
222 int ret; 224 int ret;
diff --git a/drivers/mfd/si476x-i2c.c b/drivers/mfd/si476x-i2c.c
index f5bc8e4bd4bf..0e4a76daf187 100644
--- a/drivers/mfd/si476x-i2c.c
+++ b/drivers/mfd/si476x-i2c.c
@@ -718,7 +718,7 @@ static int si476x_core_probe(struct i2c_client *client,
718 atomic_set(&core->is_alive, 0); 718 atomic_set(&core->is_alive, 0);
719 core->power_state = SI476X_POWER_DOWN; 719 core->power_state = SI476X_POWER_DOWN;
720 720
721 pdata = client->dev.platform_data; 721 pdata = dev_get_platdata(&client->dev);
722 if (pdata) { 722 if (pdata) {
723 memcpy(&core->power_up_parameters, 723 memcpy(&core->power_up_parameters,
724 &pdata->power_up_parameters, 724 &pdata->power_up_parameters,
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index 9816c232e583..33f040c558d0 100644
--- a/drivers/mfd/sm501.c
+++ b/drivers/mfd/sm501.c
@@ -840,7 +840,7 @@ static int sm501_register_uart(struct sm501_devdata *sm, int devices)
840 if (!pdev) 840 if (!pdev)
841 return -ENOMEM; 841 return -ENOMEM;
842 842
843 uart_data = pdev->dev.platform_data; 843 uart_data = dev_get_platdata(&pdev->dev);
844 844
845 if (devices & SM501_USE_UART0) { 845 if (devices & SM501_USE_UART0) {
846 sm501_setup_uart_data(sm, uart_data++, 0x30000); 846 sm501_setup_uart_data(sm, uart_data++, 0x30000);
@@ -1167,7 +1167,7 @@ static int sm501_register_gpio_i2c_instance(struct sm501_devdata *sm,
1167 if (!pdev) 1167 if (!pdev)
1168 return -ENOMEM; 1168 return -ENOMEM;
1169 1169
1170 icd = pdev->dev.platform_data; 1170 icd = dev_get_platdata(&pdev->dev);
1171 1171
1172 /* We keep the pin_sda and pin_scl fields relative in case the 1172 /* We keep the pin_sda and pin_scl fields relative in case the
1173 * same platform data is passed to >1 SM501. 1173 * same platform data is passed to >1 SM501.
@@ -1403,7 +1403,7 @@ static int sm501_plat_probe(struct platform_device *dev)
1403 1403
1404 sm->dev = &dev->dev; 1404 sm->dev = &dev->dev;
1405 sm->pdev_id = dev->id; 1405 sm->pdev_id = dev->id;
1406 sm->platdata = dev->dev.platform_data; 1406 sm->platdata = dev_get_platdata(&dev->dev);
1407 1407
1408 ret = platform_get_irq(dev, 0); 1408 ret = platform_get_irq(dev, 0);
1409 if (ret < 0) { 1409 if (ret < 0) {
diff --git a/drivers/mfd/sta2x11-mfd.c b/drivers/mfd/sta2x11-mfd.c
index d70a343078fd..65c6fa671acb 100644
--- a/drivers/mfd/sta2x11-mfd.c
+++ b/drivers/mfd/sta2x11-mfd.c
@@ -133,7 +133,7 @@ int sta2x11_mfd_get_regs_data(struct platform_device *dev,
133 void __iomem **regs, 133 void __iomem **regs,
134 spinlock_t **lock) 134 spinlock_t **lock)
135{ 135{
136 struct pci_dev *pdev = *(struct pci_dev **)(dev->dev.platform_data); 136 struct pci_dev *pdev = *(struct pci_dev **)dev_get_platdata(&dev->dev);
137 struct sta2x11_mfd *mfd; 137 struct sta2x11_mfd *mfd;
138 138
139 if (!pdev) 139 if (!pdev)
@@ -312,7 +312,7 @@ static int sta2x11_mfd_platform_probe(struct platform_device *dev,
312 const char *name = sta2x11_mfd_names[index]; 312 const char *name = sta2x11_mfd_names[index];
313 struct regmap_config *regmap_config = sta2x11_mfd_regmap_configs[index]; 313 struct regmap_config *regmap_config = sta2x11_mfd_regmap_configs[index];
314 314
315 pdev = dev->dev.platform_data; 315 pdev = dev_get_platdata(&dev->dev);
316 mfd = sta2x11_mfd_find(*pdev); 316 mfd = sta2x11_mfd_find(*pdev);
317 if (!mfd) 317 if (!mfd)
318 return -ENODEV; 318 return -ENODEV;
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 5d5e6f90424a..fff63a41862c 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -1106,7 +1106,8 @@ static int stmpe_devices_init(struct stmpe *stmpe)
1106 return ret; 1106 return ret;
1107} 1107}
1108 1108
1109void stmpe_of_probe(struct stmpe_platform_data *pdata, struct device_node *np) 1109static void stmpe_of_probe(struct stmpe_platform_data *pdata,
1110 struct device_node *np)
1110{ 1111{
1111 struct device_node *child; 1112 struct device_node *child;
1112 1113
diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c
index a21bff283a98..9e04a7485981 100644
--- a/drivers/mfd/t7l66xb.c
+++ b/drivers/mfd/t7l66xb.c
@@ -281,7 +281,7 @@ static void t7l66xb_detach_irq(struct platform_device *dev)
281static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state) 281static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state)
282{ 282{
283 struct t7l66xb *t7l66xb = platform_get_drvdata(dev); 283 struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
284 struct t7l66xb_platform_data *pdata = dev->dev.platform_data; 284 struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev);
285 285
286 if (pdata && pdata->suspend) 286 if (pdata && pdata->suspend)
287 pdata->suspend(dev); 287 pdata->suspend(dev);
@@ -293,7 +293,7 @@ static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state)
293static int t7l66xb_resume(struct platform_device *dev) 293static int t7l66xb_resume(struct platform_device *dev)
294{ 294{
295 struct t7l66xb *t7l66xb = platform_get_drvdata(dev); 295 struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
296 struct t7l66xb_platform_data *pdata = dev->dev.platform_data; 296 struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev);
297 297
298 clk_enable(t7l66xb->clk48m); 298 clk_enable(t7l66xb->clk48m);
299 if (pdata && pdata->resume) 299 if (pdata && pdata->resume)
@@ -313,7 +313,7 @@ static int t7l66xb_resume(struct platform_device *dev)
313 313
314static int t7l66xb_probe(struct platform_device *dev) 314static int t7l66xb_probe(struct platform_device *dev)
315{ 315{
316 struct t7l66xb_platform_data *pdata = dev->dev.platform_data; 316 struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev);
317 struct t7l66xb *t7l66xb; 317 struct t7l66xb *t7l66xb;
318 struct resource *iomem, *rscr; 318 struct resource *iomem, *rscr;
319 int ret; 319 int ret;
@@ -409,7 +409,7 @@ err_noirq:
409 409
410static int t7l66xb_remove(struct platform_device *dev) 410static int t7l66xb_remove(struct platform_device *dev)
411{ 411{
412 struct t7l66xb_platform_data *pdata = dev->dev.platform_data; 412 struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev);
413 struct t7l66xb *t7l66xb = platform_get_drvdata(dev); 413 struct t7l66xb *t7l66xb = platform_get_drvdata(dev);
414 int ret; 414 int ret;
415 415
diff --git a/drivers/mfd/tc3589x.c b/drivers/mfd/tc3589x.c
index 4cb92bb2aea2..70f4909fee13 100644
--- a/drivers/mfd/tc3589x.c
+++ b/drivers/mfd/tc3589x.c
@@ -325,7 +325,7 @@ static int tc3589x_of_probe(struct device_node *np,
325static int tc3589x_probe(struct i2c_client *i2c, 325static int tc3589x_probe(struct i2c_client *i2c,
326 const struct i2c_device_id *id) 326 const struct i2c_device_id *id)
327{ 327{
328 struct tc3589x_platform_data *pdata = i2c->dev.platform_data; 328 struct tc3589x_platform_data *pdata = dev_get_platdata(&i2c->dev);
329 struct device_node *np = i2c->dev.of_node; 329 struct device_node *np = i2c->dev.of_node;
330 struct tc3589x *tc3589x; 330 struct tc3589x *tc3589x;
331 int ret; 331 int ret;
diff --git a/drivers/mfd/tc6387xb.c b/drivers/mfd/tc6387xb.c
index 65c425a517c5..acd0f3a41044 100644
--- a/drivers/mfd/tc6387xb.c
+++ b/drivers/mfd/tc6387xb.c
@@ -48,7 +48,7 @@ static struct resource tc6387xb_mmc_resources[] = {
48static int tc6387xb_suspend(struct platform_device *dev, pm_message_t state) 48static int tc6387xb_suspend(struct platform_device *dev, pm_message_t state)
49{ 49{
50 struct tc6387xb *tc6387xb = platform_get_drvdata(dev); 50 struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
51 struct tc6387xb_platform_data *pdata = dev->dev.platform_data; 51 struct tc6387xb_platform_data *pdata = dev_get_platdata(&dev->dev);
52 52
53 if (pdata && pdata->suspend) 53 if (pdata && pdata->suspend)
54 pdata->suspend(dev); 54 pdata->suspend(dev);
@@ -60,7 +60,7 @@ static int tc6387xb_suspend(struct platform_device *dev, pm_message_t state)
60static int tc6387xb_resume(struct platform_device *dev) 60static int tc6387xb_resume(struct platform_device *dev)
61{ 61{
62 struct tc6387xb *tc6387xb = platform_get_drvdata(dev); 62 struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
63 struct tc6387xb_platform_data *pdata = dev->dev.platform_data; 63 struct tc6387xb_platform_data *pdata = dev_get_platdata(&dev->dev);
64 64
65 clk_enable(tc6387xb->clk32k); 65 clk_enable(tc6387xb->clk32k);
66 if (pdata && pdata->resume) 66 if (pdata && pdata->resume)
@@ -140,7 +140,7 @@ static struct mfd_cell tc6387xb_cells[] = {
140 140
141static int tc6387xb_probe(struct platform_device *dev) 141static int tc6387xb_probe(struct platform_device *dev)
142{ 142{
143 struct tc6387xb_platform_data *pdata = dev->dev.platform_data; 143 struct tc6387xb_platform_data *pdata = dev_get_platdata(&dev->dev);
144 struct resource *iomem, *rscr; 144 struct resource *iomem, *rscr;
145 struct clk *clk32k; 145 struct clk *clk32k;
146 struct tc6387xb *tc6387xb; 146 struct tc6387xb *tc6387xb;
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c
index a563dfa3cf87..11c19e538551 100644
--- a/drivers/mfd/tc6393xb.c
+++ b/drivers/mfd/tc6393xb.c
@@ -604,7 +604,7 @@ static void tc6393xb_detach_irq(struct platform_device *dev)
604 604
605static int tc6393xb_probe(struct platform_device *dev) 605static int tc6393xb_probe(struct platform_device *dev)
606{ 606{
607 struct tc6393xb_platform_data *tcpd = dev->dev.platform_data; 607 struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev);
608 struct tc6393xb *tc6393xb; 608 struct tc6393xb *tc6393xb;
609 struct resource *iomem, *rscr; 609 struct resource *iomem, *rscr;
610 int ret, temp; 610 int ret, temp;
@@ -733,7 +733,7 @@ err_kzalloc:
733 733
734static int tc6393xb_remove(struct platform_device *dev) 734static int tc6393xb_remove(struct platform_device *dev)
735{ 735{
736 struct tc6393xb_platform_data *tcpd = dev->dev.platform_data; 736 struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev);
737 struct tc6393xb *tc6393xb = platform_get_drvdata(dev); 737 struct tc6393xb *tc6393xb = platform_get_drvdata(dev);
738 int ret; 738 int ret;
739 739
@@ -765,7 +765,7 @@ static int tc6393xb_remove(struct platform_device *dev)
765#ifdef CONFIG_PM 765#ifdef CONFIG_PM
766static int tc6393xb_suspend(struct platform_device *dev, pm_message_t state) 766static int tc6393xb_suspend(struct platform_device *dev, pm_message_t state)
767{ 767{
768 struct tc6393xb_platform_data *tcpd = dev->dev.platform_data; 768 struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev);
769 struct tc6393xb *tc6393xb = platform_get_drvdata(dev); 769 struct tc6393xb *tc6393xb = platform_get_drvdata(dev);
770 int i, ret; 770 int i, ret;
771 771
@@ -788,7 +788,7 @@ static int tc6393xb_suspend(struct platform_device *dev, pm_message_t state)
788 788
789static int tc6393xb_resume(struct platform_device *dev) 789static int tc6393xb_resume(struct platform_device *dev)
790{ 790{
791 struct tc6393xb_platform_data *tcpd = dev->dev.platform_data; 791 struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev);
792 struct tc6393xb *tc6393xb = platform_get_drvdata(dev); 792 struct tc6393xb *tc6393xb = platform_get_drvdata(dev);
793 int ret; 793 int ret;
794 int i; 794 int i;
diff --git a/drivers/mfd/ti-ssp.c b/drivers/mfd/ti-ssp.c
index 09a14cec351b..1c2b994e1f6c 100644
--- a/drivers/mfd/ti-ssp.c
+++ b/drivers/mfd/ti-ssp.c
@@ -318,7 +318,7 @@ static irqreturn_t ti_ssp_interrupt(int irq, void *dev_data)
318static int ti_ssp_probe(struct platform_device *pdev) 318static int ti_ssp_probe(struct platform_device *pdev)
319{ 319{
320 static struct ti_ssp *ssp; 320 static struct ti_ssp *ssp;
321 const struct ti_ssp_data *pdata = pdev->dev.platform_data; 321 const struct ti_ssp_data *pdata = dev_get_platdata(&pdev->dev);
322 int error = 0, prediv = 0xff, id; 322 int error = 0, prediv = 0xff, id;
323 unsigned long sysclk; 323 unsigned long sysclk;
324 struct device *dev = &pdev->dev; 324 struct device *dev = &pdev->dev;
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
index cd74d594c563..baaf5a8123bb 100644
--- a/drivers/mfd/ti_am335x_tscadc.c
+++ b/drivers/mfd/ti_am335x_tscadc.c
@@ -57,20 +57,20 @@ EXPORT_SYMBOL_GPL(am335x_tsc_se_update);
57void am335x_tsc_se_set(struct ti_tscadc_dev *tsadc, u32 val) 57void am335x_tsc_se_set(struct ti_tscadc_dev *tsadc, u32 val)
58{ 58{
59 spin_lock(&tsadc->reg_lock); 59 spin_lock(&tsadc->reg_lock);
60 tsadc->reg_se_cache = tscadc_readl(tsadc, REG_SE);
60 tsadc->reg_se_cache |= val; 61 tsadc->reg_se_cache |= val;
61 spin_unlock(&tsadc->reg_lock);
62
63 am335x_tsc_se_update(tsadc); 62 am335x_tsc_se_update(tsadc);
63 spin_unlock(&tsadc->reg_lock);
64} 64}
65EXPORT_SYMBOL_GPL(am335x_tsc_se_set); 65EXPORT_SYMBOL_GPL(am335x_tsc_se_set);
66 66
67void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val) 67void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val)
68{ 68{
69 spin_lock(&tsadc->reg_lock); 69 spin_lock(&tsadc->reg_lock);
70 tsadc->reg_se_cache = tscadc_readl(tsadc, REG_SE);
70 tsadc->reg_se_cache &= ~val; 71 tsadc->reg_se_cache &= ~val;
71 spin_unlock(&tsadc->reg_lock);
72
73 am335x_tsc_se_update(tsadc); 72 am335x_tsc_se_update(tsadc);
73 spin_unlock(&tsadc->reg_lock);
74} 74}
75EXPORT_SYMBOL_GPL(am335x_tsc_se_clr); 75EXPORT_SYMBOL_GPL(am335x_tsc_se_clr);
76 76
diff --git a/drivers/mfd/tps6105x.c b/drivers/mfd/tps6105x.c
index 1d302f583adf..b5dfa6e4e692 100644
--- a/drivers/mfd/tps6105x.c
+++ b/drivers/mfd/tps6105x.c
@@ -147,7 +147,7 @@ static int tps6105x_probe(struct i2c_client *client,
147 147
148 i2c_set_clientdata(client, tps6105x); 148 i2c_set_clientdata(client, tps6105x);
149 tps6105x->client = client; 149 tps6105x->client = client;
150 pdata = client->dev.platform_data; 150 pdata = dev_get_platdata(&client->dev);
151 tps6105x->pdata = pdata; 151 tps6105x->pdata = pdata;
152 mutex_init(&tps6105x->lock); 152 mutex_init(&tps6105x->lock);
153 153
diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c
index da2691f22e11..743fb524fc8a 100644
--- a/drivers/mfd/tps65010.c
+++ b/drivers/mfd/tps65010.c
@@ -242,8 +242,8 @@ static int dbg_show(struct seq_file *s, void *_)
242 seq_printf(s, "mask2 %s\n", buf); 242 seq_printf(s, "mask2 %s\n", buf);
243 /* ignore ackint2 */ 243 /* ignore ackint2 */
244 244
245 schedule_delayed_work(&tps->work, POWER_POLL_DELAY); 245 queue_delayed_work(system_power_efficient_wq, &tps->work,
246 246 POWER_POLL_DELAY);
247 247
248 /* VMAIN voltage, enable lowpower, etc */ 248 /* VMAIN voltage, enable lowpower, etc */
249 value = i2c_smbus_read_byte_data(tps->client, TPS_VDCDC1); 249 value = i2c_smbus_read_byte_data(tps->client, TPS_VDCDC1);
@@ -400,7 +400,8 @@ static void tps65010_interrupt(struct tps65010 *tps)
400 && (tps->chgstatus & (TPS_CHG_USB|TPS_CHG_AC))) 400 && (tps->chgstatus & (TPS_CHG_USB|TPS_CHG_AC)))
401 poll = 1; 401 poll = 1;
402 if (poll) 402 if (poll)
403 schedule_delayed_work(&tps->work, POWER_POLL_DELAY); 403 queue_delayed_work(system_power_efficient_wq, &tps->work,
404 POWER_POLL_DELAY);
404 405
405 /* also potentially gpio-in rise or fall */ 406 /* also potentially gpio-in rise or fall */
406} 407}
@@ -448,7 +449,7 @@ static irqreturn_t tps65010_irq(int irq, void *_tps)
448 449
449 disable_irq_nosync(irq); 450 disable_irq_nosync(irq);
450 set_bit(FLAG_IRQ_ENABLE, &tps->flags); 451 set_bit(FLAG_IRQ_ENABLE, &tps->flags);
451 schedule_delayed_work(&tps->work, 0); 452 queue_delayed_work(system_power_efficient_wq, &tps->work, 0);
452 return IRQ_HANDLED; 453 return IRQ_HANDLED;
453} 454}
454 455
@@ -517,7 +518,7 @@ static struct tps65010 *the_tps;
517static int __exit tps65010_remove(struct i2c_client *client) 518static int __exit tps65010_remove(struct i2c_client *client)
518{ 519{
519 struct tps65010 *tps = i2c_get_clientdata(client); 520 struct tps65010 *tps = i2c_get_clientdata(client);
520 struct tps65010_board *board = client->dev.platform_data; 521 struct tps65010_board *board = dev_get_platdata(&client->dev);
521 522
522 if (board && board->teardown) { 523 if (board && board->teardown) {
523 int status = board->teardown(client, board->context); 524 int status = board->teardown(client, board->context);
@@ -529,7 +530,6 @@ static int __exit tps65010_remove(struct i2c_client *client)
529 free_irq(client->irq, tps); 530 free_irq(client->irq, tps);
530 cancel_delayed_work_sync(&tps->work); 531 cancel_delayed_work_sync(&tps->work);
531 debugfs_remove(tps->file); 532 debugfs_remove(tps->file);
532 kfree(tps);
533 the_tps = NULL; 533 the_tps = NULL;
534 return 0; 534 return 0;
535} 535}
@@ -539,7 +539,7 @@ static int tps65010_probe(struct i2c_client *client,
539{ 539{
540 struct tps65010 *tps; 540 struct tps65010 *tps;
541 int status; 541 int status;
542 struct tps65010_board *board = client->dev.platform_data; 542 struct tps65010_board *board = dev_get_platdata(&client->dev);
543 543
544 if (the_tps) { 544 if (the_tps) {
545 dev_dbg(&client->dev, "only one tps6501x chip allowed\n"); 545 dev_dbg(&client->dev, "only one tps6501x chip allowed\n");
@@ -549,7 +549,7 @@ static int tps65010_probe(struct i2c_client *client,
549 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 549 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
550 return -EINVAL; 550 return -EINVAL;
551 551
552 tps = kzalloc(sizeof *tps, GFP_KERNEL); 552 tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL);
553 if (!tps) 553 if (!tps)
554 return -ENOMEM; 554 return -ENOMEM;
555 555
@@ -567,7 +567,7 @@ static int tps65010_probe(struct i2c_client *client,
567 if (status < 0) { 567 if (status < 0) {
568 dev_dbg(&client->dev, "can't get IRQ %d, err %d\n", 568 dev_dbg(&client->dev, "can't get IRQ %d, err %d\n",
569 client->irq, status); 569 client->irq, status);
570 goto fail1; 570 return status;
571 } 571 }
572 /* annoying race here, ideally we'd have an option 572 /* annoying race here, ideally we'd have an option
573 * to claim the irq now and enable it later. 573 * to claim the irq now and enable it later.
@@ -667,9 +667,6 @@ static int tps65010_probe(struct i2c_client *client,
667 } 667 }
668 668
669 return 0; 669 return 0;
670fail1:
671 kfree(tps);
672 return status;
673} 670}
674 671
675static const struct i2c_device_id tps65010_id[] = { 672static const struct i2c_device_id tps65010_id[] = {
@@ -718,7 +715,8 @@ int tps65010_set_vbus_draw(unsigned mA)
718 && test_and_set_bit( 715 && test_and_set_bit(
719 FLAG_VBUS_CHANGED, &the_tps->flags)) { 716 FLAG_VBUS_CHANGED, &the_tps->flags)) {
720 /* gadget drivers call this in_irq() */ 717 /* gadget drivers call this in_irq() */
721 schedule_delayed_work(&the_tps->work, 0); 718 queue_delayed_work(system_power_efficient_wq, &the_tps->work,
719 0);
722 } 720 }
723 local_irq_restore(flags); 721 local_irq_restore(flags);
724 722
diff --git a/drivers/mfd/tps65090.c b/drivers/mfd/tps65090.c
index fbd6ee67b5a5..e6f03a733879 100644
--- a/drivers/mfd/tps65090.c
+++ b/drivers/mfd/tps65090.c
@@ -172,7 +172,7 @@ MODULE_DEVICE_TABLE(of, tps65090_of_match);
172static int tps65090_i2c_probe(struct i2c_client *client, 172static int tps65090_i2c_probe(struct i2c_client *client,
173 const struct i2c_device_id *id) 173 const struct i2c_device_id *id)
174{ 174{
175 struct tps65090_platform_data *pdata = client->dev.platform_data; 175 struct tps65090_platform_data *pdata = dev_get_platdata(&client->dev);
176 int irq_base = 0; 176 int irq_base = 0;
177 struct tps65090 *tps65090; 177 struct tps65090 *tps65090;
178 int ret; 178 int ret;
diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index 4b93ed4d5cd6..f54fe4d4f77b 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -462,7 +462,7 @@ static void tps6586x_power_off(void)
462static int tps6586x_i2c_probe(struct i2c_client *client, 462static int tps6586x_i2c_probe(struct i2c_client *client,
463 const struct i2c_device_id *id) 463 const struct i2c_device_id *id)
464{ 464{
465 struct tps6586x_platform_data *pdata = client->dev.platform_data; 465 struct tps6586x_platform_data *pdata = dev_get_platdata(&client->dev);
466 struct tps6586x *tps6586x; 466 struct tps6586x *tps6586x;
467 int ret; 467 int ret;
468 468
diff --git a/drivers/mfd/tps65912-core.c b/drivers/mfd/tps65912-core.c
index 479886a4cf80..925a044cbdf6 100644
--- a/drivers/mfd/tps65912-core.c
+++ b/drivers/mfd/tps65912-core.c
@@ -123,7 +123,7 @@ EXPORT_SYMBOL_GPL(tps65912_reg_write);
123 123
124int tps65912_device_init(struct tps65912 *tps65912) 124int tps65912_device_init(struct tps65912 *tps65912)
125{ 125{
126 struct tps65912_board *pmic_plat_data = tps65912->dev->platform_data; 126 struct tps65912_board *pmic_plat_data = dev_get_platdata(tps65912->dev);
127 struct tps65912_platform_data *init_data; 127 struct tps65912_platform_data *init_data;
128 int ret, dcdc_avs, value; 128 int ret, dcdc_avs, value;
129 129
diff --git a/drivers/mfd/tps80031.c b/drivers/mfd/tps80031.c
index c90a2c450f51..f15ee6d5cfbf 100644
--- a/drivers/mfd/tps80031.c
+++ b/drivers/mfd/tps80031.c
@@ -418,7 +418,7 @@ static const struct regmap_config tps80031_regmap_configs[] = {
418static int tps80031_probe(struct i2c_client *client, 418static int tps80031_probe(struct i2c_client *client,
419 const struct i2c_device_id *id) 419 const struct i2c_device_id *id)
420{ 420{
421 struct tps80031_platform_data *pdata = client->dev.platform_data; 421 struct tps80031_platform_data *pdata = dev_get_platdata(&client->dev);
422 struct tps80031 *tps80031; 422 struct tps80031 *tps80031;
423 int ret; 423 int ret;
424 uint8_t es_version; 424 uint8_t es_version;
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 7f150d94d295..29473c2c95ae 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -1137,7 +1137,7 @@ static int twl_remove(struct i2c_client *client)
1137static int 1137static int
1138twl_probe(struct i2c_client *client, const struct i2c_device_id *id) 1138twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
1139{ 1139{
1140 struct twl4030_platform_data *pdata = client->dev.platform_data; 1140 struct twl4030_platform_data *pdata = dev_get_platdata(&client->dev);
1141 struct device_node *node = client->dev.of_node; 1141 struct device_node *node = client->dev.of_node;
1142 struct platform_device *pdev; 1142 struct platform_device *pdev;
1143 struct regmap_config *twl_regmap_config; 1143 struct regmap_config *twl_regmap_config;
diff --git a/drivers/mfd/twl4030-audio.c b/drivers/mfd/twl4030-audio.c
index a31fba96ef43..07fe542e6fc0 100644
--- a/drivers/mfd/twl4030-audio.c
+++ b/drivers/mfd/twl4030-audio.c
@@ -187,7 +187,7 @@ static bool twl4030_audio_has_vibra(struct twl4030_audio_data *pdata,
187static int twl4030_audio_probe(struct platform_device *pdev) 187static int twl4030_audio_probe(struct platform_device *pdev)
188{ 188{
189 struct twl4030_audio *audio; 189 struct twl4030_audio *audio;
190 struct twl4030_audio_data *pdata = pdev->dev.platform_data; 190 struct twl4030_audio_data *pdata = dev_get_platdata(&pdev->dev);
191 struct device_node *node = pdev->dev.of_node; 191 struct device_node *node = pdev->dev.of_node;
192 struct mfd_cell *cell = NULL; 192 struct mfd_cell *cell = NULL;
193 int ret, childs = 0; 193 int ret, childs = 0;
diff --git a/drivers/mfd/twl4030-madc.c b/drivers/mfd/twl4030-madc.c
index 1ea54d4d003a..4c583e471339 100644
--- a/drivers/mfd/twl4030-madc.c
+++ b/drivers/mfd/twl4030-madc.c
@@ -701,7 +701,7 @@ static int twl4030_madc_set_power(struct twl4030_madc_data *madc, int on)
701static int twl4030_madc_probe(struct platform_device *pdev) 701static int twl4030_madc_probe(struct platform_device *pdev)
702{ 702{
703 struct twl4030_madc_data *madc; 703 struct twl4030_madc_data *madc;
704 struct twl4030_madc_platform_data *pdata = pdev->dev.platform_data; 704 struct twl4030_madc_platform_data *pdata = dev_get_platdata(&pdev->dev);
705 int ret; 705 int ret;
706 u8 regval; 706 u8 regval;
707 707
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index a5fd3c738211..96162b62f3c0 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -493,7 +493,7 @@ int twl4030_remove_script(u8 flags)
493 return err; 493 return err;
494} 494}
495 495
496int twl4030_power_configure_scripts(struct twl4030_power_data *pdata) 496static int twl4030_power_configure_scripts(struct twl4030_power_data *pdata)
497{ 497{
498 int err; 498 int err;
499 int i; 499 int i;
@@ -509,7 +509,7 @@ int twl4030_power_configure_scripts(struct twl4030_power_data *pdata)
509 return 0; 509 return 0;
510} 510}
511 511
512int twl4030_power_configure_resources(struct twl4030_power_data *pdata) 512static int twl4030_power_configure_resources(struct twl4030_power_data *pdata)
513{ 513{
514 struct twl4030_resconfig *resconfig = pdata->resource_config; 514 struct twl4030_resconfig *resconfig = pdata->resource_config;
515 int err; 515 int err;
@@ -553,9 +553,9 @@ static bool twl4030_power_use_poweroff(struct twl4030_power_data *pdata,
553 return false; 553 return false;
554} 554}
555 555
556int twl4030_power_probe(struct platform_device *pdev) 556static int twl4030_power_probe(struct platform_device *pdev)
557{ 557{
558 struct twl4030_power_data *pdata = pdev->dev.platform_data; 558 struct twl4030_power_data *pdata = dev_get_platdata(&pdev->dev);
559 struct device_node *node = pdev->dev.of_node; 559 struct device_node *node = pdev->dev.of_node;
560 int err = 0; 560 int err = 0;
561 int err2 = 0; 561 int err2 = 0;
diff --git a/drivers/mfd/ucb1400_core.c b/drivers/mfd/ucb1400_core.c
index e9031fa9d53d..ebb20edf9c17 100644
--- a/drivers/mfd/ucb1400_core.c
+++ b/drivers/mfd/ucb1400_core.c
@@ -52,7 +52,7 @@ static int ucb1400_core_probe(struct device *dev)
52 struct ucb1400_ts ucb_ts; 52 struct ucb1400_ts ucb_ts;
53 struct ucb1400_gpio ucb_gpio; 53 struct ucb1400_gpio ucb_gpio;
54 struct snd_ac97 *ac97; 54 struct snd_ac97 *ac97;
55 struct ucb1400_pdata *pdata = dev->platform_data; 55 struct ucb1400_pdata *pdata = dev_get_platdata(dev);
56 56
57 memset(&ucb_ts, 0, sizeof(ucb_ts)); 57 memset(&ucb_ts, 0, sizeof(ucb_ts));
58 memset(&ucb_gpio, 0, sizeof(ucb_gpio)); 58 memset(&ucb_gpio, 0, sizeof(ucb_gpio));
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index 70f02daeb22a..b7cf98f75e7c 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -669,9 +669,10 @@ void ucb1x00_unregister_driver(struct ucb1x00_driver *drv)
669 mutex_unlock(&ucb1x00_mutex); 669 mutex_unlock(&ucb1x00_mutex);
670} 670}
671 671
672#ifdef CONFIG_PM_SLEEP
672static int ucb1x00_suspend(struct device *dev) 673static int ucb1x00_suspend(struct device *dev)
673{ 674{
674 struct ucb1x00_plat_data *pdata = dev->platform_data; 675 struct ucb1x00_plat_data *pdata = dev_get_platdata(dev);
675 struct ucb1x00 *ucb = dev_get_drvdata(dev); 676 struct ucb1x00 *ucb = dev_get_drvdata(dev);
676 struct ucb1x00_dev *udev; 677 struct ucb1x00_dev *udev;
677 678
@@ -703,7 +704,7 @@ static int ucb1x00_suspend(struct device *dev)
703 704
704static int ucb1x00_resume(struct device *dev) 705static int ucb1x00_resume(struct device *dev)
705{ 706{
706 struct ucb1x00_plat_data *pdata = dev->platform_data; 707 struct ucb1x00_plat_data *pdata = dev_get_platdata(dev);
707 struct ucb1x00 *ucb = dev_get_drvdata(dev); 708 struct ucb1x00 *ucb = dev_get_drvdata(dev);
708 struct ucb1x00_dev *udev; 709 struct ucb1x00_dev *udev;
709 710
@@ -736,6 +737,7 @@ static int ucb1x00_resume(struct device *dev)
736 mutex_unlock(&ucb1x00_mutex); 737 mutex_unlock(&ucb1x00_mutex);
737 return 0; 738 return 0;
738} 739}
740#endif
739 741
740static const struct dev_pm_ops ucb1x00_pm_ops = { 742static const struct dev_pm_ops ucb1x00_pm_ops = {
741 SET_SYSTEM_SLEEP_PM_OPS(ucb1x00_suspend, ucb1x00_resume) 743 SET_SYSTEM_SLEEP_PM_OPS(ucb1x00_suspend, ucb1x00_resume)
diff --git a/drivers/mfd/wl1273-core.c b/drivers/mfd/wl1273-core.c
index edbe6c1b755a..f7c52d901040 100644
--- a/drivers/mfd/wl1273-core.c
+++ b/drivers/mfd/wl1273-core.c
@@ -172,12 +172,9 @@ static int wl1273_fm_set_volume(struct wl1273_core *core, unsigned int volume)
172 172
173static int wl1273_core_remove(struct i2c_client *client) 173static int wl1273_core_remove(struct i2c_client *client)
174{ 174{
175 struct wl1273_core *core = i2c_get_clientdata(client);
176
177 dev_dbg(&client->dev, "%s\n", __func__); 175 dev_dbg(&client->dev, "%s\n", __func__);
178 176
179 mfd_remove_devices(&client->dev); 177 mfd_remove_devices(&client->dev);
180 kfree(core);
181 178
182 return 0; 179 return 0;
183} 180}
@@ -185,7 +182,7 @@ static int wl1273_core_remove(struct i2c_client *client)
185static int wl1273_core_probe(struct i2c_client *client, 182static int wl1273_core_probe(struct i2c_client *client,
186 const struct i2c_device_id *id) 183 const struct i2c_device_id *id)
187{ 184{
188 struct wl1273_fm_platform_data *pdata = client->dev.platform_data; 185 struct wl1273_fm_platform_data *pdata = dev_get_platdata(&client->dev);
189 struct wl1273_core *core; 186 struct wl1273_core *core;
190 struct mfd_cell *cell; 187 struct mfd_cell *cell;
191 int children = 0; 188 int children = 0;
@@ -203,7 +200,7 @@ static int wl1273_core_probe(struct i2c_client *client,
203 return -EINVAL; 200 return -EINVAL;
204 } 201 }
205 202
206 core = kzalloc(sizeof(*core), GFP_KERNEL); 203 core = devm_kzalloc(&client->dev, sizeof(*core), GFP_KERNEL);
207 if (!core) 204 if (!core)
208 return -ENOMEM; 205 return -ENOMEM;
209 206
@@ -249,7 +246,6 @@ static int wl1273_core_probe(struct i2c_client *client,
249 246
250err: 247err:
251 pdata->free_resources(); 248 pdata->free_resources();
252 kfree(core);
253 249
254 dev_dbg(&client->dev, "%s\n", __func__); 250 dev_dbg(&client->dev, "%s\n", __func__);
255 251
diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c
index 2a7972349159..3113e39b318e 100644
--- a/drivers/mfd/wm5110-tables.c
+++ b/drivers/mfd/wm5110-tables.c
@@ -468,12 +468,14 @@ static const struct reg_default wm5110_reg_default[] = {
468 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */ 468 { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */
469 { 0x00000177, 0x0281 }, /* R375 - FLL1 Loop Filter Test 1 */ 469 { 0x00000177, 0x0281 }, /* R375 - FLL1 Loop Filter Test 1 */
470 { 0x00000178, 0x0000 }, /* R376 - FLL1 NCO Test 0 */ 470 { 0x00000178, 0x0000 }, /* R376 - FLL1 NCO Test 0 */
471 { 0x00000179, 0x0000 }, /* R376 - FLL1 Control 7 */
471 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */ 472 { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */
472 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */ 473 { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */
473 { 0x00000183, 0x0000 }, /* R387 - FLL1 Synchroniser 3 */ 474 { 0x00000183, 0x0000 }, /* R387 - FLL1 Synchroniser 3 */
474 { 0x00000184, 0x0000 }, /* R388 - FLL1 Synchroniser 4 */ 475 { 0x00000184, 0x0000 }, /* R388 - FLL1 Synchroniser 4 */
475 { 0x00000185, 0x0000 }, /* R389 - FLL1 Synchroniser 5 */ 476 { 0x00000185, 0x0000 }, /* R389 - FLL1 Synchroniser 5 */
476 { 0x00000186, 0x0000 }, /* R390 - FLL1 Synchroniser 6 */ 477 { 0x00000186, 0x0000 }, /* R390 - FLL1 Synchroniser 6 */
478 { 0x00000187, 0x0001 }, /* R390 - FLL1 Synchroniser 7 */
477 { 0x00000189, 0x0000 }, /* R393 - FLL1 Spread Spectrum */ 479 { 0x00000189, 0x0000 }, /* R393 - FLL1 Spread Spectrum */
478 { 0x0000018A, 0x0004 }, /* R394 - FLL1 GPIO Clock */ 480 { 0x0000018A, 0x0004 }, /* R394 - FLL1 GPIO Clock */
479 { 0x00000191, 0x0000 }, /* R401 - FLL2 Control 1 */ 481 { 0x00000191, 0x0000 }, /* R401 - FLL2 Control 1 */
@@ -484,12 +486,14 @@ static const struct reg_default wm5110_reg_default[] = {
484 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */ 486 { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */
485 { 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */ 487 { 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */
486 { 0x00000198, 0x0000 }, /* R408 - FLL2 NCO Test 0 */ 488 { 0x00000198, 0x0000 }, /* R408 - FLL2 NCO Test 0 */
489 { 0x00000199, 0x0000 }, /* R408 - FLL2 Control 7 */
487 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */ 490 { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */
488 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */ 491 { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */
489 { 0x000001A3, 0x0000 }, /* R419 - FLL2 Synchroniser 3 */ 492 { 0x000001A3, 0x0000 }, /* R419 - FLL2 Synchroniser 3 */
490 { 0x000001A4, 0x0000 }, /* R420 - FLL2 Synchroniser 4 */ 493 { 0x000001A4, 0x0000 }, /* R420 - FLL2 Synchroniser 4 */
491 { 0x000001A5, 0x0000 }, /* R421 - FLL2 Synchroniser 5 */ 494 { 0x000001A5, 0x0000 }, /* R421 - FLL2 Synchroniser 5 */
492 { 0x000001A6, 0x0000 }, /* R422 - FLL2 Synchroniser 6 */ 495 { 0x000001A6, 0x0000 }, /* R422 - FLL2 Synchroniser 6 */
496 { 0x000001A7, 0x0001 }, /* R422 - FLL2 Synchroniser 7 */
493 { 0x000001A9, 0x0000 }, /* R425 - FLL2 Spread Spectrum */ 497 { 0x000001A9, 0x0000 }, /* R425 - FLL2 Spread Spectrum */
494 { 0x000001AA, 0x0004 }, /* R426 - FLL2 GPIO Clock */ 498 { 0x000001AA, 0x0004 }, /* R426 - FLL2 GPIO Clock */
495 { 0x00000200, 0x0006 }, /* R512 - Mic Charge Pump 1 */ 499 { 0x00000200, 0x0006 }, /* R512 - Mic Charge Pump 1 */
@@ -503,6 +507,11 @@ static const struct reg_default wm5110_reg_default[] = {
503 { 0x0000029C, 0x0000 }, /* R668 - Headphone Detect 2 */ 507 { 0x0000029C, 0x0000 }, /* R668 - Headphone Detect 2 */
504 { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ 508 { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */
505 { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ 509 { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */
510 { 0x000002A5, 0x0000 }, /* R677 - Mic Detect 3 */
511 { 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */
512 { 0x000002A7, 0x372C }, /* R679 - Mic Detect Level 2 */
513 { 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */
514 { 0x000002A9, 0x300A }, /* R681 - Mic Detect Level 4 */
506 { 0x000002C3, 0x0000 }, /* R707 - Mic noise mix control 1 */ 515 { 0x000002C3, 0x0000 }, /* R707 - Mic noise mix control 1 */
507 { 0x000002D3, 0x0000 }, /* R723 - Jack detect analogue */ 516 { 0x000002D3, 0x0000 }, /* R723 - Jack detect analogue */
508 { 0x00000300, 0x0000 }, /* R768 - Input Enables */ 517 { 0x00000300, 0x0000 }, /* R768 - Input Enables */
@@ -1392,6 +1401,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg)
1392 case ARIZONA_FLL1_CONTROL_4: 1401 case ARIZONA_FLL1_CONTROL_4:
1393 case ARIZONA_FLL1_CONTROL_5: 1402 case ARIZONA_FLL1_CONTROL_5:
1394 case ARIZONA_FLL1_CONTROL_6: 1403 case ARIZONA_FLL1_CONTROL_6:
1404 case ARIZONA_FLL1_CONTROL_7:
1395 case ARIZONA_FLL1_LOOP_FILTER_TEST_1: 1405 case ARIZONA_FLL1_LOOP_FILTER_TEST_1:
1396 case ARIZONA_FLL1_NCO_TEST_0: 1406 case ARIZONA_FLL1_NCO_TEST_0:
1397 case ARIZONA_FLL1_SYNCHRONISER_1: 1407 case ARIZONA_FLL1_SYNCHRONISER_1:
@@ -1400,6 +1410,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg)
1400 case ARIZONA_FLL1_SYNCHRONISER_4: 1410 case ARIZONA_FLL1_SYNCHRONISER_4:
1401 case ARIZONA_FLL1_SYNCHRONISER_5: 1411 case ARIZONA_FLL1_SYNCHRONISER_5:
1402 case ARIZONA_FLL1_SYNCHRONISER_6: 1412 case ARIZONA_FLL1_SYNCHRONISER_6:
1413 case ARIZONA_FLL1_SYNCHRONISER_7:
1403 case ARIZONA_FLL1_SPREAD_SPECTRUM: 1414 case ARIZONA_FLL1_SPREAD_SPECTRUM:
1404 case ARIZONA_FLL1_GPIO_CLOCK: 1415 case ARIZONA_FLL1_GPIO_CLOCK:
1405 case ARIZONA_FLL2_CONTROL_1: 1416 case ARIZONA_FLL2_CONTROL_1:
@@ -1408,6 +1419,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg)
1408 case ARIZONA_FLL2_CONTROL_4: 1419 case ARIZONA_FLL2_CONTROL_4:
1409 case ARIZONA_FLL2_CONTROL_5: 1420 case ARIZONA_FLL2_CONTROL_5:
1410 case ARIZONA_FLL2_CONTROL_6: 1421 case ARIZONA_FLL2_CONTROL_6:
1422 case ARIZONA_FLL2_CONTROL_7:
1411 case ARIZONA_FLL2_LOOP_FILTER_TEST_1: 1423 case ARIZONA_FLL2_LOOP_FILTER_TEST_1:
1412 case ARIZONA_FLL2_NCO_TEST_0: 1424 case ARIZONA_FLL2_NCO_TEST_0:
1413 case ARIZONA_FLL2_SYNCHRONISER_1: 1425 case ARIZONA_FLL2_SYNCHRONISER_1:
@@ -1416,6 +1428,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg)
1416 case ARIZONA_FLL2_SYNCHRONISER_4: 1428 case ARIZONA_FLL2_SYNCHRONISER_4:
1417 case ARIZONA_FLL2_SYNCHRONISER_5: 1429 case ARIZONA_FLL2_SYNCHRONISER_5:
1418 case ARIZONA_FLL2_SYNCHRONISER_6: 1430 case ARIZONA_FLL2_SYNCHRONISER_6:
1431 case ARIZONA_FLL2_SYNCHRONISER_7:
1419 case ARIZONA_FLL2_SPREAD_SPECTRUM: 1432 case ARIZONA_FLL2_SPREAD_SPECTRUM:
1420 case ARIZONA_FLL2_GPIO_CLOCK: 1433 case ARIZONA_FLL2_GPIO_CLOCK:
1421 case ARIZONA_MIC_CHARGE_PUMP_1: 1434 case ARIZONA_MIC_CHARGE_PUMP_1:
@@ -1430,6 +1443,10 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg)
1430 case ARIZONA_MIC_DETECT_1: 1443 case ARIZONA_MIC_DETECT_1:
1431 case ARIZONA_MIC_DETECT_2: 1444 case ARIZONA_MIC_DETECT_2:
1432 case ARIZONA_MIC_DETECT_3: 1445 case ARIZONA_MIC_DETECT_3:
1446 case ARIZONA_MIC_DETECT_LEVEL_1:
1447 case ARIZONA_MIC_DETECT_LEVEL_2:
1448 case ARIZONA_MIC_DETECT_LEVEL_3:
1449 case ARIZONA_MIC_DETECT_LEVEL_4:
1433 case ARIZONA_MIC_NOISE_MIX_CONTROL_1: 1450 case ARIZONA_MIC_NOISE_MIX_CONTROL_1:
1434 case ARIZONA_JACK_DETECT_ANALOGUE: 1451 case ARIZONA_JACK_DETECT_ANALOGUE:
1435 case ARIZONA_INPUT_ENABLES: 1452 case ARIZONA_INPUT_ENABLES:
@@ -2332,6 +2349,7 @@ static bool wm5110_volatile_register(struct device *dev, unsigned int reg)
2332 case ARIZONA_IRQ_PIN_STATUS: 2349 case ARIZONA_IRQ_PIN_STATUS:
2333 case ARIZONA_AOD_IRQ1: 2350 case ARIZONA_AOD_IRQ1:
2334 case ARIZONA_AOD_IRQ2: 2351 case ARIZONA_AOD_IRQ2:
2352 case ARIZONA_FX_CTRL2:
2335 case ARIZONA_ASRC_STATUS: 2353 case ARIZONA_ASRC_STATUS:
2336 case ARIZONA_DSP_STATUS: 2354 case ARIZONA_DSP_STATUS:
2337 case ARIZONA_DSP1_CONTROL_1: 2355 case ARIZONA_DSP1_CONTROL_1:
diff --git a/drivers/mfd/wm831x-core.c b/drivers/mfd/wm831x-core.c
index 521340a708d3..5c459f469224 100644
--- a/drivers/mfd/wm831x-core.c
+++ b/drivers/mfd/wm831x-core.c
@@ -1618,7 +1618,7 @@ EXPORT_SYMBOL_GPL(wm831x_regmap_config);
1618 */ 1618 */
1619int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) 1619int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq)
1620{ 1620{
1621 struct wm831x_pdata *pdata = wm831x->dev->platform_data; 1621 struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev);
1622 int rev, wm831x_num; 1622 int rev, wm831x_num;
1623 enum wm831x_parent parent; 1623 enum wm831x_parent parent;
1624 int ret, i; 1624 int ret, i;
diff --git a/drivers/mfd/wm831x-irq.c b/drivers/mfd/wm831x-irq.c
index 804e56ec99eb..64e512eadf17 100644
--- a/drivers/mfd/wm831x-irq.c
+++ b/drivers/mfd/wm831x-irq.c
@@ -571,7 +571,7 @@ static struct irq_domain_ops wm831x_irq_domain_ops = {
571 571
572int wm831x_irq_init(struct wm831x *wm831x, int irq) 572int wm831x_irq_init(struct wm831x *wm831x, int irq)
573{ 573{
574 struct wm831x_pdata *pdata = wm831x->dev->platform_data; 574 struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev);
575 struct irq_domain *domain; 575 struct irq_domain *domain;
576 int i, ret, irq_base; 576 int i, ret, irq_base;
577 577
diff --git a/drivers/mfd/wm831x-spi.c b/drivers/mfd/wm831x-spi.c
index e7ed14f661d8..07de3cc5a0d9 100644
--- a/drivers/mfd/wm831x-spi.c
+++ b/drivers/mfd/wm831x-spi.c
@@ -34,7 +34,6 @@ static int wm831x_spi_probe(struct spi_device *spi)
34 if (wm831x == NULL) 34 if (wm831x == NULL)
35 return -ENOMEM; 35 return -ENOMEM;
36 36
37 spi->bits_per_word = 16;
38 spi->mode = SPI_MODE_0; 37 spi->mode = SPI_MODE_0;
39 38
40 spi_set_drvdata(spi, wm831x); 39 spi_set_drvdata(spi, wm831x);
diff --git a/drivers/mfd/wm8350-i2c.c b/drivers/mfd/wm8350-i2c.c
index 2e57101c8d3d..f919def05e24 100644
--- a/drivers/mfd/wm8350-i2c.c
+++ b/drivers/mfd/wm8350-i2c.c
@@ -27,6 +27,7 @@ static int wm8350_i2c_probe(struct i2c_client *i2c,
27 const struct i2c_device_id *id) 27 const struct i2c_device_id *id)
28{ 28{
29 struct wm8350 *wm8350; 29 struct wm8350 *wm8350;
30 struct wm8350_platform_data *pdata = dev_get_platdata(&i2c->dev);
30 int ret = 0; 31 int ret = 0;
31 32
32 wm8350 = devm_kzalloc(&i2c->dev, sizeof(struct wm8350), GFP_KERNEL); 33 wm8350 = devm_kzalloc(&i2c->dev, sizeof(struct wm8350), GFP_KERNEL);
@@ -44,7 +45,7 @@ static int wm8350_i2c_probe(struct i2c_client *i2c,
44 i2c_set_clientdata(i2c, wm8350); 45 i2c_set_clientdata(i2c, wm8350);
45 wm8350->dev = &i2c->dev; 46 wm8350->dev = &i2c->dev;
46 47
47 return wm8350_device_init(wm8350, i2c->irq, i2c->dev.platform_data); 48 return wm8350_device_init(wm8350, i2c->irq, pdata);
48} 49}
49 50
50static int wm8350_i2c_remove(struct i2c_client *i2c) 51static int wm8350_i2c_remove(struct i2c_client *i2c)
diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index 639ca359242f..d66d256551fb 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -178,7 +178,7 @@ static int wm8400_i2c_probe(struct i2c_client *i2c,
178 wm8400->dev = &i2c->dev; 178 wm8400->dev = &i2c->dev;
179 i2c_set_clientdata(i2c, wm8400); 179 i2c_set_clientdata(i2c, wm8400);
180 180
181 ret = wm8400_init(wm8400, i2c->dev.platform_data); 181 ret = wm8400_init(wm8400, dev_get_platdata(&i2c->dev));
182 if (ret != 0) 182 if (ret != 0)
183 goto err; 183 goto err;
184 184
diff --git a/drivers/mfd/wm8994-irq.c b/drivers/mfd/wm8994-irq.c
index d3a184a240f5..e74dedda5b55 100644
--- a/drivers/mfd/wm8994-irq.c
+++ b/drivers/mfd/wm8994-irq.c
@@ -193,7 +193,7 @@ int wm8994_irq_init(struct wm8994 *wm8994)
193{ 193{
194 int ret; 194 int ret;
195 unsigned long irqflags; 195 unsigned long irqflags;
196 struct wm8994_pdata *pdata = wm8994->dev->platform_data; 196 struct wm8994_pdata *pdata = dev_get_platdata(wm8994->dev);
197 197
198 if (!wm8994->irq) { 198 if (!wm8994->irq) {
199 dev_warn(wm8994->dev, 199 dev_warn(wm8994->dev,