aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/pcf50633-adc.c5
-rw-r--r--drivers/mfd/pcf50633-core.c10
2 files changed, 2 insertions, 13 deletions
diff --git a/drivers/mfd/pcf50633-adc.c b/drivers/mfd/pcf50633-adc.c
index 3d31e97d6a45..6d2e8466df1d 100644
--- a/drivers/mfd/pcf50633-adc.c
+++ b/drivers/mfd/pcf50633-adc.c
@@ -209,17 +209,16 @@ static void pcf50633_adc_irq(int irq, void *data)
209 209
210static int __devinit pcf50633_adc_probe(struct platform_device *pdev) 210static int __devinit pcf50633_adc_probe(struct platform_device *pdev)
211{ 211{
212 struct pcf50633_subdev_pdata *pdata = pdev->dev.platform_data;
213 struct pcf50633_adc *adc; 212 struct pcf50633_adc *adc;
214 213
215 adc = kzalloc(sizeof(*adc), GFP_KERNEL); 214 adc = kzalloc(sizeof(*adc), GFP_KERNEL);
216 if (!adc) 215 if (!adc)
217 return -ENOMEM; 216 return -ENOMEM;
218 217
219 adc->pcf = pdata->pcf; 218 adc->pcf = dev_to_pcf50633(pdev->dev.parent);
220 platform_set_drvdata(pdev, adc); 219 platform_set_drvdata(pdev, adc);
221 220
222 pcf50633_register_irq(pdata->pcf, PCF50633_IRQ_ADCRDY, 221 pcf50633_register_irq(adc->pcf, PCF50633_IRQ_ADCRDY,
223 pcf50633_adc_irq, adc); 222 pcf50633_adc_irq, adc);
224 223
225 mutex_init(&adc->queue_mutex); 224 mutex_init(&adc->queue_mutex);
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index 48776d3018ed..69cdbdcd2e82 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -456,7 +456,6 @@ static void
456pcf50633_client_dev_register(struct pcf50633 *pcf, const char *name, 456pcf50633_client_dev_register(struct pcf50633 *pcf, const char *name,
457 struct platform_device **pdev) 457 struct platform_device **pdev)
458{ 458{
459 struct pcf50633_subdev_pdata *subdev_pdata;
460 int ret; 459 int ret;
461 460
462 *pdev = platform_device_alloc(name, -1); 461 *pdev = platform_device_alloc(name, -1);
@@ -465,15 +464,6 @@ pcf50633_client_dev_register(struct pcf50633 *pcf, const char *name,
465 return; 464 return;
466 } 465 }
467 466
468 subdev_pdata = kmalloc(sizeof(*subdev_pdata), GFP_KERNEL);
469 if (!subdev_pdata) {
470 dev_err(pcf->dev, "Error allocating subdev pdata\n");
471 platform_device_put(*pdev);
472 }
473
474 subdev_pdata->pcf = pcf;
475 platform_device_add_data(*pdev, subdev_pdata, sizeof(*subdev_pdata));
476
477 (*pdev)->dev.parent = pcf->dev; 467 (*pdev)->dev.parent = pcf->dev;
478 468
479 ret = platform_device_add(*pdev); 469 ret = platform_device_add(*pdev);