path: root/drivers/visorbus
diff options
authorSuzuki K Poulose <>2019-06-14 18:53:59 +0100
committerGreg Kroah-Hartman <>2019-06-24 05:22:31 +0200
commit418e3ea157efb0eb2c6dd412a8d5f052477c7f5a (patch)
tree1c8412f0b9adce1c72806e3e2c61a84c26752a17 /drivers/visorbus
parente6374f6b2e9c9f9a7cf5418157ad7f30f3abd70e (diff)
bus_find_device: Unify the match callback with class_find_device
There is an arbitrary difference between the prototypes of bus_find_device() and class_find_device() preventing their callers from passing the same pair of data and match() arguments to both of them, which is the const qualifier used in the prototype of class_find_device(). If that qualifier is also used in the bus_find_device() prototype, it will be possible to pass the same match() callback function to both bus_find_device() and class_find_device(), which will allow some optimizations to be made in order to avoid code duplication going forward. Also with that, constify the "data" parameter as it is passed as a const to the match function. For this reason, change the prototype of bus_find_device() to match the prototype of class_find_device() and adjust its callers to use the const qualifier in accordance with the new prototype of it. Cc: Alexander Shishkin <> Cc: Andrew Lunn <> Cc: Andreas Noever <> Cc: Arnd Bergmann <> Cc: Bjorn Helgaas <> Cc: Corey Minyard <> Cc: Christian Borntraeger <> Cc: David Kershner <> Cc: "David S. Miller" <> Cc: David Airlie <> Cc: Felipe Balbi <> Cc: Frank Rowand <> Cc: Grygorii Strashko <> Cc: Harald Freudenberger <> Cc: Hartmut Knaack <> Cc: Heiko Stuebner <> Cc: Jason Gunthorpe <> Cc: Jonathan Cameron <> Cc: "James E.J. Bottomley" <> Cc: Len Brown <> Cc: Mark Brown <> Cc: Michael Ellerman <> Cc: Michael Jamet <> Cc: "Martin K. Petersen" <> Cc: Peter Oberparleiter <> Cc: Sebastian Ott <> Cc: Srinivas Kandagatla <> Cc: Yehezkel Bernat <> Cc: Acked-by: Corey Minyard <> Acked-by: David Kershner <> Acked-by: Mark Brown <> Acked-by: Rafael J. Wysocki <> Acked-by: Srinivas Kandagatla <> Acked-by: Wolfram Sang <> # for the I2C parts Acked-by: Rob Herring <> Signed-off-by: Suzuki K Poulose <> Signed-off-by: Greg Kroah-Hartman <>
Diffstat (limited to 'drivers/visorbus')
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/visorbus/visorbus_main.c b/drivers/visorbus/visorbus_main.c
index 0b2434cc4ecd..152fd29f04f2 100644
--- a/drivers/visorbus/visorbus_main.c
+++ b/drivers/visorbus/visorbus_main.c
@@ -171,10 +171,10 @@ struct visor_busdev {
u32 dev_no;
-static int match_visorbus_dev_by_id(struct device *dev, void *data)
+static int match_visorbus_dev_by_id(struct device *dev, const void *data)
struct visor_device *vdev = to_visor_device(dev);
- struct visor_busdev *id = data;
+ const struct visor_busdev *id = data;
if (vdev->chipset_bus_no == id->bus_no &&
vdev->chipset_dev_no == id->dev_no)