Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195521
b: refs/heads/master
c: cbd3af5
h: refs/heads/master
i:
  195519: 45faa97
v: v3
  • Loading branch information
Felipe Contreras authored and Greg Kroah-Hartman committed May 20, 2010
1 parent 2d116f4 commit 645f75b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 28f27dcbd255b44a30bf75bb438fdb3415fda4c7
refs/heads/master: cbd3af54642ec1146bac0479538d495fc474318e
61 changes: 32 additions & 29 deletions trunk/drivers/usb/storage/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ static int get_device_info(struct us_data *us, const struct usb_device_id *id,
struct usb_device *dev = us->pusb_dev;
struct usb_interface_descriptor *idesc =
&us->pusb_intf->cur_altsetting->desc;
struct device *pdev = &us->pusb_intf->dev;

/* Store the entries */
us->unusual_dev = unusual_dev;
Expand All @@ -523,7 +524,7 @@ static int get_device_info(struct us_data *us, const struct usb_device_id *id,
adjust_quirks(us);

if (us->fflags & US_FL_IGNORE_DEVICE) {
printk(KERN_INFO USB_STORAGE "device ignored\n");
dev_info(pdev, "device ignored\n");
return -ENODEV;
}

Expand Down Expand Up @@ -554,20 +555,20 @@ static int get_device_info(struct us_data *us, const struct usb_device_id *id,
us->protocol == idesc->bInterfaceProtocol)
msg += 2;
if (msg >= 0 && !(us->fflags & US_FL_NEED_OVERRIDE))
printk(KERN_NOTICE USB_STORAGE "This device "
"(%04x,%04x,%04x S %02x P %02x)"
" has %s in unusual_devs.h (kernel"
" %s)\n"
" Please send a copy of this message to "
"<linux-usb@vger.kernel.org> and "
"<usb-storage@lists.one-eyed-alien.net>\n",
le16_to_cpu(ddesc->idVendor),
le16_to_cpu(ddesc->idProduct),
le16_to_cpu(ddesc->bcdDevice),
idesc->bInterfaceSubClass,
idesc->bInterfaceProtocol,
msgs[msg],
utsname()->release);
dev_notice(pdev, "This device "
"(%04x,%04x,%04x S %02x P %02x)"
" has %s in unusual_devs.h (kernel"
" %s)\n"
" Please send a copy of this message to "
"<linux-usb@vger.kernel.org> and "
"<usb-storage@lists.one-eyed-alien.net>\n",
le16_to_cpu(ddesc->idVendor),
le16_to_cpu(ddesc->idProduct),
le16_to_cpu(ddesc->bcdDevice),
idesc->bInterfaceSubClass,
idesc->bInterfaceProtocol,
msgs[msg],
utsname()->release);
}

return 0;
Expand Down Expand Up @@ -717,8 +718,8 @@ static int usb_stor_acquire_resources(struct us_data *us)
/* Start up our control thread */
th = kthread_run(usb_stor_control_thread, us, "usb-storage");
if (IS_ERR(th)) {
printk(KERN_WARNING USB_STORAGE
"Unable to start control thread\n");
dev_warn(&us->pusb_intf->dev,
"Unable to start control thread\n");
return PTR_ERR(th);
}
us->ctl_thread = th;
Expand Down Expand Up @@ -811,13 +812,14 @@ static void release_everything(struct us_data *us)
static int usb_stor_scan_thread(void * __us)
{
struct us_data *us = (struct us_data *)__us;
struct device *dev = &us->pusb_intf->dev;

dev_dbg(&us->pusb_intf->dev, "device found\n");
dev_dbg(dev, "device found\n");

set_freezable();
/* Wait for the timeout to expire or for a disconnect */
if (delay_use > 0) {
dev_dbg(&us->pusb_intf->dev, "waiting for device to settle "
dev_dbg(dev, "waiting for device to settle "
"before scanning\n");
wait_event_freezable_timeout(us->delay_wait,
test_bit(US_FLIDX_DONT_SCAN, &us->dflags),
Expand All @@ -835,7 +837,7 @@ static int usb_stor_scan_thread(void * __us)
mutex_unlock(&us->dev_mutex);
}
scsi_scan_host(us_to_host(us));
dev_dbg(&us->pusb_intf->dev, "scan complete\n");
dev_dbg(dev, "scan complete\n");

/* Should we unbind if no devices were detected? */
}
Expand Down Expand Up @@ -871,8 +873,8 @@ int usb_stor_probe1(struct us_data **pus,
*/
host = scsi_host_alloc(&usb_stor_host_template, sizeof(*us));
if (!host) {
printk(KERN_WARNING USB_STORAGE
"Unable to allocate the scsi host\n");
dev_warn(&intf->dev,
"Unable to allocate the scsi host\n");
return -ENOMEM;
}

Expand Down Expand Up @@ -920,6 +922,7 @@ int usb_stor_probe2(struct us_data *us)
{
struct task_struct *th;
int result;
struct device *dev = &us->pusb_intf->dev;

/* Make sure the transport and protocol have both been set */
if (!us->transport || !us->proto_handler) {
Expand All @@ -944,18 +947,18 @@ int usb_stor_probe2(struct us_data *us)
goto BadDevice;
snprintf(us->scsi_name, sizeof(us->scsi_name), "usb-storage %s",
dev_name(&us->pusb_intf->dev));
result = scsi_add_host(us_to_host(us), &us->pusb_intf->dev);
result = scsi_add_host(us_to_host(us), dev);
if (result) {
printk(KERN_WARNING USB_STORAGE
"Unable to add the scsi host\n");
dev_warn(dev,
"Unable to add the scsi host\n");
goto BadDevice;
}

/* Start up the thread for delayed SCSI-device scanning */
th = kthread_create(usb_stor_scan_thread, us, "usb-stor-scan");
if (IS_ERR(th)) {
printk(KERN_WARNING USB_STORAGE
"Unable to start the device-scanning thread\n");
dev_warn(dev,
"Unable to start the device-scanning thread\n");
complete(&us->scanning_done);
quiesce_and_remove_host(us);
result = PTR_ERR(th);
Expand Down Expand Up @@ -1041,12 +1044,12 @@ static int __init usb_stor_init(void)
{
int retval;

printk(KERN_INFO "Initializing USB Mass Storage driver...\n");
pr_info("Initializing USB Mass Storage driver...\n");

/* register the driver, return usb_register return code if error */
retval = usb_register(&usb_storage_driver);
if (retval == 0) {
printk(KERN_INFO "USB Mass Storage support registered.\n");
pr_info("USB Mass Storage support registered.\n");
usb_usual_set_present(USB_US_TYPE_STOR);
}
return retval;
Expand Down

0 comments on commit 645f75b

Please sign in to comment.