aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorPaul Fertser <fercerpav@gmail.com>2009-10-17 04:47:35 +0400
committerPaul Fertser <fercerpav@gmail.com>2009-10-17 04:52:57 +0400
commit350d5560bb262e73e1f1c05bf488fea6750a52d6 (patch)
tree46a2abf96452b8c7abcb206dba8176e60083e23e /drivers/mfd
parent3daf677d5e8e4d6a89845952e0a503c4bd57e456 (diff)
Fix memleak in pcf50633_client_dev_registe
Ported from 207ec43e8c5a54dfc82a0e65af5b8f2765e3cbb8
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/pcf50606-adc.c5
-rw-r--r--drivers/mfd/pcf50606-core.c4
2 files changed, 2 insertions, 7 deletions
diff --git a/drivers/mfd/pcf50606-adc.c b/drivers/mfd/pcf50606-adc.c
index 38f5b5c0593..47210a9cce8 100644
--- a/drivers/mfd/pcf50606-adc.c
+++ b/drivers/mfd/pcf50606-adc.c
@@ -211,17 +211,16 @@ static void pcf50606_adc_irq(int irq, void *data)
static int __devinit pcf50606_adc_probe(struct platform_device *pdev)
{
- struct pcf50606_subdev_pdata *pdata = pdev->dev.platform_data;
struct pcf50606_adc *adc;
adc = kzalloc(sizeof(*adc), GFP_KERNEL);
if (!adc)
return -ENOMEM;
- adc->pcf = pdata->pcf;
+ adc->pcf = dev_to_pcf50606(pdev->dev.parent);
platform_set_drvdata(pdev, adc);
- pcf50606_register_irq(pdata->pcf, PCF50606_IRQ_ADCRDY,
+ pcf50606_register_irq(adc->pcf, PCF50606_IRQ_ADCRDY,
pcf50606_adc_irq, adc);
mutex_init(&adc->queue_mutex);
diff --git a/drivers/mfd/pcf50606-core.c b/drivers/mfd/pcf50606-core.c
index 355a7fc7476..a6ff522931d 100644
--- a/drivers/mfd/pcf50606-core.c
+++ b/drivers/mfd/pcf50606-core.c
@@ -436,7 +436,6 @@ static void
pcf50606_client_dev_register(struct pcf50606 *pcf, const char *name,
struct platform_device **pdev)
{
- struct pcf50606_subdev_pdata subdev_pdata;
int ret;
*pdev = platform_device_alloc(name, -1);
@@ -445,9 +444,6 @@ pcf50606_client_dev_register(struct pcf50606 *pcf, const char *name,
return;
}
- subdev_pdata.pcf = pcf;
- platform_device_add_data(*pdev, &subdev_pdata, sizeof(subdev_pdata));
-
(*pdev)->dev.parent = pcf->dev;
ret = platform_device_add(*pdev);