diff options
author | Suzuki K Poulose <suzuki.poulose@arm.com> | 2019-07-24 01:18:37 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-30 14:07:42 +0300 |
commit | 6bf85ba9e55f659ddc0747bf1bb504ec6d15f525 (patch) | |
tree | 4b240fa6a535a1e9c045152afe9276aa9266622a /drivers/scsi/scsi_proc.c | |
parent | 00500147cbd3fc51353d0d003eaa9d31c72c0d50 (diff) | |
download | linux-6bf85ba9e55f659ddc0747bf1bb504ec6d15f525.tar.xz |
drivers: Add generic helper to match any device
Add a generic helper to match any/all devices. Using this
introduce new wrappers {bus/driver/class}_find_next_device().
Cc: Elie Morisse <syniurge@gmail.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Nehal Shah <nehal-bakulchandra.shah@amd.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Shyam Sundar S K <shyam-sundar.s-k@amd.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com> # PCI
Link: https://lore.kernel.org/r/20190723221838.12024-7-suzuki.poulose@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/scsi/scsi_proc.c')
-rw-r--r-- | drivers/scsi/scsi_proc.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c index c074631086a4..5b313226f11c 100644 --- a/drivers/scsi/scsi_proc.c +++ b/drivers/scsi/scsi_proc.c @@ -372,15 +372,10 @@ static ssize_t proc_scsi_write(struct file *file, const char __user *buf, return err; } -static int always_match(struct device *dev, const void *data) -{ - return 1; -} - static inline struct device *next_scsi_device(struct device *start) { - struct device *next = bus_find_device(&scsi_bus_type, start, NULL, - always_match); + struct device *next = bus_find_next_device(&scsi_bus_type, start); + put_device(start); return next; } |