History

driver_find_device: Unify the match function with class_find_device()

The driver_find_device() accepts a match function pointer to filter the devices for lookup, similar to bus/class_find_device(). However, there is a minor difference in the prototype for the match parameter for driver_find_device() with the now unified version accepted by {bus/class}_find_device(), where it doesn't accept a "const" qualifier for the data argument. This prevents us from reusing the generic match functions for driver_find_device(). For this reason, change the prototype of the driver_find_device() to make the "match" parameter in line with {bus/class}_find_device() and adjust its callers to use the const qualifier. Also, we could now promote the "data" parameter to const as we pass it down as a const parameter to the match functions.

Suzuki K Poulose committed 7 years ago

Commit 92ce7e81 parent 418e3ea12 files · +21 −21Browse files

Showing the changes to include/linux (1 of 12 files). Show all

Unified · Split

include/linux/device.h+2−2
@@ -336,8 +336,8 @@ extern int __must_check driver_for_each_device(struct device_driver *drv, · 335 unmodified lines
336 int (*fn)(struct device *dev,336 int (*fn)(struct device *dev,
337 void *));337 void *));
338struct device *driver_find_device(struct device_driver *drv,338struct device *driver_find_device(struct device_driver *drv,
339 struct device *start, void *data,339 struct device *start, const void *data,
340 int (*match)(struct device *dev, void *data));340 int (*match)(struct device *dev, const void *data));
341 341
342void driver_deferred_probe_add(struct device *dev);342void driver_deferred_probe_add(struct device *dev);
343int driver_deferred_probe_check_state(struct device *dev);343int driver_deferred_probe_check_state(struct device *dev);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t