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
0907edc2
Commit
0907edc2
authored
Dec 30, 2002
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USB: convert more dbg() calls to dev_dbg for the usb core
parent
0d404451
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
48 deletions
+51
-48
drivers/usb/core/hcd.c
drivers/usb/core/hcd.c
+13
-13
drivers/usb/core/hub.c
drivers/usb/core/hub.c
+25
-22
drivers/usb/core/usb.c
drivers/usb/core/usb.c
+13
-13
No files found.
drivers/usb/core/hcd.c
View file @
0907edc2
...
...
@@ -346,7 +346,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
/* FALLTHROUGH */
case
DeviceOutRequest
|
USB_REQ_CLEAR_FEATURE
:
case
DeviceOutRequest
|
USB_REQ_SET_FEATURE
:
d
bg
(
"no device features yet yet
"
);
d
ev_dbg
(
*
hcd
->
controller
,
"no device features yet yet
\n
"
);
break
;
case
DeviceRequest
|
USB_REQ_GET_CONFIGURATION
:
ubuf
[
0
]
=
1
;
...
...
@@ -404,7 +404,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
/* FALLTHROUGH */
case
EndpointOutRequest
|
USB_REQ_CLEAR_FEATURE
:
case
EndpointOutRequest
|
USB_REQ_SET_FEATURE
:
d
bg
(
"no endpoint features yet
"
);
d
ev_dbg
(
*
hcd
->
controller
,
"no endpoint features yet
\n
"
);
break
;
/* CLASS REQUESTS (and errors) */
...
...
@@ -418,12 +418,12 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb)
error:
/* "protocol stall" on error */
urb
->
status
=
-
EPIPE
;
d
bg
(
"unsupported hub control message (maxchild %d)
"
,
d
ev_dbg
(
*
hcd
->
controller
,
"unsupported hub control message (maxchild %d)
\n
"
,
urb
->
dev
->
maxchild
);
}
if
(
urb
->
status
)
{
urb
->
actual_length
=
0
;
d
bg
(
"CTRL: TypeReq=0x%x val=0x%x idx=0x%x len=%d ==> %d
"
,
d
ev_dbg
(
*
hcd
->
controller
,
"CTRL: TypeReq=0x%x val=0x%x idx=0x%x len=%d ==> %d
\n
"
,
typeReq
,
wValue
,
wIndex
,
wLength
,
urb
->
status
);
}
if
(
bufp
)
{
...
...
@@ -456,7 +456,7 @@ static int rh_status_urb (struct usb_hcd *hcd, struct urb *urb)
if
(
timer_pending
(
&
hcd
->
rh_timer
)
||
urb
->
status
!=
-
EINPROGRESS
||
urb
->
transfer_buffer_length
<
len
)
{
d
bg
(
"not queuing status urb, stat %d
"
,
urb
->
status
);
d
ev_dbg
(
*
hcd
->
controller
,
"not queuing status urb, stat %d
\n
"
,
urb
->
status
);
return
-
EINVAL
;
}
...
...
@@ -667,7 +667,7 @@ void usb_register_bus(struct usb_bus *bus)
usbfs_add_bus
(
bus
);
info
(
"new USB bus registered, assigned bus number %d
"
,
bus
->
busnum
);
dev_info
(
*
bus
->
controller
,
"new USB bus registered, assigned bus number %d
\n
"
,
bus
->
busnum
);
}
EXPORT_SYMBOL
(
usb_register_bus
);
...
...
@@ -681,7 +681,7 @@ EXPORT_SYMBOL (usb_register_bus);
*/
void
usb_deregister_bus
(
struct
usb_bus
*
bus
)
{
info
(
"USB bus %d deregistered
"
,
bus
->
busnum
);
dev_info
(
*
bus
->
controller
,
"USB bus %d deregistered
\n
"
,
bus
->
busnum
);
/*
* NOTE: make sure that all the devices are removed by the
...
...
@@ -824,7 +824,7 @@ int usb_check_bandwidth (struct usb_device *dev, struct urb *urb)
#else
"would have "
;
#endif
d
bg
(
"usb_check_bandwidth %sFAILED: %d + %ld = %d usec
"
,
d
ev_dbg
(
dev
->
dev
,
"usb_check_bandwidth %sFAILED: %d + %ld = %d usec
\n
"
,
mode
,
old_alloc
,
bustime
,
new_alloc
);
#endif
#ifdef CONFIG_USB_BANDWIDTH
...
...
@@ -863,7 +863,7 @@ void usb_claim_bandwidth (struct usb_device *dev, struct urb *urb, int bustime,
urb
->
bandwidth
=
bustime
;
#ifdef USB_BANDWIDTH_MESSAGES
d
bg
(
"bandwidth alloc increased by %d (%s) to %d for %d requesters
"
,
d
ev_dbg
(
dev
->
dev
,
"bandwidth alloc increased by %d (%s) to %d for %d requesters
\n
"
,
bustime
,
isoc
?
"ISOC"
:
"INTR"
,
dev
->
bus
->
bandwidth_allocated
,
...
...
@@ -892,7 +892,7 @@ void usb_release_bandwidth (struct usb_device *dev, struct urb *urb, int isoc)
dev
->
bus
->
bandwidth_int_reqs
--
;
#ifdef USB_BANDWIDTH_MESSAGES
d
bg
(
"bandwidth alloc reduced by %d (%s) to %d for %d requesters
"
,
d
ev_dbg
(
dev
->
dev
,
"bandwidth alloc reduced by %d (%s) to %d for %d requesters
\n
"
,
urb
->
bandwidth
,
isoc
?
"ISOC"
:
"INTR"
,
dev
->
bus
->
bandwidth_allocated
,
...
...
@@ -1153,7 +1153,7 @@ static int hcd_unlink_urb (struct urb *urb)
*/
if
(
!
(
urb
->
transfer_flags
&
URB_ASYNC_UNLINK
))
{
if
(
in_interrupt
())
{
d
bg
(
"non-async unlink in_interrupt"
);
d
ev_dbg
(
*
hcd
->
controller
,
"non-async unlink in_interrupt"
);
retval
=
-
EWOULDBLOCK
;
goto
done
;
}
...
...
@@ -1233,7 +1233,7 @@ static int hcd_free_dev (struct usb_device *udev)
/* device driver problem with refcounts? */
if
(
!
list_empty
(
&
dev
->
urb_list
))
{
d
bg
(
"free busy dev, %s devnum %d (bug!)
"
,
d
ev_dbg
(
*
hcd
->
controller
,
"free busy dev, %s devnum %d (bug!)
\n
"
,
hcd
->
self
.
bus_name
,
udev
->
devnum
);
return
-
EINVAL
;
}
...
...
@@ -1366,7 +1366,7 @@ void usb_hc_died (struct usb_hcd *hcd)
dev
=
list_entry
(
devlist
,
struct
hcd_dev
,
dev_list
);
list_for_each
(
urblist
,
&
dev
->
urb_list
)
{
urb
=
list_entry
(
urblist
,
struct
urb
,
urb_list
);
d
bg
(
"shutdown %s urb %p pipe %x, current status %d
"
,
d
ev_dbg
(
*
hcd
->
controller
,
"shutdown %s urb %p pipe %x, current status %d
\n
"
,
hcd
->
self
.
bus_name
,
urb
,
urb
->
pipe
,
urb
->
status
);
if
(
urb
->
status
==
-
EINPROGRESS
)
urb
->
status
=
-
ESHUTDOWN
;
...
...
drivers/usb/core/hub.c
View file @
0907edc2
...
...
@@ -263,7 +263,8 @@ static void usb_hub_power_on(struct usb_hub *hub)
int
i
;
/* Enable power to the ports */
dbg
(
"enabling power on all ports"
);
dev_dbg
(
*
hubdev
(
interface_to_usbdev
(
hub
->
intf
)),
"enabling power on all ports
\n
"
);
dev
=
interface_to_usbdev
(
hub
->
intf
);
for
(
i
=
0
;
i
<
hub
->
descriptor
->
bNbrPorts
;
i
++
)
usb_set_port_feature
(
dev
,
i
+
1
,
USB_PORT_FEAT_POWER
);
...
...
@@ -276,6 +277,7 @@ static int usb_hub_configure(struct usb_hub *hub,
struct
usb_endpoint_descriptor
*
endpoint
)
{
struct
usb_device
*
dev
=
interface_to_usbdev
(
hub
->
intf
);
struct
device
*
hub_dev
;
struct
usb_hub_status
hubstatus
;
unsigned
int
pipe
;
int
maxp
,
ret
;
...
...
@@ -303,8 +305,9 @@ static int usb_hub_configure(struct usb_hub *hub,
goto
fail
;
}
hub_dev
=
hubdev
(
dev
);
dev
->
maxchild
=
hub
->
descriptor
->
bNbrPorts
;
dev_info
(
*
hub
dev
(
dev
)
,
"%d port%s detected
\n
"
,
dev
->
maxchild
,
dev_info
(
*
hub
_dev
,
"%d port%s detected
\n
"
,
dev
->
maxchild
,
(
dev
->
maxchild
==
1
)
?
""
:
"s"
);
le16_to_cpus
(
&
hub
->
descriptor
->
wHubCharacteristics
);
...
...
@@ -318,33 +321,33 @@ static int usb_hub_configure(struct usb_hub *hub,
[((
i
+
1
)
/
8
)]
&
(
1
<<
((
i
+
1
)
%
8
))
?
'F'
:
'R'
;
portstr
[
dev
->
maxchild
]
=
0
;
d
bg
(
"compound device; port removable status: %s
"
,
portstr
);
d
ev_dbg
(
*
hub_dev
,
"compound device; port removable status: %s
\n
"
,
portstr
);
}
else
d
bg
(
"standalone hub
"
);
d
ev_dbg
(
*
hub_dev
,
"standalone hub
\n
"
);
switch
(
hub
->
descriptor
->
wHubCharacteristics
&
HUB_CHAR_LPSM
)
{
case
0x00
:
d
bg
(
"ganged power switching
"
);
d
ev_dbg
(
*
hub_dev
,
"ganged power switching
\n
"
);
break
;
case
0x01
:
d
bg
(
"individual port power switching
"
);
d
ev_dbg
(
*
hub_dev
,
"individual port power switching
\n
"
);
break
;
case
0x02
:
case
0x03
:
d
bg
(
"unknown reserved power switching mode
"
);
d
ev_dbg
(
*
hub_dev
,
"unknown reserved power switching mode
\n
"
);
break
;
}
switch
(
hub
->
descriptor
->
wHubCharacteristics
&
HUB_CHAR_OCPM
)
{
case
0x00
:
d
bg
(
"global over-current protectio
n"
);
d
ev_dbg
(
*
hub_dev
,
"global over-current protection
\
n
"
);
break
;
case
0x08
:
d
bg
(
"individual port over-current protectio
n"
);
d
ev_dbg
(
*
hub_dev
,
"individual port over-current protection
\
n
"
);
break
;
case
0x10
:
case
0x18
:
d
bg
(
"no over-current protectio
n"
);
d
ev_dbg
(
*
hub_dev
,
"no over-current protection
\
n
"
);
break
;
}
...
...
@@ -355,16 +358,16 @@ static int usb_hub_configure(struct usb_hub *hub,
case
0
:
break
;
case
1
:
d
bg
(
"Single TT
"
);
d
ev_dbg
(
*
hub_dev
,
"Single TT
\n
"
);
hub
->
tt
.
hub
=
dev
;
break
;
case
2
:
d
bg
(
"TT per port
"
);
d
ev_dbg
(
*
hub_dev
,
"TT per port
\n
"
);
hub
->
tt
.
hub
=
dev
;
hub
->
tt
.
multi
=
1
;
break
;
default:
d
bg
(
"Unrecognized hub protocol %d
"
,
d
ev_dbg
(
*
hub_dev
,
"Unrecognized hub protocol %d
\n
"
,
dev
->
descriptor
.
bDeviceProtocol
);
break
;
}
...
...
@@ -372,26 +375,26 @@ static int usb_hub_configure(struct usb_hub *hub,
switch
(
hub
->
descriptor
->
wHubCharacteristics
&
HUB_CHAR_TTTT
)
{
case
0x00
:
if
(
dev
->
descriptor
.
bDeviceProtocol
!=
0
)
d
bg
(
"TT requires at most 8 FS bit times
"
);
d
ev_dbg
(
*
hub_dev
,
"TT requires at most 8 FS bit times
\n
"
);
break
;
case
0x20
:
d
bg
(
"TT requires at most 16 FS bit times
"
);
d
ev_dbg
(
*
hub_dev
,
"TT requires at most 16 FS bit times
\n
"
);
break
;
case
0x40
:
d
bg
(
"TT requires at most 24 FS bit times
"
);
d
ev_dbg
(
*
hub_dev
,
"TT requires at most 24 FS bit times
\n
"
);
break
;
case
0x60
:
d
bg
(
"TT requires at most 32 FS bit times
"
);
d
ev_dbg
(
*
hub_dev
,
"TT requires at most 32 FS bit times
\n
"
);
break
;
}
d
bg
(
"Port indicators are %s supported
"
,
d
ev_dbg
(
*
hub_dev
,
"Port indicators are %s supported
\n
"
,
(
hub
->
descriptor
->
wHubCharacteristics
&
HUB_CHAR_PORTIND
)
?
""
:
"not"
);
d
bg
(
"power on to power good time: %dms
"
,
d
ev_dbg
(
*
hub_dev
,
"power on to power good time: %dms
\n
"
,
hub
->
descriptor
->
bPwrOn2PwrGood
*
2
);
d
bg
(
"hub controller current requirement: %dmA
"
,
d
ev_dbg
(
*
hub_dev
,
"hub controller current requirement: %dmA
\n
"
,
hub
->
descriptor
->
bHubContrCurrent
);
ret
=
usb_get_hub_status
(
dev
,
&
hubstatus
);
...
...
@@ -402,11 +405,11 @@ static int usb_hub_configure(struct usb_hub *hub,
le16_to_cpus
(
&
hubstatus
.
wHubStatus
);
d
bg
(
"local power source is %s
"
,
d
ev_dbg
(
*
hub_dev
,
"local power source is %s
\n
"
,
(
hubstatus
.
wHubStatus
&
HUB_STATUS_LOCAL_POWER
)
?
"lost (inactive)"
:
"good"
);
d
bg
(
"%sover-current condition exists
"
,
d
ev_dbg
(
*
hub_dev
,
"%sover-current condition exists
\n
"
,
(
hubstatus
.
wHubStatus
&
HUB_STATUS_OVERCURRENT
)
?
""
:
"no "
);
/* Start the interrupt endpoint */
...
...
drivers/usb/core/usb.c
View file @
0907edc2
...
...
@@ -84,19 +84,19 @@ int usb_device_probe(struct device *dev)
const
struct
usb_device_id
*
id
;
int
error
=
-
ENODEV
;
d
bg
(
"%s
"
,
__FUNCTION__
);
d
ev_dbg
(
*
dev
,
"%s
\n
"
,
__FUNCTION__
);
if
(
!
driver
->
probe
)
return
error
;
if
(
!
try_module_get
(
driver
->
owner
))
{
err
(
"Can't get a module reference for %s
"
,
driver
->
name
);
dev_err
(
*
dev
,
"Can't get a module reference for %s
\n
"
,
driver
->
name
);
return
error
;
}
id
=
usb_match_id
(
intf
,
driver
->
id_table
);
if
(
id
)
{
d
bg
(
"%s - got id
"
,
__FUNCTION__
);
d
ev_dbg
(
*
dev
,
"%s - got id
\n
"
,
__FUNCTION__
);
down
(
&
driver
->
serialize
);
error
=
driver
->
probe
(
intf
,
id
);
up
(
&
driver
->
serialize
);
...
...
@@ -118,7 +118,7 @@ int usb_device_remove(struct device *dev)
driver
=
to_usb_driver
(
dev
->
driver
);
if
(
!
driver
)
{
err
(
"%s does not have a valid driver to work with!"
,
dev_err
(
*
dev
,
"%s does not have a valid driver to work with!"
,
__FUNCTION__
);
return
-
ENODEV
;
}
...
...
@@ -126,7 +126,7 @@ int usb_device_remove(struct device *dev)
if
(
!
try_module_get
(
driver
->
owner
))
{
// FIXME this happens even when we just rmmod
// drivers that aren't in active use...
err
(
"Dieing driver still bound to device.
\n
"
);
dev_err
(
*
dev
,
"Dieing driver still bound to device.
\n
"
);
return
-
EIO
;
}
...
...
@@ -1042,7 +1042,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
wait_ms
(
200
);
}
if
(
err
<
0
)
{
err
(
"USB device not accepting new address=%d (error=%d)
"
,
dev_err
(
dev
->
dev
,
"USB device not accepting new address=%d (error=%d)
\n
"
,
dev
->
devnum
,
err
);
clear_bit
(
dev
->
devnum
,
dev
->
bus
->
devmap
.
devicemap
);
dev
->
devnum
=
-
1
;
...
...
@@ -1060,9 +1060,9 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
if
(
err
<
8
)
{
if
(
err
<
0
)
err
(
"USB device not responding, giving up (error=%d)
"
,
err
);
dev_err
(
dev
->
dev
,
"USB device not responding, giving up (error=%d)
\n
"
,
err
);
else
err
(
"USB device descriptor short read (expected %i, got %i)
"
,
8
,
err
);
dev_err
(
dev
->
dev
,
"USB device descriptor short read (expected %i, got %i)
\n
"
,
8
,
err
);
clear_bit
(
dev
->
devnum
,
dev
->
bus
->
devmap
.
devicemap
);
dev
->
devnum
=
-
1
;
return
1
;
...
...
@@ -1077,9 +1077,9 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
err
=
usb_get_device_descriptor
(
dev
);
if
(
err
<
(
signed
)
sizeof
(
dev
->
descriptor
))
{
if
(
err
<
0
)
err
(
"unable to get device descriptor (error=%d)
"
,
err
);
dev_err
(
dev
->
dev
,
"unable to get device descriptor (error=%d)
\n
"
,
err
);
else
err
(
"USB device descriptor short read (expected %Zi, got %i)
"
,
dev_err
(
dev
->
dev
,
"USB device descriptor short read (expected %Zi, got %i)
\n
"
,
sizeof
(
dev
->
descriptor
),
err
);
clear_bit
(
dev
->
devnum
,
dev
->
bus
->
devmap
.
devicemap
);
...
...
@@ -1089,7 +1089,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
err
=
usb_get_configuration
(
dev
);
if
(
err
<
0
)
{
err
(
"unable to get device %d configuration (error=%d)
"
,
dev_err
(
dev
->
dev
,
"unable to get device %d configuration (error=%d)
\n
"
,
dev
->
devnum
,
err
);
clear_bit
(
dev
->
devnum
,
dev
->
bus
->
devmap
.
devicemap
);
dev
->
devnum
=
-
1
;
...
...
@@ -1099,7 +1099,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
/* we set the default configuration here */
err
=
usb_set_configuration
(
dev
,
dev
->
config
[
0
].
desc
.
bConfigurationValue
);
if
(
err
)
{
err
(
"failed to set device %d default configuration (error=%d)
"
,
dev_err
(
dev
->
dev
,
"failed to set device %d default configuration (error=%d)
\n
"
,
dev
->
devnum
,
err
);
clear_bit
(
dev
->
devnum
,
dev
->
bus
->
devmap
.
devicemap
);
dev
->
devnum
=
-
1
;
...
...
@@ -1151,7 +1151,7 @@ int usb_new_device(struct usb_device *dev, struct device *parent)
dev
->
bus
->
bus_name
,
dev
->
devpath
,
desc
->
bInterfaceNumber
);
}
d
bg
(
"%s - registering %s
"
,
__FUNCTION__
,
interface
->
dev
.
bus_id
);
d
ev_dbg
(
dev
->
dev
,
"%s - registering interface %s
\n
"
,
__FUNCTION__
,
interface
->
dev
.
bus_id
);
device_add
(
&
interface
->
dev
);
usb_create_driverfs_intf_files
(
interface
);
}
...
...
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