From 6951569521d0890bbaf7c9d2a4995e64bc8dcfa3 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Thu, 8 Oct 2009 19:03:59 +0200 Subject: mfd: pcf50633: Use platform_device_add_data to set 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 --- drivers/mfd/pcf50633-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c index ea226dbd598..7d35282d6da 100644 --- a/drivers/mfd/pcf50633-core.c +++ b/drivers/mfd/pcf50633-core.c @@ -630,7 +630,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; -- cgit v1.2.3