diff options
author | Suzuki K Poulose <[email protected]> | 2019-06-14 18:53:59 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2019-06-24 05:22:31 +0200 |
commit | 418e3ea157efb0eb2c6dd412a8d5f052477c7f5a (patch) | |
tree | 1c8412f0b9adce1c72806e3e2c61a84c26752a17 /drivers/firmware/efi/dev-path-parser.c | |
parent | e6374f6b2e9c9f9a7cf5418157ad7f30f3abd70e (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 <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Andreas Noever <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: Corey Minyard <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: David Kershner <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Felipe Balbi <[email protected]>
Cc: Frank Rowand <[email protected]>
Cc: Grygorii Strashko <[email protected]>
Cc: Harald Freudenberger <[email protected]>
Cc: Hartmut Knaack <[email protected]>
Cc: Heiko Stuebner <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Mark Brown <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Michael Jamet <[email protected]>
Cc: "Martin K. Petersen" <[email protected]>
Cc: Peter Oberparleiter <[email protected]>
Cc: Sebastian Ott <[email protected]>
Cc: Srinivas Kandagatla <[email protected]>
Cc: Yehezkel Bernat <[email protected]>
Cc: [email protected]
Acked-by: Corey Minyard <[email protected]>
Acked-by: David Kershner <[email protected]>
Acked-by: Mark Brown <[email protected]>
Acked-by: Rafael J. Wysocki <[email protected]>
Acked-by: Srinivas Kandagatla <[email protected]>
Acked-by: Wolfram Sang <[email protected]> # for the I2C parts
Acked-by: Rob Herring <[email protected]>
Signed-off-by: Suzuki K Poulose <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/firmware/efi/dev-path-parser.c')
-rw-r--r-- | drivers/firmware/efi/dev-path-parser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/firmware/efi/dev-path-parser.c b/drivers/firmware/efi/dev-path-parser.c index 85ec99f97841..20123384271c 100644 --- a/drivers/firmware/efi/dev-path-parser.c +++ b/drivers/firmware/efi/dev-path-parser.c @@ -17,9 +17,9 @@ struct acpi_hid_uid { char uid[11]; /* UINT_MAX + null byte */ }; -static int __init match_acpi_dev(struct device *dev, void *data) +static int __init match_acpi_dev(struct device *dev, const void *data) { - struct acpi_hid_uid hid_uid = *(struct acpi_hid_uid *)data; + struct acpi_hid_uid hid_uid = *(const struct acpi_hid_uid *)data; struct acpi_device *adev = to_acpi_device(dev); if (acpi_match_device_ids(adev, hid_uid.hid)) |