提交 bbb2e496 编写于 作者: L Lars-Peter Clausen 提交者: Samuel Ortiz

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: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NPaul Fertser <fercerpav@gmail.com>
Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
上级 68d641ef
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册