From 350d5560bb262e73e1f1c05bf488fea6750a52d6 Mon Sep 17 00:00:00 2001 From: Paul Fertser Date: Sat, 17 Oct 2009 04:47:35 +0400 Subject: Fix memleak in pcf50633_client_dev_registe Ported from 207ec43e8c5a54dfc82a0e65af5b8f2765e3cbb8 --- drivers/mfd/pcf50606-adc.c | 5 ++--- drivers/mfd/pcf50606-core.c | 4 ---- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'drivers/mfd') 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); -- cgit v1.2.3