Re: [patch] Disable PMBus status check for DPS400 PSU controller

From: Guenter Roeck
Date: Thu Jul 21 2016 - 10:31:50 EST


On 07/21/2016 07:08 AM, Vadim Pasternak wrote:

[ ... ]

};

diff --git a/drivers/hwmon/pmbus/pmbus_core.c
b/drivers/hwmon/pmbus/pmbus_core.c
index ba59eae..3d98070 100644
--- a/drivers/hwmon/pmbus/pmbus_core.c
+++ b/drivers/hwmon/pmbus/pmbus_core.c
@@ -1931,8 +1931,11 @@ EXPORT_SYMBOL_GPL(pmbus_do_probe);
int pmbus_do_remove(struct i2c_client *client)
{
struct pmbus_data *data = i2c_get_clientdata(client);
+ const struct pmbus_platform_data *pdata =
+ dev_get_platdata(&client->dev);
hwmon_device_unregister(data->hwmon_dev);
kfree(data->group.attrs);
+ kfree(pdata);

So, if I use in allocation
pdata = devm_kzalloc(&client->dev,
sizeof(struct pmbus_platform_data),
GFP_KERNEL);
I also can drop the above three lines, right?


Correct.

Guenter