[RFC,23/57] drivers: spi: Use bus_find_device_by_acpi_dev match helper
diff mbox series

Message ID 1559577023-558-24-git-send-email-suzuki.poulose@arm.com
State New
Headers show
Series
  • [RFC,01/57] drivers: s390/cio: Use driver_for_each_device
Related show

Commit Message

Suzuki K Poulose June 3, 2019, 3:49 p.m. UTC
Switch to the generic helper bus_find_device_by_acpi_dev.

Cc: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
 drivers/spi/spi.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Mark Brown June 3, 2019, 4:04 p.m. UTC | #1
On Mon, Jun 03, 2019 at 04:49:49PM +0100, Suzuki K Poulose wrote:
> Switch to the generic helper bus_find_device_by_acpi_dev.

Please use subject lines matching the style for the subsystem.  This
makes it easier for people to identify relevant patches.

Acked-by: Mark Brown <broonie@kernel.org>

Patch
diff mbox series

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index ecdd602..5224ded 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -3634,11 +3634,6 @@  static int spi_acpi_controller_match(struct device *dev, const void *data)
 	return ACPI_COMPANION(dev->parent) == data;
 }
 
-static int spi_acpi_device_match(struct device *dev, void *data)
-{
-	return ACPI_COMPANION(dev) == data;
-}
-
 static struct spi_controller *acpi_spi_find_controller_by_adev(struct acpi_device *adev)
 {
 	struct device *dev;
@@ -3658,8 +3653,7 @@  static struct spi_device *acpi_spi_find_device_by_adev(struct acpi_device *adev)
 {
 	struct device *dev;
 
-	dev = bus_find_device(&spi_bus_type, NULL, adev, spi_acpi_device_match);
-
+	dev = bus_find_device(&spi_bus_type, NULL, adev, device_match_acpi_dev);
 	return dev ? to_spi_device(dev) : NULL;
 }