Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaeebf2b

Browse files
hadessgregkh
authored andcommitted
USB: Implement usb_device_match_id()
Match a usb_device with a table of IDs.Signed-off-by: Bastien Nocera <hadess@hadess.net>Acked-by: Alan Stern <stern@rowland.harvard.edu>Link:https://lore.kernel.org/r/20191016093933.693-4-hadess@hadess.netSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parentc9d5033 commitaeebf2b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

‎drivers/usb/core/driver.c‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,20 @@ const struct usb_device_id *usb_match_id(struct usb_interface *interface,
800800
}
801801
EXPORT_SYMBOL_GPL(usb_match_id);
802802

803+
conststructusb_device_id*usb_device_match_id(structusb_device*udev,
804+
conststructusb_device_id*id)
805+
{
806+
if (!id)
807+
returnNULL;
808+
809+
for (;id->idVendor||id->idProduct ;id++) {
810+
if (usb_match_device(udev,id))
811+
returnid;
812+
}
813+
814+
returnNULL;
815+
}
816+
803817
staticintusb_device_match(structdevice*dev,structdevice_driver*drv)
804818
{
805819
/* devices and interfaces are handled separately */

‎drivers/usb/core/usb.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ extern int usb_match_one_id_intf(struct usb_device *dev,
6969
conststructusb_device_id*id);
7070
externintusb_match_device(structusb_device*dev,
7171
conststructusb_device_id*id);
72+
externconststructusb_device_id*usb_device_match_id(structusb_device*udev,
73+
conststructusb_device_id*id);
7274
externvoidusb_forced_unbind_intf(structusb_interface*intf);
7375
externvoidusb_unbind_and_rebind_marked_interfaces(structusb_device*udev);
7476

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp