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
nexedi
linux
Commits
5757f1dc
Commit
5757f1dc
authored
Aug 05, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: remove all struct device.name usage from the USB code.
This is because that field is going away shortly...
parent
92ddc68d
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
12 additions
and
84 deletions
+12
-84
drivers/usb/core/hcd-pci.c
drivers/usb/core/hcd-pci.c
+2
-1
drivers/usb/core/hub.c
drivers/usb/core/hub.c
+1
-3
drivers/usb/core/usb.c
drivers/usb/core/usb.c
+4
-77
drivers/usb/host/ehci-dbg.c
drivers/usb/host/ehci-dbg.c
+2
-2
drivers/usb/host/ehci-mem.c
drivers/usb/host/ehci-mem.c
+1
-0
drivers/usb/host/ohci-mem.c
drivers/usb/host/ohci-mem.c
+1
-0
drivers/usb/host/uhci-hcd.c
drivers/usb/host/uhci-hcd.c
+1
-0
drivers/usb/serial/usb-serial.c
drivers/usb/serial/usb-serial.c
+0
-1
No files found.
drivers/usb/core/hcd-pci.c
View file @
5757f1dc
...
...
@@ -147,7 +147,8 @@ int usb_hcd_pci_probe (struct pci_dev *dev, const struct pci_device_id *id)
hcd
->
description
=
driver
->
description
;
hcd
->
pdev
=
dev
;
hcd
->
self
.
bus_name
=
pci_name
(
dev
);
hcd
->
product_desc
=
dev
->
dev
.
name
;
if
(
hcd
->
product_desc
==
NULL
)
hcd
->
product_desc
=
"USB Host Controller"
;
hcd
->
self
.
controller
=
&
dev
->
dev
;
hcd
->
controller
=
hcd
->
self
.
controller
;
...
...
drivers/usb/core/hub.c
View file @
5757f1dc
...
...
@@ -597,10 +597,8 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
usb_set_intfdata
(
intf
,
hub
);
if
(
hub_configure
(
hub
,
endpoint
)
>=
0
)
{
strcpy
(
intf
->
dev
.
name
,
"Hub"
);
if
(
hub_configure
(
hub
,
endpoint
)
>=
0
)
return
0
;
}
hub_disconnect
(
intf
);
return
-
ENODEV
;
...
...
drivers/usb/core/usb.c
View file @
5757f1dc
...
...
@@ -978,68 +978,6 @@ int usb_set_address(struct usb_device *dev)
return
retval
;
}
/* improve on the default device description, if we can ... and
* while we're at it, maybe show the vendor and product strings.
*/
static
void
set_device_description
(
struct
usb_device
*
dev
)
{
void
*
buf
;
int
mfgr
=
dev
->
descriptor
.
iManufacturer
;
int
prod
=
dev
->
descriptor
.
iProduct
;
int
vendor_id
=
dev
->
descriptor
.
idVendor
;
int
product_id
=
dev
->
descriptor
.
idProduct
;
char
*
mfgr_str
,
*
prod_str
;
/* set default; keep it if there are no strings, or kmalloc fails */
sprintf
(
dev
->
dev
.
name
,
"USB device %04x:%04x"
,
vendor_id
,
product_id
);
if
(
!
(
buf
=
kmalloc
(
256
*
2
,
GFP_KERNEL
)))
return
;
prod_str
=
(
char
*
)
buf
;
mfgr_str
=
(
char
*
)
buf
+
256
;
if
(
prod
&&
usb_string
(
dev
,
prod
,
prod_str
,
256
)
>
0
)
{
#ifdef DEBUG
dev_printk
(
KERN_INFO
,
&
dev
->
dev
,
"Product: %s
\n
"
,
prod_str
);
#endif
}
else
{
prod_str
=
0
;
}
if
(
mfgr
&&
usb_string
(
dev
,
mfgr
,
mfgr_str
,
256
)
>
0
)
{
#ifdef DEBUG
dev_printk
(
KERN_INFO
,
&
dev
->
dev
,
"Manufacturer: %s
\n
"
,
mfgr_str
);
#endif
}
else
{
mfgr_str
=
0
;
}
/* much like pci ... describe as either:
* - both strings: 'product descr (vendor descr)'
* - product only: 'product descr (USB device vvvv:pppp)'
* - vendor only: 'USB device vvvv:pppp (vendor descr)'
* - neither string: 'USB device vvvv:pppp'
*/
if
(
prod_str
&&
mfgr_str
)
{
snprintf
(
dev
->
dev
.
name
,
sizeof
dev
->
dev
.
name
,
"%s (%s)"
,
prod_str
,
mfgr_str
);
}
else
if
(
prod_str
)
{
snprintf
(
dev
->
dev
.
name
,
sizeof
dev
->
dev
.
name
,
"%s (USB device %04x:%04x)"
,
prod_str
,
vendor_id
,
product_id
);
}
else
if
(
mfgr_str
)
{
snprintf
(
dev
->
dev
.
name
,
sizeof
dev
->
dev
.
name
,
"USB device %04x:%04x (%s)"
,
vendor_id
,
product_id
,
mfgr_str
);
}
kfree
(
buf
);
}
/*
* By the time we get here, we chose a new device address
* and is in the default state. We need to identify the thing and
...
...
@@ -1181,9 +1119,12 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
dev_dbg
(
&
dev
->
dev
,
"new device strings: Mfr=%d, Product=%d, SerialNumber=%d
\n
"
,
dev
->
descriptor
.
iManufacturer
,
dev
->
descriptor
.
iProduct
,
dev
->
descriptor
.
iSerialNumber
);
set_device_description
(
dev
);
#ifdef DEBUG
if
(
dev
->
descriptor
.
iProduct
)
usb_show_string
(
dev
,
"Product"
,
dev
->
descriptor
.
iProduct
);
if
(
dev
->
descriptor
.
iManufacturer
)
usb_show_string
(
dev
,
"Manufacturer"
,
dev
->
descriptor
.
iManufacturer
);
if
(
dev
->
descriptor
.
iSerialNumber
)
usb_show_string
(
dev
,
"SerialNumber"
,
dev
->
descriptor
.
iSerialNumber
);
#endif
...
...
@@ -1208,20 +1149,6 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
sprintf
(
&
interface
->
dev
.
bus_id
[
0
],
"%d-%s:%d"
,
dev
->
bus
->
busnum
,
dev
->
devpath
,
desc
->
bInterfaceNumber
);
if
(
!
desc
->
iInterface
||
usb_string
(
dev
,
desc
->
iInterface
,
interface
->
dev
.
name
,
sizeof
interface
->
dev
.
name
)
<=
0
)
{
/* typically devices won't bother with interface
* descriptions; this is the normal case. an
* interface's driver might describe it better.
* (also: iInterface is per-altsetting ...)
*/
sprintf
(
&
interface
->
dev
.
name
[
0
],
"usb-%s-%s interface %d"
,
dev
->
bus
->
bus_name
,
dev
->
devpath
,
desc
->
bInterfaceNumber
);
}
dev_dbg
(
&
dev
->
dev
,
"%s - registering interface %s
\n
"
,
__FUNCTION__
,
interface
->
dev
.
bus_id
);
device_add
(
&
interface
->
dev
);
usb_create_driverfs_intf_files
(
interface
);
...
...
drivers/usb/host/ehci-dbg.c
View file @
5757f1dc
...
...
@@ -591,8 +591,8 @@ show_registers (struct class_device *class_dev, char *buf)
/* Capability Registers */
i
=
readw
(
&
ehci
->
caps
->
hci_version
);
temp
=
snprintf
(
next
,
size
,
"%s
\n
EHCI %x.%02x, hcd state %d (driver "
DRIVER_VERSION
")
\n
"
,
hcd
->
pdev
->
dev
.
name
,
"
PCI device
%s
\n
EHCI %x.%02x, hcd state %d (driver "
DRIVER_VERSION
")
\n
"
,
pci_name
(
hcd
->
pdev
)
,
i
>>
8
,
i
&
0x0ff
,
ehci
->
hcd
.
state
);
size
-=
temp
;
next
+=
temp
;
...
...
drivers/usb/host/ehci-mem.c
View file @
5757f1dc
...
...
@@ -44,6 +44,7 @@ static struct usb_hcd *ehci_hcd_alloc (void)
kmalloc
(
sizeof
(
struct
ehci_hcd
),
GFP_KERNEL
);
if
(
ehci
!=
0
)
{
memset
(
ehci
,
0
,
sizeof
(
struct
ehci_hcd
));
ehci
->
hcd
.
product_desc
=
"EHCI Host Controller"
;
return
&
ehci
->
hcd
;
}
return
0
;
...
...
drivers/usb/host/ohci-mem.c
View file @
5757f1dc
...
...
@@ -30,6 +30,7 @@ static struct usb_hcd *ohci_hcd_alloc (void)
ohci
=
(
struct
ohci_hcd
*
)
kmalloc
(
sizeof
*
ohci
,
GFP_KERNEL
);
if
(
ohci
!=
0
)
{
memset
(
ohci
,
0
,
sizeof
(
struct
ohci_hcd
));
ohci
->
hcd
.
product_desc
=
"OHCI Host Controller"
;
return
&
ohci
->
hcd
;
}
return
0
;
...
...
drivers/usb/host/uhci-hcd.c
View file @
5757f1dc
...
...
@@ -2460,6 +2460,7 @@ static struct usb_hcd *uhci_hcd_alloc(void)
return
NULL
;
memset
(
uhci
,
0
,
sizeof
(
*
uhci
));
uhci
->
hcd
.
product_desc
=
"UHCI Host Controller"
;
return
&
uhci
->
hcd
;
}
...
...
drivers/usb/serial/usb-serial.c
View file @
5757f1dc
...
...
@@ -1238,7 +1238,6 @@ int usb_serial_probe(struct usb_interface *interface,
port
->
dev
.
bus
=
&
usb_serial_bus_type
;
snprintf
(
&
port
->
dev
.
bus_id
[
0
],
sizeof
(
port
->
dev
.
bus_id
),
"ttyUSB%d"
,
port
->
number
);
snprintf
(
&
port
->
dev
.
name
[
0
],
sizeof
(
port
->
dev
.
name
),
"usb serial port %d"
,
port
->
number
);
dbg
(
"%s - registering %s"
,
__FUNCTION__
,
port
->
dev
.
bus_id
);
device_register
(
&
port
->
dev
);
}
...
...
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