From: Lars-Peter Clausen Date: Tue, 13 Oct 2009 22:12:35 +0000 (+0400) Subject: mfd: Use platform_device_add_data to set pcf50633 regulator platform data X-Git-Tag: v2.6.33-rc1~285^2~38 X-Git-Url: http://ftp.safe.ca/?a=commitdiff_plain;h=bbb2e496f72d34a2e8f839456b1e324455b35123;hp=68d641efd86d901d000b888eeab5481257d49f12;p=safe%2Fjmp%2Flinux-2.6 mfd: Use platform_device_add_data to set pcf50633 regulator platform data Platform devices allocated with platform_device_alloc should use platform_device_add_data to set the platform data, because kfree will be called on the platform_data when the device is released. Signed-off-by: Lars-Peter Clausen Signed-off-by: Paul Fertser Signed-off-by: Samuel Ortiz --- diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index 69cdbdc..1774f60 100644 --- a/drivers/mfd/pcf50633-core.c +++ b/drivers/mfd/pcf50633-core.c @@ -611,7 +611,8 @@ static int __devinit pcf50633_probe(struct i2c_client *client, } pdev->dev.parent = pcf->dev; - pdev->dev.platform_data = &pdata->reg_init_data[i]; + platform_device_add_data(pdev, &pdata->reg_init_data[i], + sizeof(pdata->reg_init_data[i])); dev_set_drvdata(&pdev->dev, pcf); pcf->regulator_pdev[i] = pdev;