[RFC PATCH 57/57] drivers: i2c-amd: Use driver_find_next_device() helper
From: Suzuki K Poulose
Date: Mon Jun 03 2019 - 11:56:18 EST
Reuse the generic helper to find the first device matching
the driver.
Cc: Elie Morisse <syniurge@xxxxxxxxx>
Cc: Nehal Shah <nehal-bakulchandra.shah@xxxxxxx>
Cc: Shyam Sundar S K <shyam-sundar.s-k@xxxxxxx>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
---
drivers/i2c/busses/i2c-amd-mp2-pci.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/i2c/busses/i2c-amd-mp2-pci.c b/drivers/i2c/busses/i2c-amd-mp2-pci.c
index c7fe3b4..5e4800d 100644
--- a/drivers/i2c/busses/i2c-amd-mp2-pci.c
+++ b/drivers/i2c/busses/i2c-amd-mp2-pci.c
@@ -457,18 +457,12 @@ static struct pci_driver amd_mp2_pci_driver = {
};
module_pci_driver(amd_mp2_pci_driver);
-static int amd_mp2_device_match(struct device *dev, const void *data)
-{
- return 1;
-}
-
struct amd_mp2_dev *amd_mp2_find_device(void)
{
struct device *dev;
struct pci_dev *pci_dev;
- dev = driver_find_device(&amd_mp2_pci_driver.driver, NULL, NULL,
- amd_mp2_device_match);
+ dev = driver_find_next_device(&amd_mp2_pci_driver.driver, NULL);
if (!dev)
return NULL;
--
2.7.4