bus_find_device: Unify the match callback with class_find_device
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Fri, 14 Jun 2019 17:53:59 +0000 (18:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Jun 2019 03:22:31 +0000 (05:22 +0200)
commit418e3ea157efb0eb2c6dd412a8d5f052477c7f5a
tree1c8412f0b9adce1c72806e3e2c61a84c26752a17
parente6374f6b2e9c9f9a7cf5418157ad7f30f3abd70e
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 <alexander.shishkin@linux.intel.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Andreas Noever <andreas.noever@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Corey Minyard <minyard@acm.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: David Kershner <david.kershner@unisys.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: David Airlie <airlied@linux.ie>
Cc: Felipe Balbi <balbi@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Harald Freudenberger <freude@linux.ibm.com>
Cc: Hartmut Knaack <knaack.h@gmx.de>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michael Jamet <michael.jamet@intel.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
Cc: Sebastian Ott <sebott@linux.ibm.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Yehezkel Bernat <YehezkelShB@gmail.com>
Cc: rafael@kernel.org
Acked-by: Corey Minyard <minyard@acm.org>
Acked-by: David Kershner <david.kershner@unisys.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Wolfram Sang <wsa@the-dreams.de> # for the I2C parts
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
39 files changed:
arch/powerpc/platforms/pseries/ibmebus.c
drivers/acpi/acpi_lpss.c
drivers/acpi/sleep.c
drivers/acpi/utils.c
drivers/base/bus.c
drivers/base/devcon.c
drivers/char/ipmi/ipmi_si_platform.c
drivers/firmware/efi/dev-path-parser.c
drivers/gpu/drm/drm_mipi_dsi.c
drivers/hwtracing/coresight/coresight.c
drivers/hwtracing/coresight/of_coresight.c
drivers/hwtracing/intel_th/core.c
drivers/i2c/i2c-core-acpi.c
drivers/i2c/i2c-core-of.c
drivers/iio/inkern.c
drivers/infiniband/hw/hns/hns_roce_hw_v1.c
drivers/net/ethernet/hisilicon/hns/hns_dsaf_misc.c
drivers/net/ethernet/ti/cpsw-phy-sel.c
drivers/net/ethernet/ti/davinci_emac.c
drivers/net/ethernet/toshiba/tc35815.c
drivers/nvmem/core.c
drivers/of/of_mdio.c
drivers/of/platform.c
drivers/pci/probe.c
drivers/pci/search.c
drivers/s390/cio/css.c
drivers/s390/cio/device.c
drivers/s390/cio/scm.c
drivers/s390/crypto/ap_bus.c
drivers/scsi/scsi_proc.c
drivers/spi/spi.c
drivers/thunderbolt/switch.c
drivers/usb/core/devio.c
drivers/usb/core/usb.c
drivers/usb/phy/phy-am335x-control.c
drivers/usb/phy/phy-isp1301.c
drivers/visorbus/visorbus_main.c
include/linux/device.h
sound/soc/rockchip/rk3399_gru_sound.c