From 3e4f8789946de61c61ce6a373d069d55725d956c Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 30 Jul 2013 13:19:55 +0100 Subject: mfd: wm831x: Remove erronious bits per word set Since the conversion to the regmap API setting bits per word will lead to data corruption since the regmap API already configures the bits per word appropriately. Signed-off-by: Mark Brown Signed-off-by: Lee Jones --- drivers/mfd/wm831x-spi.c | 1 - 1 file changed, 1 deletion(-) 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) if (wm831x == NULL) return -ENOMEM; - spi->bits_per_word = 16; spi->mode = SPI_MODE_0; spi_set_drvdata(spi, wm831x); -- cgit v1.2.3-70-g09d2 From 334a41ce9b753ec615e8c6c50ee07d6197190610 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 30 Jul 2013 17:10:05 +0900 Subject: mfd: 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 Signed-off-by: Lee Jones --- drivers/mfd/88pm800.c | 2 +- drivers/mfd/88pm805.c | 2 +- drivers/mfd/88pm860x-core.c | 2 +- drivers/mfd/aat2870-core.c | 2 +- drivers/mfd/ab3100-core.c | 2 +- drivers/mfd/adp5520.c | 2 +- drivers/mfd/as3711.c | 2 +- drivers/mfd/asic3.c | 2 +- drivers/mfd/da903x.c | 2 +- drivers/mfd/da9052-core.c | 2 +- drivers/mfd/da9055-core.c | 2 +- drivers/mfd/dm355evm_msp.c | 4 ++-- drivers/mfd/ezx-pcap.c | 6 +++--- drivers/mfd/htc-egpio.c | 2 +- drivers/mfd/htc-i2cpld.c | 10 +++++----- drivers/mfd/htc-pasic3.c | 2 +- drivers/mfd/intel_msic.c | 4 ++-- drivers/mfd/kempld-core.c | 12 ++++++------ drivers/mfd/lm3533-core.c | 8 ++++---- drivers/mfd/lp8788.c | 2 +- drivers/mfd/max77686.c | 2 +- drivers/mfd/max77693.c | 2 +- drivers/mfd/max8925-i2c.c | 2 +- drivers/mfd/max8997.c | 2 +- drivers/mfd/max8998.c | 2 +- drivers/mfd/mcp-sa11x0.c | 2 +- drivers/mfd/menelaus.c | 2 +- drivers/mfd/omap-usb-host.c | 4 ++-- drivers/mfd/pcf50633-core.c | 2 +- drivers/mfd/pm8921-core.c | 2 +- drivers/mfd/rc5t583.c | 2 +- drivers/mfd/sec-core.c | 2 +- drivers/mfd/si476x-i2c.c | 2 +- drivers/mfd/sm501.c | 6 +++--- drivers/mfd/sta2x11-mfd.c | 4 ++-- drivers/mfd/t7l66xb.c | 8 ++++---- drivers/mfd/tc3589x.c | 2 +- drivers/mfd/tc6387xb.c | 6 +++--- drivers/mfd/tc6393xb.c | 8 ++++---- drivers/mfd/ti-ssp.c | 2 +- drivers/mfd/tps6105x.c | 2 +- drivers/mfd/tps65010.c | 4 ++-- drivers/mfd/tps65090.c | 2 +- drivers/mfd/tps6586x.c | 2 +- drivers/mfd/tps65912-core.c | 2 +- drivers/mfd/tps80031.c | 2 +- drivers/mfd/twl-core.c | 2 +- drivers/mfd/twl4030-audio.c | 2 +- drivers/mfd/twl4030-madc.c | 2 +- drivers/mfd/twl4030-power.c | 2 +- drivers/mfd/ucb1400_core.c | 2 +- drivers/mfd/ucb1x00-core.c | 4 ++-- drivers/mfd/wl1273-core.c | 2 +- drivers/mfd/wm831x-core.c | 2 +- drivers/mfd/wm831x-irq.c | 2 +- drivers/mfd/wm8350-i2c.c | 3 ++- drivers/mfd/wm8400-core.c | 2 +- drivers/mfd/wm8994-irq.c | 2 +- 58 files changed, 89 insertions(+), 88 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, { int ret = 0; struct pm80x_chip *chip; - struct pm80x_platform_data *pdata = client->dev.platform_data; + struct pm80x_platform_data *pdata = dev_get_platdata(&client->dev); struct pm80x_subchip *subchip; 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, { int ret = 0; struct pm80x_chip *chip; - struct pm80x_platform_data *pdata = client->dev.platform_data; + struct pm80x_platform_data *pdata = dev_get_platdata(&client->dev); ret = pm80x_init(client); 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, static int pm860x_probe(struct i2c_client *client, const struct i2c_device_id *id) { - struct pm860x_platform_data *pdata = client->dev.platform_data; + struct pm860x_platform_data *pdata = dev_get_platdata(&client->dev); struct device_node *node = client->dev.of_node; struct pm860x_chip *chip; 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) static int aat2870_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { - struct aat2870_platform_data *pdata = client->dev.platform_data; + struct aat2870_platform_data *pdata = dev_get_platdata(&client->dev); struct aat2870_data *aat2870; int i, j; 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, { struct ab3100 *ab3100; struct ab3100_platform_data *ab3100_plf_data = - client->dev.platform_data; + dev_get_platdata(&client->dev); int err; int i; 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) static int adp5520_probe(struct i2c_client *client, const struct i2c_device_id *id) { - struct adp5520_platform_data *pdata = client->dev.platform_data; + struct adp5520_platform_data *pdata = dev_get_platdata(&client->dev); struct platform_device *pdev; struct adp5520_chip *chip; int ret; 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, int ret; if (!client->dev.of_node) { - pdata = client->dev.platform_data; + pdata = dev_get_platdata(&client->dev); if (!pdata) dev_dbg(&client->dev, "Platform data not found\n"); } 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) /* Core */ static int __init asic3_probe(struct platform_device *pdev) { - struct asic3_platform_data *pdata = pdev->dev.platform_data; + struct asic3_platform_data *pdata = dev_get_platdata(&pdev->dev); struct asic3 *asic; struct resource *mem; 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: static int da903x_probe(struct i2c_client *client, const struct i2c_device_id *id) { - struct da903x_platform_data *pdata = client->dev.platform_data; + struct da903x_platform_data *pdata = dev_get_platdata(&client->dev); struct da903x_chip *chip; unsigned int tmp; 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); int da9052_device_init(struct da9052 *da9052, u8 chip_id) { - struct da9052_pdata *pdata = da9052->dev->platform_data; + struct da9052_pdata *pdata = dev_get_platdata(da9052->dev); int ret; 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 = { int da9055_device_init(struct da9055 *da9055) { - struct da9055_pdata *pdata = da9055->dev->platform_data; + struct da9055_pdata *pdata = dev_get_platdata(da9055->dev); int ret; uint8_t clear_events[3] = {0xFF, 0xFF, 0xFF}; 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) } /* MMC/SD inputs -- right after the last config input */ - if (client->dev.platform_data) { - void (*mmcsd_setup)(unsigned) = client->dev.platform_data; + if (dev_get_platdata(&client->dev)) { + void (*mmcsd_setup)(unsigned) = dev_get_platdata(&client->dev); mmcsd_setup(dm355evm_msp_gpio.base + 8 + 5); } 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) static void pcap_isr_work(struct work_struct *work) { struct pcap_chip *pcap = container_of(work, struct pcap_chip, isr_work); - struct pcap_platform_data *pdata = pcap->spi->dev.platform_data; + struct pcap_platform_data *pdata = dev_get_platdata(&pcap->spi->dev); u32 msr, isr, int_sel, service; int irq; @@ -394,7 +394,7 @@ static int pcap_add_subdev(struct pcap_chip *pcap, static int ezx_pcap_remove(struct spi_device *spi) { struct pcap_chip *pcap = spi_get_drvdata(spi); - struct pcap_platform_data *pdata = spi->dev.platform_data; + struct pcap_platform_data *pdata = dev_get_platdata(&spi->dev); int i, adc_irq; /* remove all registered subdevs */ @@ -420,7 +420,7 @@ static int ezx_pcap_remove(struct spi_device *spi) static int ezx_pcap_probe(struct spi_device *spi) { - struct pcap_platform_data *pdata = spi->dev.platform_data; + struct pcap_platform_data *pdata = dev_get_platdata(&spi->dev); struct pcap_chip *pcap; int i, adc_irq; 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) static int __init egpio_probe(struct platform_device *pdev) { - struct htc_egpio_platform_data *pdata = pdev->dev.platform_data; + struct htc_egpio_platform_data *pdata = dev_get_platdata(&pdev->dev); struct resource *res; struct egpio_info *ei; 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( int ret = 0; /* Get the platform and driver data */ - pdata = dev->platform_data; + pdata = dev_get_platdata(dev); htcpld = platform_get_drvdata(pdev); chip = &htcpld->chip[chip_index]; plat_chip_data = &pdata->chip[chip_index]; @@ -375,7 +375,7 @@ static int htcpld_register_chip_i2c( struct i2c_board_info info; /* Get the platform and driver data */ - pdata = dev->platform_data; + pdata = dev_get_platdata(dev); htcpld = platform_get_drvdata(pdev); chip = &htcpld->chip[chip_index]; plat_chip_data = &pdata->chip[chip_index]; @@ -447,7 +447,7 @@ static int htcpld_register_chip_gpio( int ret = 0; /* Get the platform and driver data */ - pdata = dev->platform_data; + pdata = dev_get_platdata(dev); htcpld = platform_get_drvdata(pdev); chip = &htcpld->chip[chip_index]; plat_chip_data = &pdata->chip[chip_index]; @@ -509,7 +509,7 @@ static int htcpld_setup_chips(struct platform_device *pdev) int i; /* Get the platform and driver data */ - pdata = dev->platform_data; + pdata = dev_get_platdata(dev); htcpld = platform_get_drvdata(pdev); /* Setup each chip's output GPIOs */ @@ -574,7 +574,7 @@ static int htcpld_core_probe(struct platform_device *pdev) if (!dev) return -ENODEV; - pdata = dev->platform_data; + pdata = dev_get_platdata(dev); if (!pdata) { dev_warn(dev, "Platform data not found for htcpld core!\n"); 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 = { static int __init pasic3_probe(struct platform_device *pdev) { - struct pasic3_platform_data *pdata = pdev->dev.platform_data; + struct pasic3_platform_data *pdata = dev_get_platdata(&pdev->dev); struct device *dev = &pdev->dev; struct pasic3_data *asic; 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); static int intel_msic_init_devices(struct intel_msic *msic) { struct platform_device *pdev = msic->pdev; - struct intel_msic_platform_data *pdata = pdev->dev.platform_data; + struct intel_msic_platform_data *pdata = dev_get_platdata(&pdev->dev); int ret, i; if (pdata->gpio) { @@ -372,7 +372,7 @@ static void intel_msic_remove_devices(struct intel_msic *msic) static int intel_msic_probe(struct platform_device *pdev) { - struct intel_msic_platform_data *pdata = pdev->dev.platform_data; + struct intel_msic_platform_data *pdata = dev_get_platdata(&pdev->dev); struct intel_msic *msic; struct resource *res; u8 id0, id1; diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c index 686a4565acb6..ab36e6ebbf8b 100644 --- a/drivers/mfd/kempld-core.c +++ b/drivers/mfd/kempld-core.c @@ -258,7 +258,7 @@ EXPORT_SYMBOL_GPL(kempld_write32); */ void kempld_get_mutex(struct kempld_device_data *pld) { - struct kempld_platform_data *pdata = pld->dev->platform_data; + struct kempld_platform_data *pdata = dev_get_platdata(pld->dev); mutex_lock(&pld->lock); pdata->get_hardware_mutex(pld); @@ -271,7 +271,7 @@ EXPORT_SYMBOL_GPL(kempld_get_mutex); */ void kempld_release_mutex(struct kempld_device_data *pld) { - struct kempld_platform_data *pdata = pld->dev->platform_data; + struct kempld_platform_data *pdata = dev_get_platdata(pld->dev); pdata->release_hardware_mutex(pld); mutex_unlock(&pld->lock); @@ -288,7 +288,7 @@ EXPORT_SYMBOL_GPL(kempld_release_mutex); */ static int kempld_get_info(struct kempld_device_data *pld) { - struct kempld_platform_data *pdata = pld->dev->platform_data; + struct kempld_platform_data *pdata = dev_get_platdata(pld->dev); return pdata->get_info(pld); } @@ -302,7 +302,7 @@ static int kempld_get_info(struct kempld_device_data *pld) */ static int kempld_register_cells(struct kempld_device_data *pld) { - struct kempld_platform_data *pdata = pld->dev->platform_data; + struct kempld_platform_data *pdata = dev_get_platdata(pld->dev); return pdata->register_cells(pld); } @@ -357,7 +357,7 @@ static int kempld_detect_device(struct kempld_device_data *pld) static int kempld_probe(struct platform_device *pdev) { - struct kempld_platform_data *pdata = pdev->dev.platform_data; + struct kempld_platform_data *pdata = dev_get_platdata(&pdev->dev); struct device *dev = &pdev->dev; struct kempld_device_data *pld; struct resource *ioport; @@ -394,7 +394,7 @@ static int kempld_probe(struct platform_device *pdev) static int kempld_remove(struct platform_device *pdev) { struct kempld_device_data *pld = platform_get_drvdata(pdev); - struct kempld_platform_data *pdata = pld->dev->platform_data; + struct kempld_platform_data *pdata = dev_get_platdata(pld->dev); mfd_remove_devices(&pdev->dev); pdata->release_hardware_mutex(pld); 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 = { static int lm3533_device_als_init(struct lm3533 *lm3533) { - struct lm3533_platform_data *pdata = lm3533->dev->platform_data; + struct lm3533_platform_data *pdata = dev_get_platdata(lm3533->dev); int ret; if (!pdata->als) @@ -407,7 +407,7 @@ static int lm3533_device_als_init(struct lm3533 *lm3533) static int lm3533_device_bl_init(struct lm3533 *lm3533) { - struct lm3533_platform_data *pdata = lm3533->dev->platform_data; + struct lm3533_platform_data *pdata = dev_get_platdata(lm3533->dev); int i; int ret; @@ -436,7 +436,7 @@ static int lm3533_device_bl_init(struct lm3533 *lm3533) static int lm3533_device_led_init(struct lm3533 *lm3533) { - struct lm3533_platform_data *pdata = lm3533->dev->platform_data; + struct lm3533_platform_data *pdata = dev_get_platdata(lm3533->dev); int i; int ret; @@ -481,7 +481,7 @@ static int lm3533_device_setup(struct lm3533 *lm3533, static int lm3533_device_init(struct lm3533 *lm3533) { - struct lm3533_platform_data *pdata = lm3533->dev->platform_data; + struct lm3533_platform_data *pdata = dev_get_platdata(lm3533->dev); int ret; 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 = { static int lp8788_probe(struct i2c_client *cl, const struct i2c_device_id *id) { struct lp8788 *lp; - struct lp8788_platform_data *pdata = cl->dev.platform_data; + struct lp8788_platform_data *pdata = dev_get_platdata(&cl->dev); int ret; lp = devm_kzalloc(&cl->dev, sizeof(struct lp8788), GFP_KERNEL); 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, const struct i2c_device_id *id) { struct max77686_dev *max77686 = NULL; - struct max77686_platform_data *pdata = i2c->dev.platform_data; + struct max77686_platform_data *pdata = dev_get_platdata(&i2c->dev); unsigned int data; int ret = 0; 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, const struct i2c_device_id *id) { struct max77693_dev *max77693; - struct max77693_platform_data *pdata = i2c->dev.platform_data; + struct max77693_platform_data *pdata = dev_get_platdata(&i2c->dev); u8 reg_data; int ret = 0; 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, static int max8925_probe(struct i2c_client *client, const struct i2c_device_id *id) { - struct max8925_platform_data *pdata = client->dev.platform_data; + struct max8925_platform_data *pdata = dev_get_platdata(&client->dev); static struct max8925_chip *chip; struct device_node *node = client->dev.of_node; diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c index 14714058f2d2..ae55dd43d09c 100644 --- a/drivers/mfd/max8997.c +++ b/drivers/mfd/max8997.c @@ -188,7 +188,7 @@ static int max8997_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct max8997_dev *max8997; - struct max8997_platform_data *pdata = i2c->dev.platform_data; + struct max8997_platform_data *pdata = dev_get_platdata(&i2c->dev); int ret = 0; max8997 = kzalloc(sizeof(struct max8997_dev), GFP_KERNEL); diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c index 21af51a499f4..45bffb8c7236 100644 --- a/drivers/mfd/max8998.c +++ b/drivers/mfd/max8998.c @@ -184,7 +184,7 @@ static inline int max8998_i2c_get_driver_data(struct i2c_client *i2c, static int max8998_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { - struct max8998_platform_data *pdata = i2c->dev.platform_data; + struct max8998_platform_data *pdata = dev_get_platdata(&i2c->dev); struct max8998_dev *max8998; int ret = 0; 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 = { static int mcp_sa11x0_probe(struct platform_device *dev) { - struct mcp_plat_data *data = dev->dev.platform_data; + struct mcp_plat_data *data = dev_get_platdata(&dev->dev); struct resource *mem0, *mem1; struct mcp_sa11x0 *m; struct mcp *mcp; diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c index 998ce8cb3065..9b72a44ab60b 100644 --- a/drivers/mfd/menelaus.c +++ b/drivers/mfd/menelaus.c @@ -1189,7 +1189,7 @@ static int menelaus_probe(struct i2c_client *client, int rev = 0, val; int err = 0; struct menelaus_platform_data *menelaus_pdata = - client->dev.platform_data; + dev_get_platdata(&client->dev); if (the_menelaus) { dev_dbg(&client->dev, "only one %s for now\n", 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: static int omap_usbhs_alloc_children(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct usbhs_omap_platform_data *pdata = dev->platform_data; + struct usbhs_omap_platform_data *pdata = dev_get_platdata(dev); struct platform_device *ehci; struct platform_device *ohci; struct resource *res; @@ -571,7 +571,7 @@ static struct of_device_id usbhs_child_match_table[] = { static int usbhs_omap_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct usbhs_omap_platform_data *pdata = dev->platform_data; + struct usbhs_omap_platform_data *pdata = dev_get_platdata(dev); struct usbhs_hcd_omap *omap; struct resource *res; int ret = 0; 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, const struct i2c_device_id *ids) { struct pcf50633 *pcf; - struct pcf50633_platform_data *pdata = client->dev.platform_data; + struct pcf50633_platform_data *pdata = dev_get_platdata(&client->dev); int i, ret; int version, variant; diff --git a/drivers/mfd/pm8921-core.c b/drivers/mfd/pm8921-core.c index ecc137ffa8c3..9be6840e88ee 100644 --- a/drivers/mfd/pm8921-core.c +++ b/drivers/mfd/pm8921-core.c @@ -106,7 +106,7 @@ static int pm8921_add_subdevices(const struct pm8921_platform_data static int pm8921_probe(struct platform_device *pdev) { - const struct pm8921_platform_data *pdata = pdev->dev.platform_data; + const struct pm8921_platform_data *pdata = dev_get_platdata(&pdev->dev); struct pm8921 *pmic; int rc; u8 val; 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, const struct i2c_device_id *id) { struct rc5t583 *rc5t583; - struct rc5t583_platform_data *pdata = i2c->dev.platform_data; + struct rc5t583_platform_data *pdata = dev_get_platdata(&i2c->dev); int ret; bool irq_init_success = false; diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 79c07502db52..86a7d611f71b 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -216,7 +216,7 @@ static inline int sec_i2c_get_driver_data(struct i2c_client *i2c, static int sec_pmic_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { - struct sec_platform_data *pdata = i2c->dev.platform_data; + struct sec_platform_data *pdata = dev_get_platdata(&i2c->dev); const struct regmap_config *regmap; struct sec_pmic_dev *sec_pmic; 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, atomic_set(&core->is_alive, 0); core->power_state = SI476X_POWER_DOWN; - pdata = client->dev.platform_data; + pdata = dev_get_platdata(&client->dev); if (pdata) { memcpy(&core->power_up_parameters, &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) if (!pdev) return -ENOMEM; - uart_data = pdev->dev.platform_data; + uart_data = dev_get_platdata(&pdev->dev); if (devices & SM501_USE_UART0) { sm501_setup_uart_data(sm, uart_data++, 0x30000); @@ -1167,7 +1167,7 @@ static int sm501_register_gpio_i2c_instance(struct sm501_devdata *sm, if (!pdev) return -ENOMEM; - icd = pdev->dev.platform_data; + icd = dev_get_platdata(&pdev->dev); /* We keep the pin_sda and pin_scl fields relative in case the * same platform data is passed to >1 SM501. @@ -1403,7 +1403,7 @@ static int sm501_plat_probe(struct platform_device *dev) sm->dev = &dev->dev; sm->pdev_id = dev->id; - sm->platdata = dev->dev.platform_data; + sm->platdata = dev_get_platdata(&dev->dev); ret = platform_get_irq(dev, 0); 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, void __iomem **regs, spinlock_t **lock) { - struct pci_dev *pdev = *(struct pci_dev **)(dev->dev.platform_data); + struct pci_dev *pdev = *(struct pci_dev **)dev_get_platdata(&dev->dev); struct sta2x11_mfd *mfd; if (!pdev) @@ -312,7 +312,7 @@ static int sta2x11_mfd_platform_probe(struct platform_device *dev, const char *name = sta2x11_mfd_names[index]; struct regmap_config *regmap_config = sta2x11_mfd_regmap_configs[index]; - pdev = dev->dev.platform_data; + pdev = dev_get_platdata(&dev->dev); mfd = sta2x11_mfd_find(*pdev); if (!mfd) return -ENODEV; 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) static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state) { struct t7l66xb *t7l66xb = platform_get_drvdata(dev); - struct t7l66xb_platform_data *pdata = dev->dev.platform_data; + struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev); if (pdata && pdata->suspend) pdata->suspend(dev); @@ -293,7 +293,7 @@ static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state) static int t7l66xb_resume(struct platform_device *dev) { struct t7l66xb *t7l66xb = platform_get_drvdata(dev); - struct t7l66xb_platform_data *pdata = dev->dev.platform_data; + struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev); clk_enable(t7l66xb->clk48m); if (pdata && pdata->resume) @@ -313,7 +313,7 @@ static int t7l66xb_resume(struct platform_device *dev) static int t7l66xb_probe(struct platform_device *dev) { - struct t7l66xb_platform_data *pdata = dev->dev.platform_data; + struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev); struct t7l66xb *t7l66xb; struct resource *iomem, *rscr; int ret; @@ -409,7 +409,7 @@ err_noirq: static int t7l66xb_remove(struct platform_device *dev) { - struct t7l66xb_platform_data *pdata = dev->dev.platform_data; + struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev); struct t7l66xb *t7l66xb = platform_get_drvdata(dev); int ret; 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, static int tc3589x_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { - struct tc3589x_platform_data *pdata = i2c->dev.platform_data; + struct tc3589x_platform_data *pdata = dev_get_platdata(&i2c->dev); struct device_node *np = i2c->dev.of_node; struct tc3589x *tc3589x; 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[] = { static int tc6387xb_suspend(struct platform_device *dev, pm_message_t state) { struct tc6387xb *tc6387xb = platform_get_drvdata(dev); - struct tc6387xb_platform_data *pdata = dev->dev.platform_data; + struct tc6387xb_platform_data *pdata = dev_get_platdata(&dev->dev); if (pdata && pdata->suspend) pdata->suspend(dev); @@ -60,7 +60,7 @@ static int tc6387xb_suspend(struct platform_device *dev, pm_message_t state) static int tc6387xb_resume(struct platform_device *dev) { struct tc6387xb *tc6387xb = platform_get_drvdata(dev); - struct tc6387xb_platform_data *pdata = dev->dev.platform_data; + struct tc6387xb_platform_data *pdata = dev_get_platdata(&dev->dev); clk_enable(tc6387xb->clk32k); if (pdata && pdata->resume) @@ -140,7 +140,7 @@ static struct mfd_cell tc6387xb_cells[] = { static int tc6387xb_probe(struct platform_device *dev) { - struct tc6387xb_platform_data *pdata = dev->dev.platform_data; + struct tc6387xb_platform_data *pdata = dev_get_platdata(&dev->dev); struct resource *iomem, *rscr; struct clk *clk32k; 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) static int tc6393xb_probe(struct platform_device *dev) { - struct tc6393xb_platform_data *tcpd = dev->dev.platform_data; + struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev); struct tc6393xb *tc6393xb; struct resource *iomem, *rscr; int ret, temp; @@ -733,7 +733,7 @@ err_kzalloc: static int tc6393xb_remove(struct platform_device *dev) { - struct tc6393xb_platform_data *tcpd = dev->dev.platform_data; + struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev); struct tc6393xb *tc6393xb = platform_get_drvdata(dev); int ret; @@ -765,7 +765,7 @@ static int tc6393xb_remove(struct platform_device *dev) #ifdef CONFIG_PM static int tc6393xb_suspend(struct platform_device *dev, pm_message_t state) { - struct tc6393xb_platform_data *tcpd = dev->dev.platform_data; + struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev); struct tc6393xb *tc6393xb = platform_get_drvdata(dev); int i, ret; @@ -788,7 +788,7 @@ static int tc6393xb_suspend(struct platform_device *dev, pm_message_t state) static int tc6393xb_resume(struct platform_device *dev) { - struct tc6393xb_platform_data *tcpd = dev->dev.platform_data; + struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev); struct tc6393xb *tc6393xb = platform_get_drvdata(dev); int ret; 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) static int ti_ssp_probe(struct platform_device *pdev) { static struct ti_ssp *ssp; - const struct ti_ssp_data *pdata = pdev->dev.platform_data; + const struct ti_ssp_data *pdata = dev_get_platdata(&pdev->dev); int error = 0, prediv = 0xff, id; unsigned long sysclk; struct device *dev = &pdev->dev; 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, i2c_set_clientdata(client, tps6105x); tps6105x->client = client; - pdata = client->dev.platform_data; + pdata = dev_get_platdata(&client->dev); tps6105x->pdata = pdata; mutex_init(&tps6105x->lock); diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c index da2691f22e11..4d6769268739 100644 --- a/drivers/mfd/tps65010.c +++ b/drivers/mfd/tps65010.c @@ -517,7 +517,7 @@ static struct tps65010 *the_tps; static int __exit tps65010_remove(struct i2c_client *client) { struct tps65010 *tps = i2c_get_clientdata(client); - struct tps65010_board *board = client->dev.platform_data; + struct tps65010_board *board = dev_get_platdata(&client->dev); if (board && board->teardown) { int status = board->teardown(client, board->context); @@ -539,7 +539,7 @@ static int tps65010_probe(struct i2c_client *client, { struct tps65010 *tps; int status; - struct tps65010_board *board = client->dev.platform_data; + struct tps65010_board *board = dev_get_platdata(&client->dev); if (the_tps) { dev_dbg(&client->dev, "only one tps6501x chip allowed\n"); 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); static int tps65090_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { - struct tps65090_platform_data *pdata = client->dev.platform_data; + struct tps65090_platform_data *pdata = dev_get_platdata(&client->dev); int irq_base = 0; struct tps65090 *tps65090; 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) static int tps6586x_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { - struct tps6586x_platform_data *pdata = client->dev.platform_data; + struct tps6586x_platform_data *pdata = dev_get_platdata(&client->dev); struct tps6586x *tps6586x; int ret; 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); int tps65912_device_init(struct tps65912 *tps65912) { - struct tps65912_board *pmic_plat_data = tps65912->dev->platform_data; + struct tps65912_board *pmic_plat_data = dev_get_platdata(tps65912->dev); struct tps65912_platform_data *init_data; int ret, dcdc_avs, value; 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[] = { static int tps80031_probe(struct i2c_client *client, const struct i2c_device_id *id) { - struct tps80031_platform_data *pdata = client->dev.platform_data; + struct tps80031_platform_data *pdata = dev_get_platdata(&client->dev); struct tps80031 *tps80031; int ret; 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) static int twl_probe(struct i2c_client *client, const struct i2c_device_id *id) { - struct twl4030_platform_data *pdata = client->dev.platform_data; + struct twl4030_platform_data *pdata = dev_get_platdata(&client->dev); struct device_node *node = client->dev.of_node; struct platform_device *pdev; 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, static int twl4030_audio_probe(struct platform_device *pdev) { struct twl4030_audio *audio; - struct twl4030_audio_data *pdata = pdev->dev.platform_data; + struct twl4030_audio_data *pdata = dev_get_platdata(&pdev->dev); struct device_node *node = pdev->dev.of_node; struct mfd_cell *cell = NULL; 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) static int twl4030_madc_probe(struct platform_device *pdev) { struct twl4030_madc_data *madc; - struct twl4030_madc_platform_data *pdata = pdev->dev.platform_data; + struct twl4030_madc_platform_data *pdata = dev_get_platdata(&pdev->dev); int ret; u8 regval; diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index a5fd3c738211..275ec5704c71 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -555,7 +555,7 @@ static bool twl4030_power_use_poweroff(struct twl4030_power_data *pdata, int twl4030_power_probe(struct platform_device *pdev) { - struct twl4030_power_data *pdata = pdev->dev.platform_data; + struct twl4030_power_data *pdata = dev_get_platdata(&pdev->dev); struct device_node *node = pdev->dev.of_node; int err = 0; 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) struct ucb1400_ts ucb_ts; struct ucb1400_gpio ucb_gpio; struct snd_ac97 *ac97; - struct ucb1400_pdata *pdata = dev->platform_data; + struct ucb1400_pdata *pdata = dev_get_platdata(dev); memset(&ucb_ts, 0, sizeof(ucb_ts)); memset(&ucb_gpio, 0, sizeof(ucb_gpio)); diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c index 70f02daeb22a..48ad48c2ef25 100644 --- a/drivers/mfd/ucb1x00-core.c +++ b/drivers/mfd/ucb1x00-core.c @@ -671,7 +671,7 @@ void ucb1x00_unregister_driver(struct ucb1x00_driver *drv) static int ucb1x00_suspend(struct device *dev) { - struct ucb1x00_plat_data *pdata = dev->platform_data; + struct ucb1x00_plat_data *pdata = dev_get_platdata(dev); struct ucb1x00 *ucb = dev_get_drvdata(dev); struct ucb1x00_dev *udev; @@ -703,7 +703,7 @@ static int ucb1x00_suspend(struct device *dev) static int ucb1x00_resume(struct device *dev) { - struct ucb1x00_plat_data *pdata = dev->platform_data; + struct ucb1x00_plat_data *pdata = dev_get_platdata(dev); struct ucb1x00 *ucb = dev_get_drvdata(dev); struct ucb1x00_dev *udev; diff --git a/drivers/mfd/wl1273-core.c b/drivers/mfd/wl1273-core.c index edbe6c1b755a..1288e9943f01 100644 --- a/drivers/mfd/wl1273-core.c +++ b/drivers/mfd/wl1273-core.c @@ -185,7 +185,7 @@ static int wl1273_core_remove(struct i2c_client *client) static int wl1273_core_probe(struct i2c_client *client, const struct i2c_device_id *id) { - struct wl1273_fm_platform_data *pdata = client->dev.platform_data; + struct wl1273_fm_platform_data *pdata = dev_get_platdata(&client->dev); struct wl1273_core *core; struct mfd_cell *cell; int children = 0; 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); */ int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq) { - struct wm831x_pdata *pdata = wm831x->dev->platform_data; + struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev); int rev, wm831x_num; enum wm831x_parent parent; 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 = { int wm831x_irq_init(struct wm831x *wm831x, int irq) { - struct wm831x_pdata *pdata = wm831x->dev->platform_data; + struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev); struct irq_domain *domain; int i, ret, irq_base; 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, const struct i2c_device_id *id) { struct wm8350 *wm8350; + struct wm8350_platform_data *pdata = dev_get_platdata(&i2c->dev); int ret = 0; wm8350 = devm_kzalloc(&i2c->dev, sizeof(struct wm8350), GFP_KERNEL); @@ -44,7 +45,7 @@ static int wm8350_i2c_probe(struct i2c_client *i2c, i2c_set_clientdata(i2c, wm8350); wm8350->dev = &i2c->dev; - return wm8350_device_init(wm8350, i2c->irq, i2c->dev.platform_data); + return wm8350_device_init(wm8350, i2c->irq, pdata); } static 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, wm8400->dev = &i2c->dev; i2c_set_clientdata(i2c, wm8400); - ret = wm8400_init(wm8400, i2c->dev.platform_data); + ret = wm8400_init(wm8400, dev_get_platdata(&i2c->dev)); if (ret != 0) goto err; 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) { int ret; unsigned long irqflags; - struct wm8994_pdata *pdata = wm8994->dev->platform_data; + struct wm8994_pdata *pdata = dev_get_platdata(wm8994->dev); if (!wm8994->irq) { dev_warn(wm8994->dev, -- cgit v1.2.3-70-g09d2 From a9c4055da8ee86e96cb34ad754f4f49028c8de4f Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Sun, 28 Jul 2013 15:03:48 +0100 Subject: mfd: stmpe: Staticise stmpe_of_probe() It is only called from this file so there is no need for it to be in the global namespace and cause sparse to warn. Signed-off-by: Mark Brown Signed-off-by: Lee Jones --- drivers/mfd/stmpe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) return ret; } -void stmpe_of_probe(struct stmpe_platform_data *pdata, struct device_node *np) +static void stmpe_of_probe(struct stmpe_platform_data *pdata, + struct device_node *np) { struct device_node *child; -- cgit v1.2.3-70-g09d2 From ed6ccdc67f0722dfe817ebb2e16ccc8d2c30187a Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 1 Aug 2013 11:01:27 +0900 Subject: mfd: max8997: Cast void pointer to data of max8997_pmic_dt_match Casting (void *) data of max8997_pmic_dt_match is necessary, because variable 'data' of struct 'of_device_id' is defined as 'const void *data'. Thus, pointer should be used instead of value. Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/max8997.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c index ae55dd43d09c..15230476dc73 100644 --- a/drivers/mfd/max8997.c +++ b/drivers/mfd/max8997.c @@ -51,7 +51,7 @@ static struct mfd_cell max8997_devs[] = { #ifdef CONFIG_OF static struct of_device_id max8997_pmic_dt_match[] = { - { .compatible = "maxim,max8997-pmic", .data = TYPE_MAX8997 }, + { .compatible = "maxim,max8997-pmic", .data = (void *)TYPE_MAX8997 }, {}, }; #endif -- cgit v1.2.3-70-g09d2 From a1ca138ff05f1f7b5f752fae0df6e34f0f58f16c Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 1 Aug 2013 10:59:11 +0900 Subject: mfd: lpc_ich: Staticize struct 'lpc_chipset_info' 'lpc_chipset_info' is used only in this file. Fix the following sparse warning: drivers/mfd/lpc_ich.c:216:21: warning: symbol 'lpc_chipset_info' was not declared. Should it be static? Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/lpc_ich.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { LPC_COLETO, /* Coleto Creek */ }; -struct lpc_ich_info lpc_chipset_info[] = { +static struct lpc_ich_info lpc_chipset_info[] = { [LPC_ICH] = { .name = "ICH", .iTCO_version = 1, -- cgit v1.2.3-70-g09d2 From fae01582ce9e01283514e00073868635865b8fb4 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Thu, 1 Aug 2013 10:52:55 +0900 Subject: mfd: twl4030-power: Staticize local functions twl4030_power_configure_scripts(), twl4030_power_configure_resources(), twl4030_power_probe() are used only in this file. Fix the following sparse warnings: drivers/mfd/twl4030-power.c:496:5: warning: symbol 'twl4030_power_configure_scripts' was not declared. Should it be static? drivers/mfd/twl4030-power.c:512:5: warning: symbol 'twl4030_power_configure_resources' was not declared. Should it be static? drivers/mfd/twl4030-power.c:556:5: warning: symbol 'twl4030_power_probe' was not declared. Should it be static? Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/twl4030-power.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 275ec5704c71..96162b62f3c0 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -493,7 +493,7 @@ int twl4030_remove_script(u8 flags) return err; } -int twl4030_power_configure_scripts(struct twl4030_power_data *pdata) +static int twl4030_power_configure_scripts(struct twl4030_power_data *pdata) { int err; int i; @@ -509,7 +509,7 @@ int twl4030_power_configure_scripts(struct twl4030_power_data *pdata) return 0; } -int twl4030_power_configure_resources(struct twl4030_power_data *pdata) +static int twl4030_power_configure_resources(struct twl4030_power_data *pdata) { struct twl4030_resconfig *resconfig = pdata->resource_config; int err; @@ -553,7 +553,7 @@ static bool twl4030_power_use_poweroff(struct twl4030_power_data *pdata, return false; } -int twl4030_power_probe(struct platform_device *pdev) +static int twl4030_power_probe(struct platform_device *pdev) { struct twl4030_power_data *pdata = dev_get_platdata(&pdev->dev); struct device_node *node = pdev->dev.of_node; -- cgit v1.2.3-70-g09d2 From 59a9f7a32adf6537b4e4db8ca204eeb77d7a634e Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Fri, 2 Aug 2013 15:01:01 +0900 Subject: mfd: menelaus: Use NULL instead of 0 'mmc_callback_data' and 'vtg' are pointers. Fix the following sparse warning: drivers/mfd/menelaus.c:445:43: warning: Using plain integer as NULL pointer drivers/mfd/menelaus.c:469:20: warning: Using plain integer as NULL pointer Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/menelaus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c index 9b72a44ab60b..f24df8c9b02e 100644 --- a/drivers/mfd/menelaus.c +++ b/drivers/mfd/menelaus.c @@ -442,7 +442,7 @@ void menelaus_unregister_mmc_callback(void) menelaus_remove_irq_work(MENELAUS_MMC_S2D1_IRQ); the_menelaus->mmc_callback = NULL; - the_menelaus->mmc_callback_data = 0; + the_menelaus->mmc_callback_data = NULL; } EXPORT_SYMBOL(menelaus_unregister_mmc_callback); @@ -466,7 +466,7 @@ static int menelaus_set_voltage(const struct menelaus_vtg *vtg, int mV, struct i2c_client *c = the_menelaus->client; mutex_lock(&the_menelaus->lock); - if (vtg == 0) + if (!vtg) goto set_voltage; ret = menelaus_read_reg(vtg->vtg_reg); -- cgit v1.2.3-70-g09d2 From 9924713a77a23b4bc6ac2bc8f31f08a15f0b04e1 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Fri, 2 Aug 2013 14:45:25 +0900 Subject: MFD: ucb1x00-core: Add CONFIG_PM_SLEEP to suspend/resume Add CONFIG_PM_SLEEP to suspend/resume functions to fix the build warnings when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SET_SYSTEM_SLEEP_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/mfd/ucb1x00-core.c:672:12: warning: 'ucb1x00_suspend' defined but not used [-Wunused-function] drivers/mfd/ucb1x00-core.c:704:12: warning: 'ucb1x00_resume' defined but not used [-Wunused-function] Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/ucb1x00-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c index 48ad48c2ef25..b7cf98f75e7c 100644 --- a/drivers/mfd/ucb1x00-core.c +++ b/drivers/mfd/ucb1x00-core.c @@ -669,6 +669,7 @@ void ucb1x00_unregister_driver(struct ucb1x00_driver *drv) mutex_unlock(&ucb1x00_mutex); } +#ifdef CONFIG_PM_SLEEP static int ucb1x00_suspend(struct device *dev) { struct ucb1x00_plat_data *pdata = dev_get_platdata(dev); @@ -736,6 +737,7 @@ static int ucb1x00_resume(struct device *dev) mutex_unlock(&ucb1x00_mutex); return 0; } +#endif static const struct dev_pm_ops ucb1x00_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(ucb1x00_suspend, ucb1x00_resume) -- cgit v1.2.3-70-g09d2 From f28d7ed0a54f593939758bc8d4a61134596094b1 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Fri, 2 Aug 2013 14:20:51 +0900 Subject: mfd: ab8500-gpadc: Add CONFIG_PM_RUNTIME to runtime_suspend/runtime_resume Add CONFIG_PM_RUNTIME to runtime_suspend/runtime_resume functions to fix the build warnings when CONFIG_PM_RUNTIME is not selected. This is because runtime PM callbacks defined by SET_RUNTIME_PM_OPS are only used when the CONFIG_PM_RUNTIME is enabled. drivers/mfd/ab8500-gpadc.c:870:12: warning: 'ab8500_gpadc_runtime_suspend' defined but not used [-Wunused-function] drivers/mfd/ab8500-gpadc.c:878:12: warning: 'ab8500_gpadc_runtime_resume' defined but not used [-Wunused-function] Acked-by: Linus Walleij Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/ab8500-gpadc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c index 7623e9123828..77c616fd3802 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) gpadc->cal_data[ADC_INPUT_VBAT].offset); } +#ifdef CONFIG_PM_RUNTIME static int ab8500_gpadc_runtime_suspend(struct device *dev) { struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); @@ -885,6 +886,7 @@ static int ab8500_gpadc_runtime_resume(struct device *dev) dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret); return ret; } +#endif static int ab8500_gpadc_suspend(struct device *dev) { -- cgit v1.2.3-70-g09d2 From e0e2e6ec5dec3a86697588cc2bea2ce07da28d5b Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Fri, 2 Aug 2013 14:21:26 +0900 Subject: mfd: ab8500-gpadc: Add CONFIG_PM_SLEEP to suspend/resume Add CONFIG_PM_SLEEP to suspend/resume functions to fix the build warnings when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SET_SYSTEM_SLEEP_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/mfd/ab8500-gpadc.c:891:12: warning: 'ab8500_gpadc_suspend' defined but not used [-Wunused-function] drivers/mfd/ab8500-gpadc.c:903:12: warning: 'ab8500_gpadc_resume' defined but not used [-Wunused-function] Acked-by: Linus Walleij Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/ab8500-gpadc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c index 77c616fd3802..36000f920981 100644 --- a/drivers/mfd/ab8500-gpadc.c +++ b/drivers/mfd/ab8500-gpadc.c @@ -888,6 +888,7 @@ static int ab8500_gpadc_runtime_resume(struct device *dev) } #endif +#ifdef CONFIG_PM_SLEEP static int ab8500_gpadc_suspend(struct device *dev) { struct ab8500_gpadc *gpadc = dev_get_drvdata(dev); @@ -915,6 +916,7 @@ static int ab8500_gpadc_resume(struct device *dev) mutex_unlock(&gpadc->ab8500_gpadc_lock); return ret; } +#endif static int ab8500_gpadc_probe(struct platform_device *pdev) { -- cgit v1.2.3-70-g09d2 From e293e847275b2d1a4768ca25f0933a70b2383016 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Tue, 6 Aug 2013 17:18:35 +0100 Subject: mfd: arizona: Move regulator disable to after marking cache only If we disable DCVDD before we mark the cache as cache only, we might attempt to write to the chip whilst it is powered down and lose a write. Signed-off-by: Charles Keepax Signed-off-by: Lee Jones --- drivers/mfd/arizona-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) } } - regulator_disable(arizona->dcvdd); regcache_cache_only(arizona->regmap, true); regcache_mark_dirty(arizona->regmap); + regulator_disable(arizona->dcvdd); return 0; } -- cgit v1.2.3-70-g09d2 From 45491ada9830cd22e386499cbeb7cab2f24a1136 Mon Sep 17 00:00:00 2001 From: Zubair Lutfullah Date: Mon, 5 Aug 2013 20:10:45 +0100 Subject: mfd: ti_am335x_tscadc: Fix spin lock and reg_cache Reg_cache variable is used to lock step enable register from being accessed and written by both TSC and ADC at the same time. However, it isn't updated anywhere in the code at all. If both TSC and ADC are used, eventually 1FFFF is always written enabling all 16 steps uselessly causing a mess. Patch fixes it by correcting the locks and updates the variable by reading the step enable register Signed-off-by: Zubair Lutfullah Signed-off-by: Lee Jones --- drivers/mfd/ti_am335x_tscadc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c index cd74d594c563..9f3f07ad54bd 100644 --- a/drivers/mfd/ti_am335x_tscadc.c +++ b/drivers/mfd/ti_am335x_tscadc.c @@ -57,10 +57,10 @@ EXPORT_SYMBOL_GPL(am335x_tsc_se_update); void am335x_tsc_se_set(struct ti_tscadc_dev *tsadc, u32 val) { spin_lock(&tsadc->reg_lock); + tsadc->reg_se_cache = tscadc_readl(tsadc, REG_SE); tsadc->reg_se_cache |= val; - spin_unlock(&tsadc->reg_lock); - am335x_tsc_se_update(tsadc); + spin_unlock(&tsadc->reg_lock); } EXPORT_SYMBOL_GPL(am335x_tsc_se_set); -- cgit v1.2.3-70-g09d2 From c78d20350d682267ed48c2f907d18f2b413f3c66 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Tue, 6 Aug 2013 16:42:27 +0100 Subject: mfd: wm5110: Mark register containing FLL gains as readable The FLL gains are present on all devices and controlled from common code shared between them. This patch adds these registers into defaults list for wm5110 and marks them as readable. Reported-by: D.J. Barrow Signed-off-by: Charles Keepax Signed-off-by: Lee Jones --- drivers/mfd/wm5110-tables.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c index 2a7972349159..c04324d18426 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[] = { { 0x00000176, 0x0000 }, /* R374 - FLL1 Control 6 */ { 0x00000177, 0x0281 }, /* R375 - FLL1 Loop Filter Test 1 */ { 0x00000178, 0x0000 }, /* R376 - FLL1 NCO Test 0 */ + { 0x00000179, 0x0000 }, /* R376 - FLL1 Control 7 */ { 0x00000181, 0x0000 }, /* R385 - FLL1 Synchroniser 1 */ { 0x00000182, 0x0000 }, /* R386 - FLL1 Synchroniser 2 */ { 0x00000183, 0x0000 }, /* R387 - FLL1 Synchroniser 3 */ { 0x00000184, 0x0000 }, /* R388 - FLL1 Synchroniser 4 */ { 0x00000185, 0x0000 }, /* R389 - FLL1 Synchroniser 5 */ { 0x00000186, 0x0000 }, /* R390 - FLL1 Synchroniser 6 */ + { 0x00000187, 0x0001 }, /* R390 - FLL1 Synchroniser 7 */ { 0x00000189, 0x0000 }, /* R393 - FLL1 Spread Spectrum */ { 0x0000018A, 0x0004 }, /* R394 - FLL1 GPIO Clock */ { 0x00000191, 0x0000 }, /* R401 - FLL2 Control 1 */ @@ -484,12 +486,14 @@ static const struct reg_default wm5110_reg_default[] = { { 0x00000196, 0x0000 }, /* R406 - FLL2 Control 6 */ { 0x00000197, 0x0000 }, /* R407 - FLL2 Loop Filter Test 1 */ { 0x00000198, 0x0000 }, /* R408 - FLL2 NCO Test 0 */ + { 0x00000199, 0x0000 }, /* R408 - FLL2 Control 7 */ { 0x000001A1, 0x0000 }, /* R417 - FLL2 Synchroniser 1 */ { 0x000001A2, 0x0000 }, /* R418 - FLL2 Synchroniser 2 */ { 0x000001A3, 0x0000 }, /* R419 - FLL2 Synchroniser 3 */ { 0x000001A4, 0x0000 }, /* R420 - FLL2 Synchroniser 4 */ { 0x000001A5, 0x0000 }, /* R421 - FLL2 Synchroniser 5 */ { 0x000001A6, 0x0000 }, /* R422 - FLL2 Synchroniser 6 */ + { 0x000001A7, 0x0001 }, /* R422 - FLL2 Synchroniser 7 */ { 0x000001A9, 0x0000 }, /* R425 - FLL2 Spread Spectrum */ { 0x000001AA, 0x0004 }, /* R426 - FLL2 GPIO Clock */ { 0x00000200, 0x0006 }, /* R512 - Mic Charge Pump 1 */ @@ -1392,6 +1396,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg) case ARIZONA_FLL1_CONTROL_4: case ARIZONA_FLL1_CONTROL_5: case ARIZONA_FLL1_CONTROL_6: + case ARIZONA_FLL1_CONTROL_7: case ARIZONA_FLL1_LOOP_FILTER_TEST_1: case ARIZONA_FLL1_NCO_TEST_0: case ARIZONA_FLL1_SYNCHRONISER_1: @@ -1400,6 +1405,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg) case ARIZONA_FLL1_SYNCHRONISER_4: case ARIZONA_FLL1_SYNCHRONISER_5: case ARIZONA_FLL1_SYNCHRONISER_6: + case ARIZONA_FLL1_SYNCHRONISER_7: case ARIZONA_FLL1_SPREAD_SPECTRUM: case ARIZONA_FLL1_GPIO_CLOCK: case ARIZONA_FLL2_CONTROL_1: @@ -1408,6 +1414,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg) case ARIZONA_FLL2_CONTROL_4: case ARIZONA_FLL2_CONTROL_5: case ARIZONA_FLL2_CONTROL_6: + case ARIZONA_FLL2_CONTROL_7: case ARIZONA_FLL2_LOOP_FILTER_TEST_1: case ARIZONA_FLL2_NCO_TEST_0: case ARIZONA_FLL2_SYNCHRONISER_1: @@ -1416,6 +1423,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg) case ARIZONA_FLL2_SYNCHRONISER_4: case ARIZONA_FLL2_SYNCHRONISER_5: case ARIZONA_FLL2_SYNCHRONISER_6: + case ARIZONA_FLL2_SYNCHRONISER_7: case ARIZONA_FLL2_SPREAD_SPECTRUM: case ARIZONA_FLL2_GPIO_CLOCK: case ARIZONA_MIC_CHARGE_PUMP_1: -- cgit v1.2.3-70-g09d2 From acf0be17836c42b5cba25eda42f5eae5d417f318 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Tue, 6 Aug 2013 16:42:28 +0100 Subject: mfd: wm5110: Add mic detect level registers The mic detect level registers are used from common code to configure the button detection code. Add these registers to the defaults list and mark them as readable for wm5110. Signed-off-by: Charles Keepax Signed-off-by: Lee Jones --- drivers/mfd/wm5110-tables.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c index c04324d18426..172e9bfc4fac 100644 --- a/drivers/mfd/wm5110-tables.c +++ b/drivers/mfd/wm5110-tables.c @@ -507,6 +507,10 @@ static const struct reg_default wm5110_reg_default[] = { { 0x0000029C, 0x0000 }, /* R668 - Headphone Detect 2 */ { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ + { 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */ + { 0x000002A7, 0x372C }, /* R679 - Mic Detect Level 2 */ + { 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */ + { 0x000002A9, 0x300A }, /* R681 - Mic Detect Level 4 */ { 0x000002C3, 0x0000 }, /* R707 - Mic noise mix control 1 */ { 0x000002D3, 0x0000 }, /* R723 - Jack detect analogue */ { 0x00000300, 0x0000 }, /* R768 - Input Enables */ @@ -1438,6 +1442,10 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg) case ARIZONA_MIC_DETECT_1: case ARIZONA_MIC_DETECT_2: case ARIZONA_MIC_DETECT_3: + case ARIZONA_MIC_DETECT_LEVEL_1: + case ARIZONA_MIC_DETECT_LEVEL_2: + case ARIZONA_MIC_DETECT_LEVEL_3: + case ARIZONA_MIC_DETECT_LEVEL_4: case ARIZONA_MIC_NOISE_MIX_CONTROL_1: case ARIZONA_JACK_DETECT_ANALOGUE: case ARIZONA_INPUT_ENABLES: -- cgit v1.2.3-70-g09d2 From f5abfaa4396869bac41443dbe9a67dd05a52c283 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Tue, 6 Aug 2013 16:42:29 +0100 Subject: mfd: wm5110: Add missing Mic Detect 3 register into defaults Signed-off-by: Charles Keepax Signed-off-by: Lee Jones --- drivers/mfd/wm5110-tables.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c index 172e9bfc4fac..49032651a545 100644 --- a/drivers/mfd/wm5110-tables.c +++ b/drivers/mfd/wm5110-tables.c @@ -507,6 +507,7 @@ static const struct reg_default wm5110_reg_default[] = { { 0x0000029C, 0x0000 }, /* R668 - Headphone Detect 2 */ { 0x000002A3, 0x1102 }, /* R675 - Mic Detect 1 */ { 0x000002A4, 0x009F }, /* R676 - Mic Detect 2 */ + { 0x000002A5, 0x0000 }, /* R677 - Mic Detect 3 */ { 0x000002A6, 0x3737 }, /* R678 - Mic Detect Level 1 */ { 0x000002A7, 0x372C }, /* R679 - Mic Detect Level 2 */ { 0x000002A8, 0x1422 }, /* R680 - Mic Detect Level 3 */ -- cgit v1.2.3-70-g09d2 From 44955ab50af17ac23ca2c5c17d91eb19daadae8b Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Tue, 6 Aug 2013 16:42:30 +0100 Subject: mfd: wm5110: Set FX_CTRL2 to volatile FX_CTRL2 is a volatile register and should be marked as such, this patch does so. Signed-off-by: Charles Keepax Signed-off-by: Lee Jones --- drivers/mfd/wm5110-tables.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mfd/wm5110-tables.c b/drivers/mfd/wm5110-tables.c index 49032651a545..3113e39b318e 100644 --- a/drivers/mfd/wm5110-tables.c +++ b/drivers/mfd/wm5110-tables.c @@ -2349,6 +2349,7 @@ static bool wm5110_volatile_register(struct device *dev, unsigned int reg) case ARIZONA_IRQ_PIN_STATUS: case ARIZONA_AOD_IRQ1: case ARIZONA_AOD_IRQ2: + case ARIZONA_FX_CTRL2: case ARIZONA_ASRC_STATUS: case ARIZONA_DSP_STATUS: case ARIZONA_DSP1_CONTROL_1: -- cgit v1.2.3-70-g09d2 From 3134bcae4f70d56df31a5b024c54115d4f504727 Mon Sep 17 00:00:00 2001 From: Yadwinder Singh Brar Date: Sun, 7 Jul 2013 17:14:21 +0530 Subject: mfd: sec: Add clock cell for s2mps11 This patch adds clock to list of mfd cells for s2mps11 and DT documentation for clock part. Reviewed-by: Mike Turquette Signed-off-by: Yadwinder Singh Brar Signed-off-by: Lee Jones --- Documentation/devicetree/bindings/mfd/s2mps11.txt | 20 ++++++++++++++++++++ drivers/mfd/sec-core.c | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mfd/s2mps11.txt b/Documentation/devicetree/bindings/mfd/s2mps11.txt index 36e051b223c8..c9332c626021 100644 --- a/Documentation/devicetree/bindings/mfd/s2mps11.txt +++ b/Documentation/devicetree/bindings/mfd/s2mps11.txt @@ -16,6 +16,21 @@ Optional properties: - interrupts: Interrupt specifiers for interrupt sources. Optional nodes: +- clocks: s2mps11 provides three(AP/CP/BT) buffered 32.768 KHz outputs, so to + register these as clocks with common clock framework instantiate a sub-node + named "clocks". It uses the common clock binding documented in : + [Documentation/devicetree/bindings/clock/clock-bindings.txt] + - #clock-cells: should be 1. + + - The following is the list of clocks generated by the controller. Each clock + is assigned an identifier and client nodes use this identifier to specify + the clock which they consume. + Clock ID + ---------------------- + 32KhzAP 0 + 32KhzCP 1 + 32KhzBT 2 + - regulators: The regulators of s2mps11 that have to be instantiated should be included in a sub-node named 'regulators'. Regulator nodes included in this sub-node should be of the format as listed below. @@ -55,6 +70,11 @@ Example: compatible = "samsung,s2mps11-pmic"; reg = <0x66>; + s2m_osc: clocks{ + #clock-cells = 1; + clock-output-names = "xx", "yy", "zz"; + }; + regulators { ldo1_reg: LDO1 { regulator-name = "VDD_ABB_3.3V"; diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 86a7d611f71b..f530e4b73f19 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -61,7 +61,9 @@ static struct mfd_cell s5m8767_devs[] = { static struct mfd_cell s2mps11_devs[] = { { .name = "s2mps11-pmic", - }, + }, { + .name = "s2mps11-clk", + } }; #ifdef CONFIG_OF -- cgit v1.2.3-70-g09d2 From b81eec09a484c588ead035003ce7555ca8a9963a Mon Sep 17 00:00:00 2001 From: Bill Huang Date: Thu, 8 Aug 2013 04:45:05 -0700 Subject: mfd: palmas: Add power off control Hook up "pm_power_off" to palmas power off routine if there is DT property "ti,system-power-controller" defined, so platform which is powered by this regulator can be powered off properly. Acked-by: Nishanth Menon Signed-off-by: Mallikarjun Kasoju Signed-off-by: Bill Huang Signed-off-by: Lee Jones --- .../devicetree/bindings/regulator/palmas-pmic.txt | 5 ++++ drivers/mfd/palmas.c | 33 ++++++++++++++++++++-- include/linux/mfd/palmas.h | 1 + 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/regulator/palmas-pmic.txt b/Documentation/devicetree/bindings/regulator/palmas-pmic.txt index d5a308629c57..02f4c0eb601e 100644 --- a/Documentation/devicetree/bindings/regulator/palmas-pmic.txt +++ b/Documentation/devicetree/bindings/regulator/palmas-pmic.txt @@ -37,6 +37,9 @@ Optional nodes: ti,smps-range - OTP has the wrong range set for the hardware so override 0 - low range, 1 - high range. +- ti,system-power-controller: Telling whether or not this pmic is controlling + the system power. + Example: #include @@ -49,6 +52,8 @@ pmic { ti,ldo6-vibrator; + ti,system-power-controller; + regulators { smps12_reg : smps12 { regulator-name = "smps12"; diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index e4d1c706df8b..220a34d71f8d 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c @@ -229,6 +229,32 @@ static void palmas_dt_to_pdata(struct i2c_client *i2c, PALMAS_POWER_CTRL_ENABLE2_MASK; if (i2c->irq) palmas_set_pdata_irq_flag(i2c, pdata); + + pdata->pm_off = of_property_read_bool(node, + "ti,system-power-controller"); +} + +static struct palmas *palmas_dev; +static void palmas_power_off(void) +{ + unsigned int addr; + int ret, slave; + + if (!palmas_dev) + return; + + slave = PALMAS_BASE_TO_SLAVE(PALMAS_PMU_CONTROL_BASE); + addr = PALMAS_BASE_TO_REG(PALMAS_PMU_CONTROL_BASE, PALMAS_DEV_CTRL); + + ret = regmap_update_bits( + palmas_dev->regmap[slave], + addr, + PALMAS_DEV_CTRL_DEV_ON, + 0); + + if (ret) + pr_err("%s: Unable to write to DEV_CTRL_DEV_ON: %d\n", + __func__, ret); } static unsigned int palmas_features = PALMAS_PMIC_FEATURE_SMPS10_BOOST; @@ -423,10 +449,13 @@ no_irq: */ if (node) { ret = of_platform_populate(node, NULL, NULL, &i2c->dev); - if (ret < 0) + if (ret < 0) { goto err_irq; - else + } else if (pdata->pm_off && !pm_power_off) { + palmas_dev = palmas; + pm_power_off = palmas_power_off; return ret; + } } return ret; diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 1a8dd7afe084..061cce0b119a 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h @@ -258,6 +258,7 @@ struct palmas_platform_data { */ int mux_from_pdata; u8 pad1, pad2; + bool pm_off; struct palmas_pmic_platform_data *pmic_pdata; struct palmas_gpadc_platform_data *gpadc_pdata; -- cgit v1.2.3-70-g09d2 From c1d33b1b188ccf70e5c9526fa293cbc783245eee Mon Sep 17 00:00:00 2001 From: Michael Brunner Date: Fri, 9 Aug 2013 17:33:43 +0200 Subject: mfd: Add support for COMe-bHL6 and COMe-cTH6 to Kontron PLD driver This patch adds DMI system IDs for the new Kontron modules COMe-bHL6 and COMe-cTH6 to the Kontron PLD driver. Acked-by: Kevin Strasser Signed-off-by: Michael Brunner Signed-off-by: Lee Jones --- drivers/mfd/kempld-core.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c index ab36e6ebbf8b..d3e23278d299 100644 --- a/drivers/mfd/kempld-core.c +++ b/drivers/mfd/kempld-core.c @@ -412,6 +412,15 @@ static struct platform_driver kempld_driver = { }; static struct dmi_system_id __initdata kempld_dmi_table[] = { + { + .ident = "BHL6", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), + DMI_MATCH(DMI_BOARD_NAME, "COMe-bHL6"), + }, + .driver_data = (void *)&kempld_platform_data_generic, + .callback = kempld_create_platform_device, + }, { .ident = "CCR2", .matches = { @@ -596,6 +605,15 @@ static struct dmi_system_id __initdata kempld_dmi_table[] = { .driver_data = (void *)&kempld_platform_data_generic, .callback = kempld_create_platform_device, }, + { + .ident = "UTH6", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Kontron"), + DMI_MATCH(DMI_BOARD_NAME, "COMe-cTH6"), + }, + .driver_data = (void *)&kempld_platform_data_generic, + .callback = kempld_create_platform_device, + }, {} }; MODULE_DEVICE_TABLE(dmi, kempld_dmi_table); -- cgit v1.2.3-70-g09d2 From bb3d5934201607d8514c9a481bd68b2bd9e5510d Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 9 Aug 2013 18:25:02 +0100 Subject: mfd: tps65010: Use power efficient workqueue for power polling There is no need to use a per CPU workqueue to poll, especially with the 5s delay used, so allow the scheduler to use any CPU. Signed-off-by: Mark Brown Signed-off-by: Lee Jones --- drivers/mfd/tps65010.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c index 4d6769268739..8114567e0695 100644 --- a/drivers/mfd/tps65010.c +++ b/drivers/mfd/tps65010.c @@ -242,8 +242,8 @@ static int dbg_show(struct seq_file *s, void *_) seq_printf(s, "mask2 %s\n", buf); /* ignore ackint2 */ - schedule_delayed_work(&tps->work, POWER_POLL_DELAY); - + queue_delayed_work(system_power_efficient_wq, &tps->work, + POWER_POLL_DELAY); /* VMAIN voltage, enable lowpower, etc */ value = i2c_smbus_read_byte_data(tps->client, TPS_VDCDC1); @@ -400,7 +400,8 @@ static void tps65010_interrupt(struct tps65010 *tps) && (tps->chgstatus & (TPS_CHG_USB|TPS_CHG_AC))) poll = 1; if (poll) - schedule_delayed_work(&tps->work, POWER_POLL_DELAY); + queue_delayed_work(system_power_efficient_wq, &tps->work, + POWER_POLL_DELAY); /* also potentially gpio-in rise or fall */ } @@ -448,7 +449,7 @@ static irqreturn_t tps65010_irq(int irq, void *_tps) disable_irq_nosync(irq); set_bit(FLAG_IRQ_ENABLE, &tps->flags); - schedule_delayed_work(&tps->work, 0); + queue_delayed_work(system_power_efficient_wq, &tps->work, 0); return IRQ_HANDLED; } @@ -718,7 +719,8 @@ int tps65010_set_vbus_draw(unsigned mA) && test_and_set_bit( FLAG_VBUS_CHANGED, &the_tps->flags)) { /* gadget drivers call this in_irq() */ - schedule_delayed_work(&the_tps->work, 0); + queue_delayed_work(system_power_efficient_wq, &the_tps->work, + 0); } local_irq_restore(flags); -- cgit v1.2.3-70-g09d2 From b018e1361bad361b47294fd09ae1f33f707dd933 Mon Sep 17 00:00:00 2001 From: Benedikt Spranger Date: Tue, 13 Aug 2013 11:08:38 +0200 Subject: mfd: core: Copy DMA mask and params from parent The child device intends to perform DMA operations then it needs a dma mask and params set. This patches copies them from the parent device. Signed-off-by: Benedikt Spranger Signed-off-by: Holger Dengler Signed-off-by: Lee Jones --- drivers/mfd/mfd-core.c | 2 ++ 1 file changed, 2 insertions(+) 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, pdev->dev.parent = parent; pdev->dev.type = &mfd_dev_type; + pdev->dev.dma_mask = parent->dma_mask; + pdev->dev.dma_parms = parent->dma_parms; if (parent->of_node && cell->of_compatible) { for_each_child_of_node(parent->of_node, np) { -- cgit v1.2.3-70-g09d2 From 5d945d94a15435d2a3a3b99e538fc8fc7558afc5 Mon Sep 17 00:00:00 2001 From: Zubair Lutfullah Date: Tue, 13 Aug 2013 17:40:56 +0100 Subject: mfd: ti_am335x_tscadc: Update reg_cache variable in clr function The reg_cache variable should be updated with current steps in the reg_se register. Then the mask should apply and clear the register. Previously, the reg_cache can be an old redundant value that isn't updated. Signed-off-by: Zubair Lutfullah Signed-off-by: Lee Jones --- drivers/mfd/ti_am335x_tscadc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c index 9f3f07ad54bd..baaf5a8123bb 100644 --- a/drivers/mfd/ti_am335x_tscadc.c +++ b/drivers/mfd/ti_am335x_tscadc.c @@ -67,10 +67,10 @@ EXPORT_SYMBOL_GPL(am335x_tsc_se_set); void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val) { spin_lock(&tsadc->reg_lock); + tsadc->reg_se_cache = tscadc_readl(tsadc, REG_SE); tsadc->reg_se_cache &= ~val; - spin_unlock(&tsadc->reg_lock); - am335x_tsc_se_update(tsadc); + spin_unlock(&tsadc->reg_lock); } EXPORT_SYMBOL_GPL(am335x_tsc_se_clr); -- cgit v1.2.3-70-g09d2 From ef310f4bbf3e0a99129e8fa6acc1d45623a4ad68 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 20 Aug 2013 16:01:26 +0900 Subject: mfd: pm8921: Include missing linux/module.h Include in order to fix the following errors. drivers/mfd/pm8921-core.c:209:16: error: expected declaration specifiers or '...' before string constant drivers/mfd/pm8921-core.c:210:20: error: expected declaration specifiers or '...' before string constant drivers/mfd/pm8921-core.c:211:16: error: expected declaration specifiers or '...' before string constant drivers/mfd/pm8921-core.c:212:14: error: expected declaration specifiers or '...' before string constant Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/pm8921-core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mfd/pm8921-core.c b/drivers/mfd/pm8921-core.c index 9be6840e88ee..bd4b37ce254e 100644 --- a/drivers/mfd/pm8921-core.c +++ b/drivers/mfd/pm8921-core.c @@ -14,6 +14,7 @@ #define pr_fmt(fmt) "%s: " fmt, __func__ #include +#include #include #include #include -- cgit v1.2.3-70-g09d2 From 5cddd5de8cc8b3bcf11ecd530f7e0cbcb283d968 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 20 Aug 2013 16:02:05 +0900 Subject: mfd: pm8921: Remove unnecessary platform_set_drvdata() The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/pm8921-core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/mfd/pm8921-core.c b/drivers/mfd/pm8921-core.c index bd4b37ce254e..9a7c991a3826 100644 --- a/drivers/mfd/pm8921-core.c +++ b/drivers/mfd/pm8921-core.c @@ -160,7 +160,6 @@ static int pm8921_probe(struct platform_device *pdev) err: mfd_remove_devices(pmic->dev); - platform_set_drvdata(pdev, NULL); err_read_rev: kfree(pmic); return rc; @@ -180,7 +179,6 @@ static int pm8921_remove(struct platform_device *pdev) pm8xxx_irq_exit(pmic->irq_chip); pmic->irq_chip = NULL; } - platform_set_drvdata(pdev, NULL); kfree(pmic); return 0; -- cgit v1.2.3-70-g09d2 From b2cdcfacfe4bafaaeeba54db5940eef6452d1161 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 20 Aug 2013 16:02:26 +0900 Subject: mfd: pm8921: Use devm_*() functions Use devm_*() functions to make cleanup paths simpler. Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/pm8921-core.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/pm8921-core.c b/drivers/mfd/pm8921-core.c index 9a7c991a3826..a6841f77aa5e 100644 --- a/drivers/mfd/pm8921-core.c +++ b/drivers/mfd/pm8921-core.c @@ -118,7 +118,7 @@ static int pm8921_probe(struct platform_device *pdev) return -EINVAL; } - pmic = kzalloc(sizeof(struct pm8921), GFP_KERNEL); + pmic = devm_kzalloc(&pdev->dev, sizeof(struct pm8921), GFP_KERNEL); if (!pmic) { pr_err("Cannot alloc pm8921 struct\n"); return -ENOMEM; @@ -128,7 +128,7 @@ static int pm8921_probe(struct platform_device *pdev) rc = ssbi_read(pdev->dev.parent, REG_HWREV, &val, sizeof(val)); if (rc) { pr_err("Failed to read hw rev reg %d:rc=%d\n", REG_HWREV, rc); - goto err_read_rev; + return rc; } pr_info("PMIC revision 1: %02X\n", val); rev = val; @@ -138,7 +138,7 @@ static int pm8921_probe(struct platform_device *pdev) if (rc) { pr_err("Failed to read hw rev 2 reg %d:rc=%d\n", REG_HWREV_2, rc); - goto err_read_rev; + return rc; } pr_info("PMIC revision 2: %02X\n", val); rev |= val << BITS_PER_BYTE; @@ -160,8 +160,6 @@ static int pm8921_probe(struct platform_device *pdev) err: mfd_remove_devices(pmic->dev); -err_read_rev: - kfree(pmic); return rc; } @@ -179,7 +177,6 @@ static int pm8921_remove(struct platform_device *pdev) pm8xxx_irq_exit(pmic->irq_chip); pmic->irq_chip = NULL; } - kfree(pmic); return 0; } -- cgit v1.2.3-70-g09d2 From 6922ffcfad1a5ff8cd0e44bbcee3686dd6caf13c Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 20 Aug 2013 16:03:20 +0900 Subject: mfd: max8997: Use devm_*() functions Use devm_*() functions to make cleanup paths simpler. Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/max8997.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c index 15230476dc73..cee098c0dae3 100644 --- a/drivers/mfd/max8997.c +++ b/drivers/mfd/max8997.c @@ -191,7 +191,8 @@ static int max8997_i2c_probe(struct i2c_client *i2c, struct max8997_platform_data *pdata = dev_get_platdata(&i2c->dev); int ret = 0; - max8997 = kzalloc(sizeof(struct max8997_dev), GFP_KERNEL); + max8997 = devm_kzalloc(&i2c->dev, sizeof(struct max8997_dev), + GFP_KERNEL); if (max8997 == NULL) return -ENOMEM; @@ -203,14 +204,12 @@ static int max8997_i2c_probe(struct i2c_client *i2c, if (max8997->dev->of_node) { pdata = max8997_i2c_parse_dt_pdata(max8997->dev); - if (IS_ERR(pdata)) { - ret = PTR_ERR(pdata); - goto err; - } + if (IS_ERR(pdata)) + return PTR_ERR(pdata); } if (!pdata) - goto err; + return ret; max8997->pdata = pdata; max8997->ono = pdata->ono; @@ -250,8 +249,6 @@ err_mfd: i2c_unregister_device(max8997->muic); i2c_unregister_device(max8997->haptic); i2c_unregister_device(max8997->rtc); -err: - kfree(max8997); return ret; } @@ -263,7 +260,6 @@ static int max8997_i2c_remove(struct i2c_client *i2c) i2c_unregister_device(max8997->muic); i2c_unregister_device(max8997->haptic); i2c_unregister_device(max8997->rtc); - kfree(max8997); return 0; } -- cgit v1.2.3-70-g09d2 From 0010dd3883b8a5e99c7d4093b97e9e34300a2f03 Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 20 Aug 2013 16:04:42 +0900 Subject: mfd: max8998: Use devm_*() functions Use devm_*() functions to make cleanup paths simpler. Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/max8998.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c index 45bffb8c7236..fe6332dcabee 100644 --- a/drivers/mfd/max8998.c +++ b/drivers/mfd/max8998.c @@ -188,7 +188,8 @@ static int max8998_i2c_probe(struct i2c_client *i2c, struct max8998_dev *max8998; int ret = 0; - max8998 = kzalloc(sizeof(struct max8998_dev), GFP_KERNEL); + max8998 = devm_kzalloc(&i2c->dev, sizeof(struct max8998_dev), + GFP_KERNEL); if (max8998 == NULL) return -ENOMEM; @@ -246,7 +247,6 @@ err: mfd_remove_devices(max8998->dev); max8998_irq_exit(max8998); i2c_unregister_device(max8998->rtc); - kfree(max8998); return ret; } @@ -257,7 +257,6 @@ static int max8998_i2c_remove(struct i2c_client *i2c) mfd_remove_devices(max8998->dev); max8998_irq_exit(max8998); i2c_unregister_device(max8998->rtc); - kfree(max8998); return 0; } -- cgit v1.2.3-70-g09d2 From 7a4043112778c8ba7169b3006c8b7789213c878a Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 20 Aug 2013 16:05:11 +0900 Subject: mfd: menelaus: Use devm_*() functions Use devm_*() functions to make cleanup paths simpler. Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/menelaus.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/mfd/menelaus.c b/drivers/mfd/menelaus.c index f24df8c9b02e..ad25bfa3fb02 100644 --- a/drivers/mfd/menelaus.c +++ b/drivers/mfd/menelaus.c @@ -1197,7 +1197,7 @@ static int menelaus_probe(struct i2c_client *client, return -ENODEV; } - menelaus = kzalloc(sizeof *menelaus, GFP_KERNEL); + menelaus = devm_kzalloc(&client->dev, sizeof(*menelaus), GFP_KERNEL); if (!menelaus) return -ENOMEM; @@ -1210,8 +1210,7 @@ static int menelaus_probe(struct i2c_client *client, rev = menelaus_read_reg(MENELAUS_REV); if (rev < 0) { pr_err(DRIVER_NAME ": device not found"); - err = -ENODEV; - goto fail1; + return -ENODEV; } /* Ack and disable all Menelaus interrupts */ @@ -1231,7 +1230,7 @@ static int menelaus_probe(struct i2c_client *client, if (err) { dev_dbg(&client->dev, "can't get IRQ %d, err %d\n", client->irq, err); - goto fail1; + return err; } } @@ -1242,7 +1241,7 @@ static int menelaus_probe(struct i2c_client *client, val = menelaus_read_reg(MENELAUS_VCORE_CTRL1); if (val < 0) - goto fail2; + goto fail; if (val & (1 << 7)) menelaus->vcore_hw_mode = 1; else @@ -1251,17 +1250,15 @@ static int menelaus_probe(struct i2c_client *client, if (menelaus_pdata != NULL && menelaus_pdata->late_init != NULL) { err = menelaus_pdata->late_init(&client->dev); if (err < 0) - goto fail2; + goto fail; } menelaus_rtc_init(menelaus); return 0; -fail2: +fail: free_irq(client->irq, menelaus); flush_work(&menelaus->work); -fail1: - kfree(menelaus); return err; } @@ -1271,7 +1268,6 @@ static int __exit menelaus_remove(struct i2c_client *client) free_irq(client->irq, menelaus); flush_work(&menelaus->work); - kfree(menelaus); the_menelaus = NULL; return 0; } -- cgit v1.2.3-70-g09d2 From eac1dcbd3e211998fb8342902b3acee149a9271d Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 20 Aug 2013 16:05:54 +0900 Subject: mfd: tps65010: Use devm_*() functions Use devm_*() functions to make cleanup paths simpler. Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/tps65010.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c index 8114567e0695..743fb524fc8a 100644 --- a/drivers/mfd/tps65010.c +++ b/drivers/mfd/tps65010.c @@ -530,7 +530,6 @@ static int __exit tps65010_remove(struct i2c_client *client) free_irq(client->irq, tps); cancel_delayed_work_sync(&tps->work); debugfs_remove(tps->file); - kfree(tps); the_tps = NULL; return 0; } @@ -550,7 +549,7 @@ static int tps65010_probe(struct i2c_client *client, if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) return -EINVAL; - tps = kzalloc(sizeof *tps, GFP_KERNEL); + tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); if (!tps) return -ENOMEM; @@ -568,7 +567,7 @@ static int tps65010_probe(struct i2c_client *client, if (status < 0) { dev_dbg(&client->dev, "can't get IRQ %d, err %d\n", client->irq, status); - goto fail1; + return status; } /* annoying race here, ideally we'd have an option * to claim the irq now and enable it later. @@ -668,9 +667,6 @@ static int tps65010_probe(struct i2c_client *client, } return 0; -fail1: - kfree(tps); - return status; } static const struct i2c_device_id tps65010_id[] = { -- cgit v1.2.3-70-g09d2 From bba078273e259c7eff729ac00a1476987ad5413a Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 20 Aug 2013 16:06:17 +0900 Subject: mfd: wl1273: Use devm_*() functions Use devm_*() functions to make cleanup paths simpler. Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/wl1273-core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/mfd/wl1273-core.c b/drivers/mfd/wl1273-core.c index 1288e9943f01..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) static int wl1273_core_remove(struct i2c_client *client) { - struct wl1273_core *core = i2c_get_clientdata(client); - dev_dbg(&client->dev, "%s\n", __func__); mfd_remove_devices(&client->dev); - kfree(core); return 0; } @@ -203,7 +200,7 @@ static int wl1273_core_probe(struct i2c_client *client, return -EINVAL; } - core = kzalloc(sizeof(*core), GFP_KERNEL); + core = devm_kzalloc(&client->dev, sizeof(*core), GFP_KERNEL); if (!core) return -ENOMEM; @@ -249,7 +246,6 @@ static int wl1273_core_probe(struct i2c_client *client, err: pdata->free_resources(); - kfree(core); dev_dbg(&client->dev, "%s\n", __func__); -- cgit v1.2.3-70-g09d2 From 8a105ca202b1a1061a24f1e980206cd2808e2f8b Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Tue, 20 Aug 2013 16:05:29 +0900 Subject: mfd: pcf50633-adc: Use devm_*() functions Use devm_*() functions to make cleanup paths simpler. Signed-off-by: Jingoo Han Signed-off-by: Lee Jones --- drivers/mfd/pcf50633-adc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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) { struct pcf50633_adc *adc; - adc = kzalloc(sizeof(*adc), GFP_KERNEL); + adc = devm_kzalloc(&pdev->dev, sizeof(*adc), GFP_KERNEL); if (!adc) return -ENOMEM; @@ -236,7 +236,6 @@ static int pcf50633_adc_remove(struct platform_device *pdev) kfree(adc->queue[i]); mutex_unlock(&adc->queue_mutex); - kfree(adc); return 0; } -- cgit v1.2.3-70-g09d2