aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@csr.com>2008-12-22 13:22:50 -0500
committerDavid Vrabel <david.vrabel@csr.com>2008-12-22 13:22:50 -0500
commitbce83697c5fe84a7a5d38c96fbbe43b4bc028c3e (patch)
treeb8e920af66f5b4de509e95a7295cedbe42878dd6 /drivers/usb/host
parent02f11ee181baa562df23e105ba930902f0d0b1bf (diff)
uwb: use dev_dbg() for debug messages
Instead of the home-grown d_fnstart(), d_fnend() and d_printf() macros, use dev_dbg() or remove the message entirely. Signed-off-by: David Vrabel <david.vrabel@csr.com>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/hwa-hc.c55
1 files changed, 7 insertions, 48 deletions
diff --git a/drivers/usb/host/hwa-hc.c b/drivers/usb/host/hwa-hc.c
index 2a4d36fa70b0..8582236e4cad 100644
--- a/drivers/usb/host/hwa-hc.c
+++ b/drivers/usb/host/hwa-hc.c
@@ -62,16 +62,12 @@
62#include "../wusbcore/wa-hc.h" 62#include "../wusbcore/wa-hc.h"
63#include "../wusbcore/wusbhc.h" 63#include "../wusbcore/wusbhc.h"
64 64
65#define D_LOCAL 0
66#include <linux/uwb/debug.h>
67
68struct hwahc { 65struct hwahc {
69 struct wusbhc wusbhc; /* has to be 1st */ 66 struct wusbhc wusbhc; /* has to be 1st */
70 struct wahc wa; 67 struct wahc wa;
71 u8 buffer[16]; /* for misc usb transactions */
72}; 68};
73 69
74/** 70/*
75 * FIXME should be wusbhc 71 * FIXME should be wusbhc
76 * 72 *
77 * NOTE: we need to cache the Cluster ID because later...there is no 73 * NOTE: we need to cache the Cluster ID because later...there is no
@@ -125,7 +121,6 @@ static int hwahc_op_reset(struct usb_hcd *usb_hcd)
125 struct hwahc *hwahc = container_of(wusbhc, struct hwahc, wusbhc); 121 struct hwahc *hwahc = container_of(wusbhc, struct hwahc, wusbhc);
126 struct device *dev = &hwahc->wa.usb_iface->dev; 122 struct device *dev = &hwahc->wa.usb_iface->dev;
127 123
128 d_fnstart(4, dev, "(hwahc %p)\n", hwahc);
129 mutex_lock(&wusbhc->mutex); 124 mutex_lock(&wusbhc->mutex);
130 wa_nep_disarm(&hwahc->wa); 125 wa_nep_disarm(&hwahc->wa);
131 result = __wa_set_feature(&hwahc->wa, WA_RESET); 126 result = __wa_set_feature(&hwahc->wa, WA_RESET);
@@ -133,7 +128,6 @@ static int hwahc_op_reset(struct usb_hcd *usb_hcd)
133 dev_err(dev, "error commanding HC to reset: %d\n", result); 128 dev_err(dev, "error commanding HC to reset: %d\n", result);
134 goto error_unlock; 129 goto error_unlock;
135 } 130 }
136 d_printf(3, dev, "reset: waiting for device to change state\n");
137 result = __wa_wait_status(&hwahc->wa, WA_STATUS_RESETTING, 0); 131 result = __wa_wait_status(&hwahc->wa, WA_STATUS_RESETTING, 0);
138 if (result < 0) { 132 if (result < 0) {
139 dev_err(dev, "error waiting for HC to reset: %d\n", result); 133 dev_err(dev, "error waiting for HC to reset: %d\n", result);
@@ -141,7 +135,6 @@ static int hwahc_op_reset(struct usb_hcd *usb_hcd)
141 } 135 }
142error_unlock: 136error_unlock:
143 mutex_unlock(&wusbhc->mutex); 137 mutex_unlock(&wusbhc->mutex);
144 d_fnend(4, dev, "(hwahc %p) = %d\n", hwahc, result);
145 return result; 138 return result;
146} 139}
147 140
@@ -154,15 +147,9 @@ static int hwahc_op_start(struct usb_hcd *usb_hcd)
154 int result; 147 int result;
155 struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd); 148 struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd);
156 struct hwahc *hwahc = container_of(wusbhc, struct hwahc, wusbhc); 149 struct hwahc *hwahc = container_of(wusbhc, struct hwahc, wusbhc);
157 struct device *dev = &hwahc->wa.usb_iface->dev;
158 150
159 /* Set up a Host Info WUSB Information Element */
160 d_fnstart(4, dev, "(hwahc %p)\n", hwahc);
161 result = -ENOSPC; 151 result = -ENOSPC;
162 mutex_lock(&wusbhc->mutex); 152 mutex_lock(&wusbhc->mutex);
163 /* Start the numbering from the top so that the bottom
164 * range of the unauth addr space is used for devices,
165 * the top for HCs; use 0xfe - RC# */
166 addr = wusb_cluster_id_get(); 153 addr = wusb_cluster_id_get();
167 if (addr == 0) 154 if (addr == 0)
168 goto error_cluster_id_get; 155 goto error_cluster_id_get;
@@ -176,7 +163,6 @@ static int hwahc_op_start(struct usb_hcd *usb_hcd)
176 result = 0; 163 result = 0;
177out: 164out:
178 mutex_unlock(&wusbhc->mutex); 165 mutex_unlock(&wusbhc->mutex);
179 d_fnend(4, dev, "(hwahc %p) = %d\n", hwahc, result);
180 return result; 166 return result;
181 167
182error_set_cluster_id: 168error_set_cluster_id:
@@ -213,18 +199,11 @@ static int hwahc_op_resume(struct usb_hcd *usb_hcd)
213 */ 199 */
214static void hwahc_op_stop(struct usb_hcd *usb_hcd) 200static void hwahc_op_stop(struct usb_hcd *usb_hcd)
215{ 201{
216 int result;
217 struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd); 202 struct wusbhc *wusbhc = usb_hcd_to_wusbhc(usb_hcd);
218 struct hwahc *hwahc = container_of(wusbhc, struct hwahc, wusbhc);
219 struct wahc *wa = &hwahc->wa;
220 struct device *dev = &wa->usb_iface->dev;
221 203
222 d_fnstart(4, dev, "(hwahc %p)\n", hwahc);
223 mutex_lock(&wusbhc->mutex); 204 mutex_lock(&wusbhc->mutex);
224 wusb_cluster_id_put(wusbhc->cluster_id); 205 wusb_cluster_id_put(wusbhc->cluster_id);
225 mutex_unlock(&wusbhc->mutex); 206 mutex_unlock(&wusbhc->mutex);
226 d_fnend(4, dev, "(hwahc %p) = %d\n", hwahc, result);
227 return;
228} 207}
229 208
230static int hwahc_op_get_frame_number(struct usb_hcd *usb_hcd) 209static int hwahc_op_get_frame_number(struct usb_hcd *usb_hcd)
@@ -573,11 +552,11 @@ static int wa_fill_descr(struct wahc *wa)
573 itr_size = le16_to_cpu(usb_dev->actconfig->desc.wTotalLength); 552 itr_size = le16_to_cpu(usb_dev->actconfig->desc.wTotalLength);
574 while (itr_size >= sizeof(*hdr)) { 553 while (itr_size >= sizeof(*hdr)) {
575 hdr = (struct usb_descriptor_header *) itr; 554 hdr = (struct usb_descriptor_header *) itr;
576 d_printf(3, dev, "Extra device descriptor: " 555 dev_dbg(dev, "Extra device descriptor: "
577 "type %02x/%u bytes @ %zu (%zu left)\n", 556 "type %02x/%u bytes @ %zu (%zu left)\n",
578 hdr->bDescriptorType, hdr->bLength, 557 hdr->bDescriptorType, hdr->bLength,
579 (itr - usb_dev->rawdescriptors[actconfig_idx]), 558 (itr - usb_dev->rawdescriptors[actconfig_idx]),
580 itr_size); 559 itr_size);
581 if (hdr->bDescriptorType == USB_DT_WIRE_ADAPTER) 560 if (hdr->bDescriptorType == USB_DT_WIRE_ADAPTER)
582 goto found; 561 goto found;
583 itr += hdr->bLength; 562 itr += hdr->bLength;
@@ -786,7 +765,6 @@ static void hwahc_destroy(struct hwahc *hwahc)
786{ 765{
787 struct wusbhc *wusbhc = &hwahc->wusbhc; 766 struct wusbhc *wusbhc = &hwahc->wusbhc;
788 767
789 d_fnstart(1, NULL, "(hwahc %p)\n", hwahc);
790 mutex_lock(&wusbhc->mutex); 768 mutex_lock(&wusbhc->mutex);
791 __wa_destroy(&hwahc->wa); 769 __wa_destroy(&hwahc->wa);
792 wusbhc_destroy(&hwahc->wusbhc); 770 wusbhc_destroy(&hwahc->wusbhc);
@@ -796,7 +774,6 @@ static void hwahc_destroy(struct hwahc *hwahc)
796 usb_put_intf(hwahc->wa.usb_iface); 774 usb_put_intf(hwahc->wa.usb_iface);
797 usb_put_dev(hwahc->wa.usb_dev); 775 usb_put_dev(hwahc->wa.usb_dev);
798 mutex_unlock(&wusbhc->mutex); 776 mutex_unlock(&wusbhc->mutex);
799 d_fnend(1, NULL, "(hwahc %p) = void\n", hwahc);
800} 777}
801 778
802static void hwahc_init(struct hwahc *hwahc) 779static void hwahc_init(struct hwahc *hwahc)
@@ -813,7 +790,6 @@ static int hwahc_probe(struct usb_interface *usb_iface,
813 struct hwahc *hwahc; 790 struct hwahc *hwahc;
814 struct device *dev = &usb_iface->dev; 791 struct device *dev = &usb_iface->dev;
815 792
816 d_fnstart(4, dev, "(%p, %p)\n", usb_iface, id);
817 result = -ENOMEM; 793 result = -ENOMEM;
818 usb_hcd = usb_create_hcd(&hwahc_hc_driver, &usb_iface->dev, "wusb-hwa"); 794 usb_hcd = usb_create_hcd(&hwahc_hc_driver, &usb_iface->dev, "wusb-hwa");
819 if (usb_hcd == NULL) { 795 if (usb_hcd == NULL) {
@@ -840,7 +816,6 @@ static int hwahc_probe(struct usb_interface *usb_iface,
840 dev_err(dev, "Cannot setup phase B of WUSBHC: %d\n", result); 816 dev_err(dev, "Cannot setup phase B of WUSBHC: %d\n", result);
841 goto error_wusbhc_b_create; 817 goto error_wusbhc_b_create;
842 } 818 }
843 d_fnend(4, dev, "(%p, %p) = 0\n", usb_iface, id);
844 return 0; 819 return 0;
845 820
846error_wusbhc_b_create: 821error_wusbhc_b_create:
@@ -850,7 +825,6 @@ error_add_hcd:
850error_hwahc_create: 825error_hwahc_create:
851 usb_put_hcd(usb_hcd); 826 usb_put_hcd(usb_hcd);
852error_alloc: 827error_alloc:
853 d_fnend(4, dev, "(%p, %p) = %d\n", usb_iface, id, result);
854 return result; 828 return result;
855} 829}
856 830
@@ -864,16 +838,12 @@ static void hwahc_disconnect(struct usb_interface *usb_iface)
864 wusbhc = usb_hcd_to_wusbhc(usb_hcd); 838 wusbhc = usb_hcd_to_wusbhc(usb_hcd);
865 hwahc = container_of(wusbhc, struct hwahc, wusbhc); 839 hwahc = container_of(wusbhc, struct hwahc, wusbhc);
866 840
867 d_fnstart(1, NULL, "(hwahc %p [usb_iface %p])\n", hwahc, usb_iface);
868 wusbhc_b_destroy(&hwahc->wusbhc); 841 wusbhc_b_destroy(&hwahc->wusbhc);
869 usb_remove_hcd(usb_hcd); 842 usb_remove_hcd(usb_hcd);
870 hwahc_destroy(hwahc); 843 hwahc_destroy(hwahc);
871 usb_put_hcd(usb_hcd); 844 usb_put_hcd(usb_hcd);
872 d_fnend(1, NULL, "(hwahc %p [usb_iface %p]) = void\n", hwahc,
873 usb_iface);
874} 845}
875 846
876/** USB device ID's that we handle */
877static struct usb_device_id hwahc_id_table[] = { 847static struct usb_device_id hwahc_id_table[] = {
878 /* FIXME: use class labels for this */ 848 /* FIXME: use class labels for this */
879 { USB_INTERFACE_INFO(0xe0, 0x02, 0x01), }, 849 { USB_INTERFACE_INFO(0xe0, 0x02, 0x01), },
@@ -890,18 +860,7 @@ static struct usb_driver hwahc_driver = {
890 860
891static int __init hwahc_driver_init(void) 861static int __init hwahc_driver_init(void)
892{ 862{
893 int result; 863 return usb_register(&hwahc_driver);
894 result = usb_register(&hwahc_driver);
895 if (result < 0) {
896 printk(KERN_ERR "WA-CDS: Cannot register USB driver: %d\n",
897 result);
898 goto error_usb_register;
899 }
900 return 0;
901
902error_usb_register:
903 return result;
904
905} 864}
906module_init(hwahc_driver_init); 865module_init(hwahc_driver_init);
907 866