]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
hwmon: (pmbus) Simplify remove functions
authorGuenter Roeck <linux@roeck-us.net>
Wed, 22 Feb 2012 16:56:44 +0000 (08:56 -0800)
committerGuenter Roeck <guenter.roeck@ericsson.com>
Mon, 19 Mar 2012 01:27:46 +0000 (18:27 -0700)
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: Guenter Roeck <linux@roeck-us.net>
12 files changed:
drivers/hwmon/pmbus/adm1275.c
drivers/hwmon/pmbus/lm25066.c
drivers/hwmon/pmbus/ltc2978.c
drivers/hwmon/pmbus/max16064.c
drivers/hwmon/pmbus/max34440.c
drivers/hwmon/pmbus/max8688.c
drivers/hwmon/pmbus/pmbus.c
drivers/hwmon/pmbus/pmbus.h
drivers/hwmon/pmbus/pmbus_core.c
drivers/hwmon/pmbus/ucd9000.c
drivers/hwmon/pmbus/ucd9200.c
drivers/hwmon/pmbus/zl6100.c

index f81cb4adaebab72a79104b29107acf2cc18274be..5e4421e57eb007c5a211b93ffa58b671cd80e643 100644 (file)
@@ -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,
 };
 
index e70d4ca14fbe5bd46a9857507b68b644bfc3d071..c299392716af2c02dd503a797112e03a01f489c7 100644 (file)
@@ -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,
 };
 
index 5e07a363b3e9f8dda18eb6d5c7ba9e05a1e93bc6..9652a2c92a24ddfa00d4100584093da96b6821fe 100644 (file)
@@ -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,
 };
 
index 5cfe20f1e03003082ddcf4f88afacbee67556a77..fa237a3c3291cee1fc5bcd9aa4eb408067d1ba4e 100644 (file)
@@ -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,
 };
 
index d9026f9ff13e16046fa0006b528352148efc78cc..7d830c1e70327f05c3ded0dd655ba88e53de9e72 100644 (file)
@@ -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,
 };
 
index 82c598d7cfa3efde37b101e9af155caefa8c3f3c..f04454a42fdd2ec68395535ae3553e86e849bc3e 100644 (file)
@@ -180,12 +180,6 @@ static int max8688_probe(struct i2c_client *client,
        return pmbus_do_probe(client, id, &max8688_info);
 }
 
-static int max8688_remove(struct i2c_client *client)
-{
-       pmbus_do_remove(client);
-       return 0;
-}
-
 static const struct i2c_device_id max8688_id[] = {
        {"max8688", 0},
        { }
@@ -199,7 +193,7 @@ static struct i2c_driver max8688_driver = {
                   .name = "max8688",
                   },
        .probe = max8688_probe,
-       .remove = max8688_remove,
+       .remove = pmbus_do_remove,
        .id_table = max8688_id,
 };
 
index b94bec23d95ca3b9f213f706f7ff841c924e0687..34887408505bc058f6313c66ada96900301d515a 100644 (file)
@@ -178,12 +178,6 @@ static int pmbus_probe(struct i2c_client *client,
        return pmbus_do_probe(client, id, info);
 }
 
-static int pmbus_remove(struct i2c_client *client)
-{
-       pmbus_do_remove(client);
-       return 0;
-}
-
 /*
  * Use driver_data to set the number of pages supported by the chip.
  */
@@ -209,7 +203,7 @@ static struct i2c_driver pmbus_driver = {
                   .name = "pmbus",
                   },
        .probe = pmbus_probe,
-       .remove = pmbus_remove,
+       .remove = pmbus_do_remove,
        .id_table = pmbus_id,
 };
 
index 5d31d1c2c0f5c3e9312d934e034d170a9b423873..0b17d4f20f813f97755a3d3ad61c85ec8786c1e0 100644 (file)
@@ -364,7 +364,7 @@ bool pmbus_check_byte_register(struct i2c_client *client, int page, int reg);
 bool pmbus_check_word_register(struct i2c_client *client, int page, int reg);
 int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id,
                   struct pmbus_driver_info *info);
-void pmbus_do_remove(struct i2c_client *client);
+int pmbus_do_remove(struct i2c_client *client);
 const struct pmbus_driver_info *pmbus_get_driver_info(struct i2c_client
                                                      *client);
 
index 26b6542a90cd55d35801f40664dfb7ec0012f29f..aada0c67a91176c026d250efe7242c64f5266305 100644 (file)
@@ -1778,11 +1778,12 @@ out_hwmon_device_register:
 }
 EXPORT_SYMBOL_GPL(pmbus_do_probe);
 
-void pmbus_do_remove(struct i2c_client *client)
+int pmbus_do_remove(struct i2c_client *client)
 {
        struct pmbus_data *data = i2c_get_clientdata(client);
        hwmon_device_unregister(data->hwmon_dev);
        sysfs_remove_group(&client->dev.kobj, &data->group);
+       return 0;
 }
 EXPORT_SYMBOL_GPL(pmbus_do_remove);
 
index e0573459447cc3b256ab87b91f0042a311e51b25..fbb1479d3ad453f852c44d1bf02477ac89e67f61 100644 (file)
@@ -229,20 +229,13 @@ static int ucd9000_probe(struct i2c_client *client,
        return pmbus_do_probe(client, mid, info);
 }
 
-static int ucd9000_remove(struct i2c_client *client)
-{
-       pmbus_do_remove(client);
-       return 0;
-}
-
-
 /* This is the driver that will be inserted */
 static struct i2c_driver ucd9000_driver = {
        .driver = {
                .name = "ucd9000",
        },
        .probe = ucd9000_probe,
-       .remove = ucd9000_remove,
+       .remove = pmbus_do_remove,
        .id_table = ucd9000_id,
 };
 
index c0d41b993a53c2f70ad851250102af1c57011e27..033d6aca47d3c2d7194ec9e935bfaa135f7778db 100644 (file)
@@ -163,20 +163,13 @@ static int ucd9200_probe(struct i2c_client *client,
        return pmbus_do_probe(client, mid, info);
 }
 
-static int ucd9200_remove(struct i2c_client *client)
-{
-       pmbus_do_remove(client);
-       return 0;
-}
-
-
 /* This is the driver that will be inserted */
 static struct i2c_driver ucd9200_driver = {
        .driver = {
                .name = "ucd9200",
        },
        .probe = ucd9200_probe,
-       .remove = ucd9200_remove,
+       .remove = pmbus_do_remove,
        .id_table = ucd9200_id,
 };
 
index 9d3b84535e73b3a736f071b0b7bcedfe1326f567..e5bb7355d4802cc5d0dd03d6f1e7942952469602 100644 (file)
@@ -240,18 +240,12 @@ static int zl6100_probe(struct i2c_client *client,
        return pmbus_do_probe(client, mid, info);
 }
 
-static int zl6100_remove(struct i2c_client *client)
-{
-       pmbus_do_remove(client);
-       return 0;
-}
-
 static struct i2c_driver zl6100_driver = {
        .driver = {
                   .name = "zl6100",
                   },
        .probe = zl6100_probe,
-       .remove = zl6100_remove,
+       .remove = pmbus_do_remove,
        .id_table = zl6100_id,
 };