summaryrefslogtreecommitdiff
path: root/drivers/i2c/i2c-core-acpi.c
diff options
context:
space:
mode:
authorSuzuki K Poulose <suzuki.poulose@arm.com>2019-06-14 18:53:59 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-24 05:22:31 +0200
commit418e3ea157efb0eb2c6dd412a8d5f052477c7f5a (patch)
tree1c8412f0b9adce1c72806e3e2c61a84c26752a17 /drivers/i2c/i2c-core-acpi.c
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 <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>
Diffstat (limited to 'drivers/i2c/i2c-core-acpi.c')
-rw-r--r--drivers/i2c/i2c-core-acpi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c
index d84095591e45..8af35f114821 100644
--- a/drivers/i2c/i2c-core-acpi.c
+++ b/drivers/i2c/i2c-core-acpi.c
@@ -318,7 +318,7 @@ u32 i2c_acpi_find_bus_speed(struct device *dev)
}
EXPORT_SYMBOL_GPL(i2c_acpi_find_bus_speed);
-static int i2c_acpi_find_match_adapter(struct device *dev, void *data)
+static int i2c_acpi_find_match_adapter(struct device *dev, const void *data)
{
struct i2c_adapter *adapter = i2c_verify_adapter(dev);
@@ -328,7 +328,7 @@ static int i2c_acpi_find_match_adapter(struct device *dev, void *data)
return ACPI_HANDLE(dev) == (acpi_handle)data;
}
-static int i2c_acpi_find_match_device(struct device *dev, void *data)
+static int i2c_acpi_find_match_device(struct device *dev, const void *data)
{
return ACPI_COMPANION(dev) == data;
}
lass='deletions'>-1/+1 2013-12-18drm: Kill DRM_SUSERDaniel Vetter1-2/+2 2013-12-18drm: Kill DRM_*MEMORYBARRIERDaniel Vetter2-3/+3 2013-12-18drm: Kill DRM_COPY_(TO|FROM)_USERDaniel Vetter1-2/+2 2013-12-18drm: Kill DRM_WAKUP and DRM_INIT_WAITQUEUEDaniel Vetter3-10/+10 2013-12-18drm: Kill DRM_IRQ_ARGSDaniel Vetter2-2/+2 2013-12-18drm: Kill DRM_HZDaniel Vetter3-7/+7 2013-10-09drm: Kill ctx_count from struct drm_deviceVille Syrjälä1-1/+1 2013-08-19drm: rip out drm_core_has_MTRR checksDaniel Vetter1-1/+1 2013-08-19drm: remove FASYNC supportDaniel Vetter1-1/+0 2013-08-07drm: const'ify ioctls table (v2)Rob Clark2-2/+2 2013-08-07drm/mm: add "best_match" flag to drm_mm_insert_node()David Herrmann1-2/+2 2013-02-27drm/via: convert to idr_alloc()Tejun Heo1-10/+3 2013-02-27drm: don't use idr_remove_all()Tejun Heo1-1/+0 2012-10-02UAPI: (Scripted) Convert #include "..." to #include <path/...> in drivers/gpu/David Howells9-18/+18 2012-10-02UAPI: (Scripted) Remove redundant DRM UAPI header #inclusions from drivers/gpu/.David Howells3-3/+0 2012-09-06drm: use drm_compat_ioctl for 32-bit appsKeith Packard1-0/+3 2012-07-19drm/via: clean up reclaim_buffersDaniel Vetter2-5/+12 2012-06-16drm via: initialize object_idrMárton Németh1-2/+1 2012-02-16drm: move pci bus master enable into driver.Dave Airlie1-0/+2 2012-01-09drm/sis|via: don't return stack garbage from free_mem ioctlDaniel Vetter1-2/+1 2011-12-22drm/via: use drm_mm instead of drm_smanDaniel Vetter3-41/+43 2011-12-22drm/sis: track user->memblock mapping with idrDaniel Vetter1-0/+2 2011-12-22drm/via: track user->memblock mapping with idrDaniel Vetter3-14/+47 2011-12-22drm/sman: rip out owner trackingDaniel Vetter1-1/+1 2011-12-22drm/via: track obj->drm_fd relations in the driverDaniel Vetter2-8/+39 2011-11-11drm: Make the per-driver file_operations struct constArjan van de Ven1-11/+12