Commit 4b3ef391 authored by Fabio Falzoi's avatar Fabio Falzoi Committed by Greg Kroah-Hartman

Staging: rts5139: Use standard pr_<level> prefixing

Define pr_fmt macro to prefix every pr_<level> function in standard way.
Signed-off-by: default avatarFabio Falzoi <fabio.falzoi84@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7cb61930
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
* No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China * No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -109,13 +111,13 @@ static inline void usb_autopm_disable(struct usb_interface *intf) ...@@ -109,13 +111,13 @@ static inline void usb_autopm_disable(struct usb_interface *intf)
static void rts51x_try_to_enter_ss(struct rts51x_chip *chip) static void rts51x_try_to_enter_ss(struct rts51x_chip *chip)
{ {
RTS51X_DEBUGP("Ready to enter SS state\n"); pr_debug("Ready to enter SS state\n");
usb_autopm_enable(chip->usb->pusb_intf); usb_autopm_enable(chip->usb->pusb_intf);
} }
void rts51x_try_to_exit_ss(struct rts51x_chip *chip) void rts51x_try_to_exit_ss(struct rts51x_chip *chip)
{ {
RTS51X_DEBUGP("Exit from SS state\n"); pr_debug("Exit from SS state\n");
usb_autopm_disable(chip->usb->pusb_intf); usb_autopm_disable(chip->usb->pusb_intf);
} }
...@@ -123,7 +125,7 @@ int rts51x_suspend(struct usb_interface *iface, pm_message_t message) ...@@ -123,7 +125,7 @@ int rts51x_suspend(struct usb_interface *iface, pm_message_t message)
{ {
struct rts51x_chip *chip = usb_get_intfdata(iface); struct rts51x_chip *chip = usb_get_intfdata(iface);
RTS51X_DEBUGP("%s, message.event = 0x%x\n", __func__, message.event); pr_debug("%s, message.event = 0x%x\n", __func__, message.event);
/* Wait until no command is running */ /* Wait until no command is running */
mutex_lock(&chip->usb->dev_mutex); mutex_lock(&chip->usb->dev_mutex);
...@@ -132,11 +134,11 @@ int rts51x_suspend(struct usb_interface *iface, pm_message_t message) ...@@ -132,11 +134,11 @@ int rts51x_suspend(struct usb_interface *iface, pm_message_t message)
rts51x_do_before_power_down(chip); rts51x_do_before_power_down(chip);
if (message.event == PM_EVENT_AUTO_SUSPEND) { if (message.event == PM_EVENT_AUTO_SUSPEND) {
RTS51X_DEBUGP("Enter SS state"); pr_debug("Enter SS state");
chip->resume_from_scsi = 0; chip->resume_from_scsi = 0;
RTS51X_SET_STAT(chip, STAT_SS); RTS51X_SET_STAT(chip, STAT_SS);
} else { } else {
RTS51X_DEBUGP("Enter SUSPEND state"); pr_debug("Enter SUSPEND state");
RTS51X_SET_STAT(chip, STAT_SUSPEND); RTS51X_SET_STAT(chip, STAT_SUSPEND);
} }
...@@ -151,7 +153,7 @@ int rts51x_resume(struct usb_interface *iface) ...@@ -151,7 +153,7 @@ int rts51x_resume(struct usb_interface *iface)
{ {
struct rts51x_chip *chip = usb_get_intfdata(iface); struct rts51x_chip *chip = usb_get_intfdata(iface);
RTS51X_DEBUGP("%s\n", __func__); pr_debug("%s\n", __func__);
if (!RTS51X_CHK_STAT(chip, STAT_SS) || !chip->resume_from_scsi) { if (!RTS51X_CHK_STAT(chip, STAT_SS) || !chip->resume_from_scsi) {
mutex_lock(&chip->usb->dev_mutex); mutex_lock(&chip->usb->dev_mutex);
...@@ -159,7 +161,7 @@ int rts51x_resume(struct usb_interface *iface) ...@@ -159,7 +161,7 @@ int rts51x_resume(struct usb_interface *iface)
if (chip->option.ss_en) { if (chip->option.ss_en) {
if (GET_PM_USAGE_CNT(chip) <= 0) { if (GET_PM_USAGE_CNT(chip) <= 0) {
/* Remote wake up, increase pm_usage_cnt */ /* Remote wake up, increase pm_usage_cnt */
RTS51X_DEBUGP("Incr pm_usage_cnt\n"); pr_debug("Incr pm_usage_cnt\n");
SET_PM_USAGE_CNT(chip, 1); SET_PM_USAGE_CNT(chip, 1);
} }
} }
...@@ -179,7 +181,7 @@ int rts51x_reset_resume(struct usb_interface *iface) ...@@ -179,7 +181,7 @@ int rts51x_reset_resume(struct usb_interface *iface)
{ {
struct rts51x_chip *chip = usb_get_intfdata(iface); struct rts51x_chip *chip = usb_get_intfdata(iface);
RTS51X_DEBUGP("%s\n", __func__); pr_debug("%s\n", __func__);
mutex_lock(&chip->usb->dev_mutex); mutex_lock(&chip->usb->dev_mutex);
...@@ -219,7 +221,7 @@ static int rts51x_pre_reset(struct usb_interface *iface) ...@@ -219,7 +221,7 @@ static int rts51x_pre_reset(struct usb_interface *iface)
{ {
struct rts51x_chip *chip = usb_get_intfdata(iface); struct rts51x_chip *chip = usb_get_intfdata(iface);
RTS51X_DEBUGP("%s\n", __func__); pr_debug("%s\n", __func__);
/* Make sure no command runs during the reset */ /* Make sure no command runs during the reset */
mutex_lock(&chip->usb->dev_mutex); mutex_lock(&chip->usb->dev_mutex);
...@@ -230,7 +232,7 @@ static int rts51x_post_reset(struct usb_interface *iface) ...@@ -230,7 +232,7 @@ static int rts51x_post_reset(struct usb_interface *iface)
{ {
struct rts51x_chip *chip = usb_get_intfdata(iface); struct rts51x_chip *chip = usb_get_intfdata(iface);
RTS51X_DEBUGP("%s\n", __func__); pr_debug("%s\n", __func__);
/* Report the reset to the SCSI core */ /* Report the reset to the SCSI core */
/* usb_stor_report_bus_reset(us); */ /* usb_stor_report_bus_reset(us); */
...@@ -252,7 +254,7 @@ static int rts51x_control_thread(void *__chip) ...@@ -252,7 +254,7 @@ static int rts51x_control_thread(void *__chip)
break; break;
if (test_bit(FLIDX_DISCONNECTING, &chip->usb->dflags)) { if (test_bit(FLIDX_DISCONNECTING, &chip->usb->dflags)) {
RTS51X_DEBUGP("-- exiting from rts51x-control\n"); pr_debug("-- exiting from rts51x-control\n");
break; break;
} }
...@@ -266,7 +268,7 @@ static int rts51x_control_thread(void *__chip) ...@@ -266,7 +268,7 @@ static int rts51x_control_thread(void *__chip)
if (chip->srb == NULL) { if (chip->srb == NULL) {
scsi_unlock(host); scsi_unlock(host);
mutex_unlock(&chip->usb->dev_mutex); mutex_unlock(&chip->usb->dev_mutex);
RTS51X_DEBUGP("-- exiting from control thread\n"); pr_debug("-- exiting from control thread\n");
break; break;
} }
...@@ -282,7 +284,7 @@ static int rts51x_control_thread(void *__chip) ...@@ -282,7 +284,7 @@ static int rts51x_control_thread(void *__chip)
* is UNKNOWN * is UNKNOWN
*/ */
if (chip->srb->sc_data_direction == DMA_BIDIRECTIONAL) { if (chip->srb->sc_data_direction == DMA_BIDIRECTIONAL) {
RTS51X_DEBUGP("UNKNOWN data direction\n"); pr_debug("UNKNOWN data direction\n");
chip->srb->result = DID_ERROR << 16; chip->srb->result = DID_ERROR << 16;
} }
...@@ -290,14 +292,14 @@ static int rts51x_control_thread(void *__chip) ...@@ -290,14 +292,14 @@ static int rts51x_control_thread(void *__chip)
* the maximum known LUN * the maximum known LUN
*/ */
else if (chip->srb->device->id) { else if (chip->srb->device->id) {
RTS51X_DEBUGP("Bad target number (%d:%d)\n", pr_debug("Bad target number (%d:%d)\n",
chip->srb->device->id, chip->srb->device->id,
chip->srb->device->lun); chip->srb->device->lun);
chip->srb->result = DID_BAD_TARGET << 16; chip->srb->result = DID_BAD_TARGET << 16;
} }
else if (chip->srb->device->lun > chip->max_lun) { else if (chip->srb->device->lun > chip->max_lun) {
RTS51X_DEBUGP("Bad LUN (%d:%d)\n", pr_debug("Bad LUN (%d:%d)\n",
chip->srb->device->id, chip->srb->device->id,
chip->srb->device->lun); chip->srb->device->lun);
chip->srb->result = DID_BAD_TARGET << 16; chip->srb->result = DID_BAD_TARGET << 16;
...@@ -317,7 +319,7 @@ static int rts51x_control_thread(void *__chip) ...@@ -317,7 +319,7 @@ static int rts51x_control_thread(void *__chip)
chip->srb->scsi_done(chip->srb); chip->srb->scsi_done(chip->srb);
else else
abort : abort :
RTS51X_DEBUGP("scsi command aborted\n"); pr_debug("scsi command aborted\n");
/* If an abort request was received we need to signal that /* If an abort request was received we need to signal that
* the abort has finished. The proper test for this is * the abort has finished. The proper test for this is
...@@ -362,7 +364,7 @@ static int rts51x_polling_thread(void *__chip) ...@@ -362,7 +364,7 @@ static int rts51x_polling_thread(void *__chip)
/* if the device has disconnected, we are free to exit */ /* if the device has disconnected, we are free to exit */
if (test_bit(FLIDX_DISCONNECTING, &chip->usb->dflags)) { if (test_bit(FLIDX_DISCONNECTING, &chip->usb->dflags)) {
RTS51X_DEBUGP("-- exiting from rts51x-polling\n"); pr_debug("-- exiting from rts51x-polling\n");
break; break;
} }
...@@ -432,11 +434,11 @@ static int associate_dev(struct rts51x_chip *chip, struct usb_interface *intf) ...@@ -432,11 +434,11 @@ static int associate_dev(struct rts51x_chip *chip, struct usb_interface *intf)
rts51x->pusb_dev = interface_to_usbdev(intf); rts51x->pusb_dev = interface_to_usbdev(intf);
rts51x->pusb_intf = intf; rts51x->pusb_intf = intf;
rts51x->ifnum = intf->cur_altsetting->desc.bInterfaceNumber; rts51x->ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
RTS51X_DEBUGP("Vendor: 0x%04x, Product: 0x%04x, Revision: 0x%04x\n", pr_debug("Vendor: 0x%04x, Product: 0x%04x, Revision: 0x%04x\n",
le16_to_cpu(rts51x->pusb_dev->descriptor.idVendor), le16_to_cpu(rts51x->pusb_dev->descriptor.idVendor),
le16_to_cpu(rts51x->pusb_dev->descriptor.idProduct), le16_to_cpu(rts51x->pusb_dev->descriptor.idProduct),
le16_to_cpu(rts51x->pusb_dev->descriptor.bcdDevice)); le16_to_cpu(rts51x->pusb_dev->descriptor.bcdDevice));
RTS51X_DEBUGP("Interface Subclass: 0x%02x, Protocol: 0x%02x\n", pr_debug("Interface Subclass: 0x%02x, Protocol: 0x%02x\n",
intf->cur_altsetting->desc.bInterfaceSubClass, intf->cur_altsetting->desc.bInterfaceSubClass,
intf->cur_altsetting->desc.bInterfaceProtocol); intf->cur_altsetting->desc.bInterfaceProtocol);
...@@ -448,7 +450,7 @@ static int associate_dev(struct rts51x_chip *chip, struct usb_interface *intf) ...@@ -448,7 +450,7 @@ static int associate_dev(struct rts51x_chip *chip, struct usb_interface *intf)
retval = usb_register_dev(intf, &rts51x_class); retval = usb_register_dev(intf, &rts51x_class);
if (retval) { if (retval) {
/* something prevented us from registering this driver */ /* something prevented us from registering this driver */
RTS51X_DEBUGP("Not able to get a minor for this device."); pr_debug("Not able to get a minor for this device.");
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
return -ENOMEM; return -ENOMEM;
} }
...@@ -458,7 +460,7 @@ static int associate_dev(struct rts51x_chip *chip, struct usb_interface *intf) ...@@ -458,7 +460,7 @@ static int associate_dev(struct rts51x_chip *chip, struct usb_interface *intf)
rts51x->cr = usb_buffer_alloc(rts51x->pusb_dev, sizeof(*rts51x->cr), rts51x->cr = usb_buffer_alloc(rts51x->pusb_dev, sizeof(*rts51x->cr),
GFP_KERNEL, &rts51x->cr_dma); GFP_KERNEL, &rts51x->cr_dma);
if (!rts51x->cr) { if (!rts51x->cr) {
RTS51X_DEBUGP("usb_ctrlrequest allocation failed\n"); pr_debug("usb_ctrlrequest allocation failed\n");
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
return -ENOMEM; return -ENOMEM;
} }
...@@ -466,7 +468,7 @@ static int associate_dev(struct rts51x_chip *chip, struct usb_interface *intf) ...@@ -466,7 +468,7 @@ static int associate_dev(struct rts51x_chip *chip, struct usb_interface *intf)
rts51x->iobuf = usb_buffer_alloc(rts51x->pusb_dev, RTS51X_IOBUF_SIZE, rts51x->iobuf = usb_buffer_alloc(rts51x->pusb_dev, RTS51X_IOBUF_SIZE,
GFP_KERNEL, &rts51x->iobuf_dma); GFP_KERNEL, &rts51x->iobuf_dma);
if (!rts51x->iobuf) { if (!rts51x->iobuf) {
RTS51X_DEBUGP("I/O buffer allocation failed\n"); pr_debug("I/O buffer allocation failed\n");
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
return -ENOMEM; return -ENOMEM;
} }
...@@ -569,7 +571,7 @@ static int get_pipes(struct rts51x_chip *chip) ...@@ -569,7 +571,7 @@ static int get_pipes(struct rts51x_chip *chip)
} }
if (!ep_in || !ep_out) { if (!ep_in || !ep_out) {
RTS51X_DEBUGP("Endpoint sanity check failed! Rejecting dev.\n"); pr_debug("Endpoint sanity check failed! Rejecting dev.\n");
return -EIO; return -EIO;
} }
...@@ -597,13 +599,13 @@ static int rts51x_acquire_resources(struct rts51x_chip *chip) ...@@ -597,13 +599,13 @@ static int rts51x_acquire_resources(struct rts51x_chip *chip)
rts51x->current_urb = usb_alloc_urb(0, GFP_KERNEL); rts51x->current_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!rts51x->current_urb) { if (!rts51x->current_urb) {
RTS51X_DEBUGP("URB allocation failed\n"); pr_debug("URB allocation failed\n");
return -ENOMEM; return -ENOMEM;
} }
rts51x->intr_urb = usb_alloc_urb(0, GFP_KERNEL); rts51x->intr_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!rts51x->intr_urb) { if (!rts51x->intr_urb) {
RTS51X_DEBUGP("URB allocation failed\n"); pr_debug("URB allocation failed\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -623,13 +625,13 @@ static int rts51x_acquire_resources(struct rts51x_chip *chip) ...@@ -623,13 +625,13 @@ static int rts51x_acquire_resources(struct rts51x_chip *chip)
/* Release all our dynamic resources */ /* Release all our dynamic resources */
static void rts51x_release_resources(struct rts51x_chip *chip) static void rts51x_release_resources(struct rts51x_chip *chip)
{ {
RTS51X_DEBUGP("-- %s\n", __func__); pr_debug("-- %s\n", __func__);
/* Tell the control thread to exit. The SCSI host must /* Tell the control thread to exit. The SCSI host must
* already have been removed and the DISCONNECTING flag set * already have been removed and the DISCONNECTING flag set
* so that we won't accept any more commands. * so that we won't accept any more commands.
*/ */
RTS51X_DEBUGP("-- sending exit command to thread\n"); pr_debug("-- sending exit command to thread\n");
complete(&chip->usb->cmnd_ready); complete(&chip->usb->cmnd_ready);
if (chip->usb->ctl_thread) if (chip->usb->ctl_thread)
wait_for_completion(&chip->usb->control_exit); wait_for_completion(&chip->usb->control_exit);
...@@ -654,7 +656,7 @@ static void dissociate_dev(struct rts51x_chip *chip) ...@@ -654,7 +656,7 @@ static void dissociate_dev(struct rts51x_chip *chip)
{ {
struct rts51x_usb *rts51x = chip->usb; struct rts51x_usb *rts51x = chip->usb;
RTS51X_DEBUGP("-- %s\n", __func__); pr_debug("-- %s\n", __func__);
/* Free the device-related DMA-mapped buffers */ /* Free the device-related DMA-mapped buffers */
if (rts51x->cr) if (rts51x->cr)
...@@ -721,11 +723,11 @@ static int rts51x_probe(struct usb_interface *intf, ...@@ -721,11 +723,11 @@ static int rts51x_probe(struct usb_interface *intf,
int result; int result;
struct task_struct *th; struct task_struct *th;
RTS51X_DEBUGP("%s detected\n", RTS51X_NAME); pr_debug("%s detected\n", RTS51X_NAME);
rts51x = kzalloc(sizeof(struct rts51x_usb), GFP_KERNEL); rts51x = kzalloc(sizeof(struct rts51x_usb), GFP_KERNEL);
if (!rts51x) { if (!rts51x) {
printk(KERN_WARNING RTS51X_TIP pr_warn(RTS51X_TIP
"Unable to allocate rts51x_usb\n"); "Unable to allocate rts51x_usb\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -736,7 +738,7 @@ static int rts51x_probe(struct usb_interface *intf, ...@@ -736,7 +738,7 @@ static int rts51x_probe(struct usb_interface *intf,
*/ */
host = scsi_host_alloc(&rts51x_host_template, sizeof(*chip)); host = scsi_host_alloc(&rts51x_host_template, sizeof(*chip));
if (!host) { if (!host) {
printk(KERN_WARNING RTS51X_TIP pr_warn(RTS51X_TIP
"Unable to allocate the scsi host\n"); "Unable to allocate the scsi host\n");
kfree(rts51x); kfree(rts51x);
return -ENOMEM; return -ENOMEM;
...@@ -778,8 +780,7 @@ static int rts51x_probe(struct usb_interface *intf, ...@@ -778,8 +780,7 @@ static int rts51x_probe(struct usb_interface *intf,
/* Start up our control thread */ /* Start up our control thread */
th = kthread_run(rts51x_control_thread, chip, RTS51X_CTL_THREAD); th = kthread_run(rts51x_control_thread, chip, RTS51X_CTL_THREAD);
if (IS_ERR(th)) { if (IS_ERR(th)) {
printk(KERN_WARNING RTS51X_TIP pr_warn("Unable to start control thread\n");
"Unable to start control thread\n");
result = PTR_ERR(th); result = PTR_ERR(th);
goto bad_device; goto bad_device;
} }
...@@ -787,7 +788,7 @@ static int rts51x_probe(struct usb_interface *intf, ...@@ -787,7 +788,7 @@ static int rts51x_probe(struct usb_interface *intf,
result = scsi_add_host(rts51x_to_host(chip), &rts51x->pusb_intf->dev); result = scsi_add_host(rts51x_to_host(chip), &rts51x->pusb_intf->dev);
if (result) { if (result) {
printk(KERN_WARNING RTS51X_TIP "Unable to add the scsi host\n"); pr_warn("Unable to add the scsi host\n");
goto bad_device; goto bad_device;
} }
scsi_scan_host(rts51x_to_host(chip)); scsi_scan_host(rts51x_to_host(chip));
...@@ -795,8 +796,7 @@ static int rts51x_probe(struct usb_interface *intf, ...@@ -795,8 +796,7 @@ static int rts51x_probe(struct usb_interface *intf,
/* Start up our polling thread */ /* Start up our polling thread */
th = kthread_run(rts51x_polling_thread, chip, RTS51X_POLLING_THREAD); th = kthread_run(rts51x_polling_thread, chip, RTS51X_POLLING_THREAD);
if (IS_ERR(th)) { if (IS_ERR(th)) {
printk(KERN_WARNING RTS51X_TIP pr_warn("Unable to start polling thread\n");
"Unable to start polling thread\n");
result = PTR_ERR(th); result = PTR_ERR(th);
goto bad_device; goto bad_device;
} }
...@@ -806,7 +806,7 @@ static int rts51x_probe(struct usb_interface *intf, ...@@ -806,7 +806,7 @@ static int rts51x_probe(struct usb_interface *intf,
if (ss_en) { if (ss_en) {
rts51x->pusb_intf->needs_remote_wakeup = needs_remote_wakeup; rts51x->pusb_intf->needs_remote_wakeup = needs_remote_wakeup;
SET_PM_USAGE_CNT(chip, 1); SET_PM_USAGE_CNT(chip, 1);
RTS51X_DEBUGP("pm_usage_cnt = %d\n", GET_PM_USAGE_CNT(chip)); pr_debug("pm_usage_cnt = %d\n", GET_PM_USAGE_CNT(chip));
} }
#endif #endif
...@@ -814,7 +814,7 @@ static int rts51x_probe(struct usb_interface *intf, ...@@ -814,7 +814,7 @@ static int rts51x_probe(struct usb_interface *intf,
/* We come here if there are any problems */ /* We come here if there are any problems */
bad_device: bad_device:
RTS51X_DEBUGP("rts51x_probe() failed\n"); pr_debug("rts51x_probe() failed\n");
release_everything(chip); release_everything(chip);
return result; return result;
} }
...@@ -823,7 +823,7 @@ static void rts51x_disconnect(struct usb_interface *intf) ...@@ -823,7 +823,7 @@ static void rts51x_disconnect(struct usb_interface *intf)
{ {
struct rts51x_chip *chip = (struct rts51x_chip *)usb_get_intfdata(intf); struct rts51x_chip *chip = (struct rts51x_chip *)usb_get_intfdata(intf);
RTS51X_DEBUGP("rts51x_disconnect() called\n"); pr_debug("rts51x_disconnect() called\n");
quiesce_and_remove_host(chip); quiesce_and_remove_host(chip);
release_everything(chip); release_everything(chip);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment