[pkg-fso-commits] [SCM] linux-2.6-openmoko, the Linux 2.6 kernel tree from Openmoko branch, andy-tracking, updated. upstream/20090303.gitb9de904e-140-g23b564c

Werner Almesberger werner at openmoko.org
Mon Jun 8 17:29:52 UTC 2009


The following commit has been merged in the andy-tracking branch:
commit 08157c132e35e48b55f735b607ec51379e05bc53
Author: tim.niemeyer at mastersword.de <tim.niemeyer at mastersword.de>
Date:   Tue Mar 24 11:11:20 2009 +0100

    Clean up pcf50606_client_dev_register
    
    platform_device_add_data copies the data, so no need for
    kmalloc.
    
    Signed-off-by: Tim Niemeyer <reddog at mastersword.de>

diff --git a/drivers/mfd/pcf50606-core.c b/drivers/mfd/pcf50606-core.c
index 994d6f4..9d0bdae 100644
--- a/drivers/mfd/pcf50606-core.c
+++ b/drivers/mfd/pcf50606-core.c
@@ -436,7 +436,7 @@ static void
 pcf50606_client_dev_register(struct pcf50606 *pcf, const char *name,
 						struct platform_device **pdev)
 {
-	struct pcf50606_subdev_pdata *subdev_pdata;
+	struct pcf50606_subdev_pdata subdev_pdata;
 	int ret;
 
 	*pdev = platform_device_alloc(name, -1);
@@ -445,14 +445,8 @@ pcf50606_client_dev_register(struct pcf50606 *pcf, const char *name,
 		return;
 	}
 
-	subdev_pdata = kmalloc(sizeof(*subdev_pdata), GFP_KERNEL);
-	if (!subdev_pdata) {
-		dev_err(pcf->dev, "Error allocating subdev pdata\n");
-		platform_device_put(*pdev);
-	}
-
-	subdev_pdata->pcf = pcf;
-	platform_device_add_data(*pdev, subdev_pdata, sizeof(*subdev_pdata));
+	subdev_pdata.pcf = pcf;
+	platform_device_add_data(*pdev, &subdev_pdata, sizeof(subdev_pdata));
 
 	(*pdev)->dev.parent = pcf->dev;
 

-- 
linux-2.6-openmoko, the Linux 2.6 kernel tree from Openmoko



More information about the pkg-fso-commits mailing list