Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd285ad7 authored by Guenter Roeck's avatar Guenter Roeck Committed by Guenter Roeck
Browse files

hwmon: (pmbus) Simplify remove functions



Since devm_kzalloc() is now used to allocate driver memory, the client
driver remove function has no purpose other than to call pmbus_do_remove().
This means we can get rid of it by redefining pmbus_do_remove() to use the
same prototype, and pointing to it directly.

Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 8b313ca7
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -301,18 +301,12 @@ static int adm1275_probe(struct i2c_client *client,
	return pmbus_do_probe(client, id, info);
}

static int adm1275_remove(struct i2c_client *client)
{
	pmbus_do_remove(client);
	return 0;
}

static struct i2c_driver adm1275_driver = {
	.driver = {
		   .name = "adm1275",
		   },
	.probe = adm1275_probe,
	.remove = adm1275_remove,
	.remove = pmbus_do_remove,
	.id_table = adm1275_id,
};

+1 −7
Original line number Diff line number Diff line
@@ -295,12 +295,6 @@ static int lm25066_probe(struct i2c_client *client,
	return pmbus_do_probe(client, id, info);
}

static int lm25066_remove(struct i2c_client *client)
{
	pmbus_do_remove(client);
	return 0;
}

static const struct i2c_device_id lm25066_id[] = {
	{"lm25066", lm25066},
	{"lm5064", lm5064},
@@ -316,7 +310,7 @@ static struct i2c_driver lm25066_driver = {
		   .name = "lm25066",
		   },
	.probe = lm25066_probe,
	.remove = lm25066_remove,
	.remove = pmbus_do_remove,
	.id_table = lm25066_id,
};

+1 −7
Original line number Diff line number Diff line
@@ -361,19 +361,13 @@ static int ltc2978_probe(struct i2c_client *client,
	return pmbus_do_probe(client, id, info);
}

static int ltc2978_remove(struct i2c_client *client)
{
	pmbus_do_remove(client);
	return 0;
}

/* This is the driver that will be inserted */
static struct i2c_driver ltc2978_driver = {
	.driver = {
		   .name = "ltc2978",
		   },
	.probe = ltc2978_probe,
	.remove = ltc2978_remove,
	.remove = pmbus_do_remove,
	.id_table = ltc2978_id,
};

+1 −7
Original line number Diff line number Diff line
@@ -103,12 +103,6 @@ static int max16064_probe(struct i2c_client *client,
	return pmbus_do_probe(client, id, &max16064_info);
}

static int max16064_remove(struct i2c_client *client)
{
	pmbus_do_remove(client);
	return 0;
}

static const struct i2c_device_id max16064_id[] = {
	{"max16064", 0},
	{}
@@ -122,7 +116,7 @@ static struct i2c_driver max16064_driver = {
		   .name = "max16064",
		   },
	.probe = max16064_probe,
	.remove = max16064_remove,
	.remove = pmbus_do_remove,
	.id_table = max16064_id,
};

+1 −7
Original line number Diff line number Diff line
@@ -224,12 +224,6 @@ static int max34440_probe(struct i2c_client *client,
	return pmbus_do_probe(client, id, &max34440_info[id->driver_data]);
}

static int max34440_remove(struct i2c_client *client)
{
	pmbus_do_remove(client);
	return 0;
}

static const struct i2c_device_id max34440_id[] = {
	{"max34440", max34440},
	{"max34441", max34441},
@@ -244,7 +238,7 @@ static struct i2c_driver max34440_driver = {
		   .name = "max34440",
		   },
	.probe = max34440_probe,
	.remove = max34440_remove,
	.remove = pmbus_do_remove,
	.id_table = max34440_id,
};

Loading