bus: subsys: update return type of ->remove_dev() to void
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 30 Jul 2015 09:34:01 +0000 (15:04 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Aug 2015 00:08:14 +0000 (17:08 -0700)
Its return value is not used by the subsys core and nothing meaningful
can be done with it, even if we want to use it. The subsys device is
anyway getting removed.

Update prototype of ->remove_dev() to make its return type as void. Fix
all usage sites as well.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/sh/kernel/cpu/sh4/sq.c
arch/tile/kernel/sysfs.c
arch/x86/kernel/cpu/microcode/core.c
drivers/cpufreq/cpufreq.c
drivers/net/rionet.c
include/linux/device.h

index 0a47bd3e7bee1b20e94fa64a323319ae4dc26a54..4ca78ed71ad2c8ff33707fb8a472d55b553de36e 100644 (file)
@@ -355,13 +355,12 @@ static int sq_dev_add(struct device *dev, struct subsys_interface *sif)
        return error;
 }
 
-static int sq_dev_remove(struct device *dev, struct subsys_interface *sif)
+static void sq_dev_remove(struct device *dev, struct subsys_interface *sif)
 {
        unsigned int cpu = dev->id;
        struct kobject *kobj = sq_kobject[cpu];
 
        kobject_put(kobj);
-       return 0;
 }
 
 static struct subsys_interface sq_interface = {
index a3ed12f8f83bf2c894e3b6eedf8e250a9e7f8312..825867c5385304e3816a7b88f042330522c89443 100644 (file)
@@ -198,16 +198,13 @@ static int hv_stats_device_add(struct device *dev, struct subsys_interface *sif)
        return err;
 }
 
-static int hv_stats_device_remove(struct device *dev,
-                                 struct subsys_interface *sif)
+static void hv_stats_device_remove(struct device *dev,
+                                  struct subsys_interface *sif)
 {
        int cpu = dev->id;
 
-       if (!cpu_online(cpu))
-               return 0;
-
-       sysfs_remove_file(&dev->kobj, &dev_attr_hv_stats.attr);
-       return 0;
+       if (cpu_online(cpu))
+               sysfs_remove_file(&dev->kobj, &dev_attr_hv_stats.attr);
 }
 
 
index 6236a54a63f449ce2ea824be13a3bcca2f57e4b9..3c986390058a555472ddd5486fe353fd59a89ec7 100644 (file)
@@ -377,17 +377,16 @@ static int mc_device_add(struct device *dev, struct subsys_interface *sif)
        return err;
 }
 
-static int mc_device_remove(struct device *dev, struct subsys_interface *sif)
+static void mc_device_remove(struct device *dev, struct subsys_interface *sif)
 {
        int cpu = dev->id;
 
        if (!cpu_online(cpu))
-               return 0;
+               return;
 
        pr_debug("CPU%d removed\n", cpu);
        microcode_fini_cpu(cpu);
        sysfs_remove_group(&dev->kobj, &mc_attr_group);
-       return 0;
 }
 
 static struct subsys_interface mc_cpu_interface = {
index 26063afb3eba41a88f68e753689b05f741f82d36..6da25c10bdfd22187325175dcef162b7b16b0cf1 100644 (file)
@@ -1518,7 +1518,7 @@ static int __cpufreq_remove_dev_finish(struct device *dev,
  *
  * Removes the cpufreq interface for a CPU device.
  */
-static int cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif)
+static void cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif)
 {
        unsigned int cpu = dev->id;
        int ret;
@@ -1533,7 +1533,7 @@ static int cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif)
                struct cpumask mask;
 
                if (!policy)
-                       return 0;
+                       return;
 
                cpumask_copy(&mask, policy->related_cpus);
                cpumask_clear_cpu(cpu, &mask);
@@ -1544,19 +1544,17 @@ static int cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif)
                 */
                if (cpumask_intersects(&mask, cpu_present_mask)) {
                        remove_cpu_dev_symlink(policy, cpu);
-                       return 0;
+                       return;
                }
 
                cpufreq_policy_free(policy, true);
-               return 0;
+               return;
        }
 
        ret = __cpufreq_remove_dev_prepare(dev, sif);
 
        if (!ret)
-               ret = __cpufreq_remove_dev_finish(dev, sif);
-
-       return ret;
+               __cpufreq_remove_dev_finish(dev, sif);
 }
 
 static void handle_update(struct work_struct *work)
index dac7a0d9bb46e5d9d2385250f990a2a0acf5996c..01f08a7751f7aeb9c39be52a7766ec2800885fc8 100644 (file)
@@ -396,7 +396,7 @@ static int rionet_close(struct net_device *ndev)
        return 0;
 }
 
-static int rionet_remove_dev(struct device *dev, struct subsys_interface *sif)
+static void rionet_remove_dev(struct device *dev, struct subsys_interface *sif)
 {
        struct rio_dev *rdev = to_rio_dev(dev);
        unsigned char netid = rdev->net->hport->id;
@@ -416,8 +416,6 @@ static int rionet_remove_dev(struct device *dev, struct subsys_interface *sif)
                        }
                }
        }
-
-       return 0;
 }
 
 static void rionet_get_drvinfo(struct net_device *ndev,
index a2b4ea70a9467520d93a556190ca8995183e4af9..1225f98e9240226ff7685190aef463b8d640a6e0 100644 (file)
@@ -341,7 +341,7 @@ struct subsys_interface {
        struct bus_type *subsys;
        struct list_head node;
        int (*add_dev)(struct device *dev, struct subsys_interface *sif);
-       int (*remove_dev)(struct device *dev, struct subsys_interface *sif);
+       void (*remove_dev)(struct device *dev, struct subsys_interface *sif);
 };
 
 int subsys_interface_register(struct subsys_interface *sif);
This page took 0.031621 seconds and 5 git commands to generate.