Skip to content

Commit

Permalink
mfd: Use platform_device_add_data to set pcf50633 regulator platform …
Browse files Browse the repository at this point in the history
…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 <lars@metafoo.de>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Lars-Peter Clausen authored and Samuel Ortiz committed Dec 13, 2009
1 parent 68d641e commit bbb2e49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/mfd/pcf50633-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit bbb2e49

Please sign in to comment.