Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
f601a8a6
Commit
f601a8a6
authored
Aug 14, 2002
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USB: changed usb_match_id to not need the usb_device pointer.
parent
16dc2073
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
13 deletions
+12
-13
drivers/usb/core/usb.c
drivers/usb/core/usb.c
+9
-9
drivers/usb/serial/usbserial.c
drivers/usb/serial/usbserial.c
+1
-1
drivers/usb/storage/scsiglue.c
drivers/usb/storage/scsiglue.c
+1
-1
include/linux/usb.h
include/linux/usb.h
+1
-2
No files found.
drivers/usb/core/usb.c
View file @
f601a8a6
...
@@ -206,7 +206,7 @@ usb_bind_driver (struct usb_driver *driver, struct usb_interface *interface)
...
@@ -206,7 +206,7 @@ usb_bind_driver (struct usb_driver *driver, struct usb_interface *interface)
if
(
id
)
{
if
(
id
)
{
for
(
i
=
0
;
i
<
interface
->
num_altsetting
;
i
++
)
{
for
(
i
=
0
;
i
<
interface
->
num_altsetting
;
i
++
)
{
interface
->
act_altsetting
=
i
;
interface
->
act_altsetting
=
i
;
id
=
usb_match_id
(
dev
,
interface
,
id
);
id
=
usb_match_id
(
interface
,
id
);
if
(
id
)
{
if
(
id
)
{
down
(
&
driver
->
serialize
);
down
(
&
driver
->
serialize
);
private
=
driver
->
probe
(
dev
,
ifnum
,
id
);
private
=
driver
->
probe
(
dev
,
ifnum
,
id
);
...
@@ -466,7 +466,6 @@ void usb_driver_release_interface(struct usb_driver *driver, struct usb_interfac
...
@@ -466,7 +466,6 @@ void usb_driver_release_interface(struct usb_driver *driver, struct usb_interfac
/**
/**
* usb_match_id - find first usb_device_id matching device or interface
* usb_match_id - find first usb_device_id matching device or interface
* @dev: the device whose descriptors are considered when matching
* @interface: the interface of interest
* @interface: the interface of interest
* @id: array of usb_device_id structures, terminated by zero entry
* @id: array of usb_device_id structures, terminated by zero entry
*
*
...
@@ -528,15 +527,18 @@ void usb_driver_release_interface(struct usb_driver *driver, struct usb_interfac
...
@@ -528,15 +527,18 @@ void usb_driver_release_interface(struct usb_driver *driver, struct usb_interfac
* its associated class and subclass.
* its associated class and subclass.
*/
*/
const
struct
usb_device_id
*
const
struct
usb_device_id
*
usb_match_id
(
struct
usb_device
*
dev
,
struct
usb_interface
*
interface
,
usb_match_id
(
struct
usb_interface
*
interface
,
const
struct
usb_device_id
*
id
)
const
struct
usb_device_id
*
id
)
{
{
struct
usb_interface_descriptor
*
intf
=
0
;
struct
usb_interface_descriptor
*
intf
;
struct
usb_device
*
dev
;
/* proc_connectinfo in devio.c may call us with id == NULL. */
/* proc_connectinfo in devio.c may call us with id == NULL. */
if
(
id
==
NULL
)
if
(
id
==
NULL
)
return
NULL
;
return
NULL
;
intf
=
&
interface
->
altsetting
[
interface
->
act_altsetting
];
dev
=
interface_to_usbdev
(
interface
);
/* It is important to check that id->driver_info is nonzero,
/* It is important to check that id->driver_info is nonzero,
since an entry that is all zeroes except for a nonzero
since an entry that is all zeroes except for a nonzero
id->driver_info is the way to create an entry that
id->driver_info is the way to create an entry that
...
@@ -575,8 +577,6 @@ usb_match_id(struct usb_device *dev, struct usb_interface *interface,
...
@@ -575,8 +577,6 @@ usb_match_id(struct usb_device *dev, struct usb_interface *interface,
(
id
->
bDeviceProtocol
!=
dev
->
descriptor
.
bDeviceProtocol
))
(
id
->
bDeviceProtocol
!=
dev
->
descriptor
.
bDeviceProtocol
))
continue
;
continue
;
intf
=
&
interface
->
altsetting
[
interface
->
act_altsetting
];
if
((
id
->
match_flags
&
USB_DEVICE_ID_MATCH_INT_CLASS
)
&&
if
((
id
->
match_flags
&
USB_DEVICE_ID_MATCH_INT_CLASS
)
&&
(
id
->
bInterfaceClass
!=
intf
->
bInterfaceClass
))
(
id
->
bInterfaceClass
!=
intf
->
bInterfaceClass
))
continue
;
continue
;
...
...
drivers/usb/serial/usbserial.c
View file @
f601a8a6
...
@@ -1193,7 +1193,7 @@ static void * usb_serial_probe(struct usb_device *dev, unsigned int ifnum,
...
@@ -1193,7 +1193,7 @@ static void * usb_serial_probe(struct usb_device *dev, unsigned int ifnum,
interface
=
&
dev
->
actconfig
->
interface
[
ifnum
];
interface
=
&
dev
->
actconfig
->
interface
[
ifnum
];
list_for_each
(
tmp
,
&
usb_serial_driver_list
)
{
list_for_each
(
tmp
,
&
usb_serial_driver_list
)
{
type
=
list_entry
(
tmp
,
struct
usb_serial_device_type
,
driver_list
);
type
=
list_entry
(
tmp
,
struct
usb_serial_device_type
,
driver_list
);
id_pattern
=
usb_match_id
(
dev
,
interface
,
type
->
id_table
);
id_pattern
=
usb_match_id
(
interface
,
type
->
id_table
);
if
(
id_pattern
!=
NULL
)
{
if
(
id_pattern
!=
NULL
)
{
dbg
(
"descriptor matches"
);
dbg
(
"descriptor matches"
);
found
=
1
;
found
=
1
;
...
...
drivers/usb/storage/scsiglue.c
View file @
f601a8a6
...
@@ -265,7 +265,7 @@ static int bus_reset( Scsi_Cmnd *srb )
...
@@ -265,7 +265,7 @@ static int bus_reset( Scsi_Cmnd *srb )
US_DEBUGPX
(
"simulating disconnect/reconnect.
\n
"
);
US_DEBUGPX
(
"simulating disconnect/reconnect.
\n
"
);
down
(
&
intf
->
driver
->
serialize
);
down
(
&
intf
->
driver
->
serialize
);
intf
->
driver
->
disconnect
(
pusb_dev_save
,
intf
->
private_data
);
intf
->
driver
->
disconnect
(
pusb_dev_save
,
intf
->
private_data
);
id
=
usb_match_id
(
pusb_dev_save
,
intf
,
intf
->
driver
->
id_table
);
id
=
usb_match_id
(
intf
,
intf
->
driver
->
id_table
);
intf
->
driver
->
probe
(
pusb_dev_save
,
i
,
id
);
intf
->
driver
->
probe
(
pusb_dev_save
,
i
,
id
);
up
(
&
intf
->
driver
->
serialize
);
up
(
&
intf
->
driver
->
serialize
);
}
}
...
...
include/linux/usb.h
View file @
f601a8a6
...
@@ -443,8 +443,7 @@ extern void usb_driver_claim_interface(struct usb_driver *driver,
...
@@ -443,8 +443,7 @@ extern void usb_driver_claim_interface(struct usb_driver *driver,
extern
int
usb_interface_claimed
(
struct
usb_interface
*
iface
);
extern
int
usb_interface_claimed
(
struct
usb_interface
*
iface
);
extern
void
usb_driver_release_interface
(
struct
usb_driver
*
driver
,
extern
void
usb_driver_release_interface
(
struct
usb_driver
*
driver
,
struct
usb_interface
*
iface
);
struct
usb_interface
*
iface
);
const
struct
usb_device_id
*
usb_match_id
(
struct
usb_device
*
dev
,
const
struct
usb_device_id
*
usb_match_id
(
struct
usb_interface
*
interface
,
struct
usb_interface
*
interface
,
const
struct
usb_device_id
*
id
);
const
struct
usb_device_id
*
id
);
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment