lkml.org 
[lkml]   [2019]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 46/57] driver: Add variants of driver_find_device()
From
Date


On 03/06/2019 20:12, Greg KH wrote:
> On Mon, Jun 03, 2019 at 04:50:12PM +0100, Suzuki K Poulose wrote:
>> Add a wrappers to lookup a device by name for a given driver, by various
>> generic properties of a device. This can avoid the proliferation of custom
>> match functions throughout the drivers.
>>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
>> ---
>> include/linux/device.h | 44 ++++++++++++++++++++++++++++++++++++++++++++
>> 1 file changed, 44 insertions(+)
>>
>> diff --git a/include/linux/device.h b/include/linux/device.h
>> index 52d59d5..68d6e04 100644
>> --- a/include/linux/device.h
>> +++ b/include/linux/device.h
>> @@ -401,6 +401,50 @@ struct device *driver_find_device(struct device_driver *drv,
>> struct device *start, void *data,
>> int (*match)(struct device *dev, const void *data));
>>
>> +/**
>> + * driver_find_device_by_name - device iterator for locating a particular device
>> + * of a specific name.
>> + * @driver: the driver we're iterating
>> + * @start: Device to begin with
>> + * @name: name of the device to match
>> + */
>> +static inline struct device *driver_find_device_by_name(struct device_driver *drv,
>> + struct device *start,
>> + const char *name)
>> +{
>> + return driver_find_device(drv, start, (void *)name, device_match_name);
>> +}
>
> Are any of the users you are finding for these new functions ever using
> the 'start' parameter? If not, let's just drop it, as it's normally a
> rare thing to care about, right?

No, they don't except for the bus_find_next_device() at the end of the series.
I could clean this up.

Cheers
Suzuki

\
 
 \ /
  Last update: 2019-06-04 10:33    [W:0.074 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site