[RFC PATCH 18/57] drivers: intel_th: Use bus_find_device_by_devt helper

Suzuki K Poulose
2019-06-03T15:51:29Z

Switch to using the bus_find_device_by_devt helper

Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
---
drivers/hwtracing/intel_th/core.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index 033dce5..a85e236 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -789,13 +789,6 @@ static int intel_th_populate(struct intel_th *th)
return 0;
}

-static int match_devt(struct device *dev, void *data)
-{
- dev_t devt = (dev_t)(unsigned long)data;
-
- return dev->devt == devt;
-}
-
static int intel_th_output_open(struct inode *inode, struct file *file)
{
const struct file_operations *fops;
@@ -803,9 +796,7 @@ static int intel_th_output_open(struct inode *inode, struct file *file)
struct device *dev;
int err;

- dev = bus_find_device(&intel_th_bus, NULL,
- (void *)(unsigned long)inode->i_rdev,
- match_devt);
+ dev = bus_find_device_by_devt(&intel_th_bus, NULL, inode->i_rdev);
if (!dev || !dev->driver)
return -ENODEV;

--
2.7.4