aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-22 18:25:26 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-22 18:25:26 -0400
commit09091a4d5f2dd378dcf71de50b48cdacc58a8ac0 (patch)
treed50e37ebb5591fa1e723f32bde077dbdf726b78b /drivers/usb/misc
parent66f75a5d028beaf67c931435fdc3e7823125730c (diff)
parent3a1c2a82204f5376f484d82cb18189afc2145c77 (diff)
Merge 3.4-rc4 into usb-next.
This resolves the conflict in: drivers/usb/host/ehci-fsl.c And picks up loads of xhci bugfixes to make it easier for others to test with. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc')
-rw-r--r--drivers/usb/misc/emi26.c59
-rw-r--r--drivers/usb/misc/emi62.c62
-rw-r--r--drivers/usb/misc/idmouse.c6
-rw-r--r--drivers/usb/misc/iowarrior.c4
-rw-r--r--drivers/usb/misc/ldusb.c15
-rw-r--r--drivers/usb/misc/legousbtower.c45
-rw-r--r--drivers/usb/misc/rio500.c28
-rw-r--r--drivers/usb/misc/usblcd.c20
-rw-r--r--drivers/usb/misc/uss720.c15
-rw-r--r--drivers/usb/misc/yurex.c40
10 files changed, 139 insertions, 155 deletions
diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c
index da97dcec1f32..d65984dee751 100644
--- a/drivers/usb/misc/emi26.c
+++ b/drivers/usb/misc/emi26.c
@@ -78,18 +78,14 @@ static int emi26_load_firmware (struct usb_device *dev)
78 const struct firmware *bitstream_fw = NULL; 78 const struct firmware *bitstream_fw = NULL;
79 const struct firmware *firmware_fw = NULL; 79 const struct firmware *firmware_fw = NULL;
80 const struct ihex_binrec *rec; 80 const struct ihex_binrec *rec;
81 int err; 81 int err = -ENOMEM;
82 int i; 82 int i;
83 __u32 addr; /* Address to write */ 83 __u32 addr; /* Address to write */
84 __u8 *buf; 84 __u8 *buf;
85 85
86 buf = kmalloc(FW_LOAD_SIZE, GFP_KERNEL); 86 buf = kmalloc(FW_LOAD_SIZE, GFP_KERNEL);
87 if (!buf) { 87 if (!buf)
88 dev_err(&dev->dev, "%s - error loading firmware: error = %d\n",
89 __func__, -ENOMEM);
90 err = -ENOMEM;
91 goto wraperr; 88 goto wraperr;
92 }
93 89
94 err = request_ihex_firmware(&loader_fw, "emi26/loader.fw", &dev->dev); 90 err = request_ihex_firmware(&loader_fw, "emi26/loader.fw", &dev->dev);
95 if (err) 91 if (err)
@@ -111,11 +107,8 @@ static int emi26_load_firmware (struct usb_device *dev)
111 107
112 /* Assert reset (stop the CPU in the EMI) */ 108 /* Assert reset (stop the CPU in the EMI) */
113 err = emi26_set_reset(dev,1); 109 err = emi26_set_reset(dev,1);
114 if (err < 0) { 110 if (err < 0)
115 dev_err(&dev->dev,"%s - error loading firmware: error = %d\n",
116 __func__, err);
117 goto wraperr; 111 goto wraperr;
118 }
119 112
120 rec = (const struct ihex_binrec *)loader_fw->data; 113 rec = (const struct ihex_binrec *)loader_fw->data;
121 /* 1. We need to put the loader for the FPGA into the EZ-USB */ 114 /* 1. We need to put the loader for the FPGA into the EZ-USB */
@@ -123,19 +116,15 @@ static int emi26_load_firmware (struct usb_device *dev)
123 err = emi26_writememory(dev, be32_to_cpu(rec->addr), 116 err = emi26_writememory(dev, be32_to_cpu(rec->addr),
124 rec->data, be16_to_cpu(rec->len), 117 rec->data, be16_to_cpu(rec->len),
125 ANCHOR_LOAD_INTERNAL); 118 ANCHOR_LOAD_INTERNAL);
126 if (err < 0) { 119 if (err < 0)
127 err("%s - error loading firmware: error = %d", __func__, err);
128 goto wraperr; 120 goto wraperr;
129 }
130 rec = ihex_next_binrec(rec); 121 rec = ihex_next_binrec(rec);
131 } 122 }
132 123
133 /* De-assert reset (let the CPU run) */ 124 /* De-assert reset (let the CPU run) */
134 err = emi26_set_reset(dev,0); 125 err = emi26_set_reset(dev,0);
135 if (err < 0) { 126 if (err < 0)
136 err("%s - error loading firmware: error = %d", __func__, err);
137 goto wraperr; 127 goto wraperr;
138 }
139 msleep(250); /* let device settle */ 128 msleep(250); /* let device settle */
140 129
141 /* 2. We upload the FPGA firmware into the EMI 130 /* 2. We upload the FPGA firmware into the EMI
@@ -153,18 +142,14 @@ static int emi26_load_firmware (struct usb_device *dev)
153 rec = ihex_next_binrec(rec); 142 rec = ihex_next_binrec(rec);
154 } 143 }
155 err = emi26_writememory(dev, addr, buf, i, ANCHOR_LOAD_FPGA); 144 err = emi26_writememory(dev, addr, buf, i, ANCHOR_LOAD_FPGA);
156 if (err < 0) { 145 if (err < 0)
157 err("%s - error loading firmware: error = %d", __func__, err);
158 goto wraperr; 146 goto wraperr;
159 }
160 } while (rec); 147 } while (rec);
161 148
162 /* Assert reset (stop the CPU in the EMI) */ 149 /* Assert reset (stop the CPU in the EMI) */
163 err = emi26_set_reset(dev,1); 150 err = emi26_set_reset(dev,1);
164 if (err < 0) { 151 if (err < 0)
165 err("%s - error loading firmware: error = %d", __func__, err);
166 goto wraperr; 152 goto wraperr;
167 }
168 153
169 /* 3. We need to put the loader for the firmware into the EZ-USB (again...) */ 154 /* 3. We need to put the loader for the firmware into the EZ-USB (again...) */
170 for (rec = (const struct ihex_binrec *)loader_fw->data; 155 for (rec = (const struct ihex_binrec *)loader_fw->data;
@@ -172,19 +157,15 @@ static int emi26_load_firmware (struct usb_device *dev)
172 err = emi26_writememory(dev, be32_to_cpu(rec->addr), 157 err = emi26_writememory(dev, be32_to_cpu(rec->addr),
173 rec->data, be16_to_cpu(rec->len), 158 rec->data, be16_to_cpu(rec->len),
174 ANCHOR_LOAD_INTERNAL); 159 ANCHOR_LOAD_INTERNAL);
175 if (err < 0) { 160 if (err < 0)
176 err("%s - error loading firmware: error = %d", __func__, err);
177 goto wraperr; 161 goto wraperr;
178 }
179 } 162 }
180 msleep(250); /* let device settle */ 163 msleep(250); /* let device settle */
181 164
182 /* De-assert reset (let the CPU run) */ 165 /* De-assert reset (let the CPU run) */
183 err = emi26_set_reset(dev,0); 166 err = emi26_set_reset(dev,0);
184 if (err < 0) { 167 if (err < 0)
185 err("%s - error loading firmware: error = %d", __func__, err);
186 goto wraperr; 168 goto wraperr;
187 }
188 169
189 /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */ 170 /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */
190 171
@@ -194,19 +175,15 @@ static int emi26_load_firmware (struct usb_device *dev)
194 err = emi26_writememory(dev, be32_to_cpu(rec->addr), 175 err = emi26_writememory(dev, be32_to_cpu(rec->addr),
195 rec->data, be16_to_cpu(rec->len), 176 rec->data, be16_to_cpu(rec->len),
196 ANCHOR_LOAD_EXTERNAL); 177 ANCHOR_LOAD_EXTERNAL);
197 if (err < 0) { 178 if (err < 0)
198 err("%s - error loading firmware: error = %d", __func__, err);
199 goto wraperr; 179 goto wraperr;
200 }
201 } 180 }
202 } 181 }
203 182
204 /* Assert reset (stop the CPU in the EMI) */ 183 /* Assert reset (stop the CPU in the EMI) */
205 err = emi26_set_reset(dev,1); 184 err = emi26_set_reset(dev,1);
206 if (err < 0) { 185 if (err < 0)
207 err("%s - error loading firmware: error = %d", __func__, err);
208 goto wraperr; 186 goto wraperr;
209 }
210 187
211 for (rec = (const struct ihex_binrec *)firmware_fw->data; 188 for (rec = (const struct ihex_binrec *)firmware_fw->data;
212 rec; rec = ihex_next_binrec(rec)) { 189 rec; rec = ihex_next_binrec(rec)) {
@@ -214,19 +191,15 @@ static int emi26_load_firmware (struct usb_device *dev)
214 err = emi26_writememory(dev, be32_to_cpu(rec->addr), 191 err = emi26_writememory(dev, be32_to_cpu(rec->addr),
215 rec->data, be16_to_cpu(rec->len), 192 rec->data, be16_to_cpu(rec->len),
216 ANCHOR_LOAD_INTERNAL); 193 ANCHOR_LOAD_INTERNAL);
217 if (err < 0) { 194 if (err < 0)
218 err("%s - error loading firmware: error = %d", __func__, err);
219 goto wraperr; 195 goto wraperr;
220 }
221 } 196 }
222 } 197 }
223 198
224 /* De-assert reset (let the CPU run) */ 199 /* De-assert reset (let the CPU run) */
225 err = emi26_set_reset(dev,0); 200 err = emi26_set_reset(dev,0);
226 if (err < 0) { 201 if (err < 0)
227 err("%s - error loading firmware: error = %d", __func__, err);
228 goto wraperr; 202 goto wraperr;
229 }
230 msleep(250); /* let device settle */ 203 msleep(250); /* let device settle */
231 204
232 /* return 1 to fail the driver inialization 205 /* return 1 to fail the driver inialization
@@ -234,6 +207,10 @@ static int emi26_load_firmware (struct usb_device *dev)
234 err = 1; 207 err = 1;
235 208
236wraperr: 209wraperr:
210 if (err < 0)
211 dev_err(&dev->dev,"%s - error loading firmware: error = %d\n",
212 __func__, err);
213
237 release_firmware(loader_fw); 214 release_firmware(loader_fw);
238 release_firmware(bitstream_fw); 215 release_firmware(bitstream_fw);
239 release_firmware(firmware_fw); 216 release_firmware(firmware_fw);
diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c
index 4e0f167a6c4e..ff08015b230c 100644
--- a/drivers/usb/misc/emi62.c
+++ b/drivers/usb/misc/emi62.c
@@ -56,7 +56,7 @@ static int emi62_writememory(struct usb_device *dev, int address,
56 unsigned char *buffer = kmemdup(data, length, GFP_KERNEL); 56 unsigned char *buffer = kmemdup(data, length, GFP_KERNEL);
57 57
58 if (!buffer) { 58 if (!buffer) {
59 err("emi62: kmalloc(%d) failed.", length); 59 dev_err(&dev->dev, "kmalloc(%d) failed.\n", length);
60 return -ENOMEM; 60 return -ENOMEM;
61 } 61 }
62 /* Note: usb_control_msg returns negative value on error or length of the 62 /* Note: usb_control_msg returns negative value on error or length of the
@@ -73,9 +73,8 @@ static int emi62_set_reset (struct usb_device *dev, unsigned char reset_bit)
73 dev_info(&dev->dev, "%s - %d\n", __func__, reset_bit); 73 dev_info(&dev->dev, "%s - %d\n", __func__, reset_bit);
74 74
75 response = emi62_writememory (dev, CPUCS_REG, &reset_bit, 1, 0xa0); 75 response = emi62_writememory (dev, CPUCS_REG, &reset_bit, 1, 0xa0);
76 if (response < 0) { 76 if (response < 0)
77 err("emi62: set_reset (%d) failed", reset_bit); 77 dev_err(&dev->dev, "set_reset (%d) failed\n", reset_bit);
78 }
79 return response; 78 return response;
80} 79}
81 80
@@ -87,18 +86,15 @@ static int emi62_load_firmware (struct usb_device *dev)
87 const struct firmware *bitstream_fw = NULL; 86 const struct firmware *bitstream_fw = NULL;
88 const struct firmware *firmware_fw = NULL; 87 const struct firmware *firmware_fw = NULL;
89 const struct ihex_binrec *rec; 88 const struct ihex_binrec *rec;
90 int err; 89 int err = -ENOMEM;
91 int i; 90 int i;
92 __u32 addr; /* Address to write */ 91 __u32 addr; /* Address to write */
93 __u8 *buf; 92 __u8 *buf;
94 93
95 dev_dbg(&dev->dev, "load_firmware\n"); 94 dev_dbg(&dev->dev, "load_firmware\n");
96 buf = kmalloc(FW_LOAD_SIZE, GFP_KERNEL); 95 buf = kmalloc(FW_LOAD_SIZE, GFP_KERNEL);
97 if (!buf) { 96 if (!buf)
98 err( "%s - error loading firmware: error = %d", __func__, -ENOMEM);
99 err = -ENOMEM;
100 goto wraperr; 97 goto wraperr;
101 }
102 98
103 err = request_ihex_firmware(&loader_fw, "emi62/loader.fw", &dev->dev); 99 err = request_ihex_firmware(&loader_fw, "emi62/loader.fw", &dev->dev);
104 if (err) 100 if (err)
@@ -112,16 +108,13 @@ static int emi62_load_firmware (struct usb_device *dev)
112 err = request_ihex_firmware(&firmware_fw, FIRMWARE_FW, &dev->dev); 108 err = request_ihex_firmware(&firmware_fw, FIRMWARE_FW, &dev->dev);
113 if (err) { 109 if (err) {
114 nofw: 110 nofw:
115 err( "%s - request_firmware() failed", __func__);
116 goto wraperr; 111 goto wraperr;
117 } 112 }
118 113
119 /* Assert reset (stop the CPU in the EMI) */ 114 /* Assert reset (stop the CPU in the EMI) */
120 err = emi62_set_reset(dev,1); 115 err = emi62_set_reset(dev,1);
121 if (err < 0) { 116 if (err < 0)
122 err("%s - error loading firmware: error = %d", __func__, err);
123 goto wraperr; 117 goto wraperr;
124 }
125 118
126 rec = (const struct ihex_binrec *)loader_fw->data; 119 rec = (const struct ihex_binrec *)loader_fw->data;
127 120
@@ -130,19 +123,15 @@ static int emi62_load_firmware (struct usb_device *dev)
130 err = emi62_writememory(dev, be32_to_cpu(rec->addr), 123 err = emi62_writememory(dev, be32_to_cpu(rec->addr),
131 rec->data, be16_to_cpu(rec->len), 124 rec->data, be16_to_cpu(rec->len),
132 ANCHOR_LOAD_INTERNAL); 125 ANCHOR_LOAD_INTERNAL);
133 if (err < 0) { 126 if (err < 0)
134 err("%s - error loading firmware: error = %d", __func__, err);
135 goto wraperr; 127 goto wraperr;
136 }
137 rec = ihex_next_binrec(rec); 128 rec = ihex_next_binrec(rec);
138 } 129 }
139 130
140 /* De-assert reset (let the CPU run) */ 131 /* De-assert reset (let the CPU run) */
141 err = emi62_set_reset(dev,0); 132 err = emi62_set_reset(dev,0);
142 if (err < 0) { 133 if (err < 0)
143 err("%s - error loading firmware: error = %d", __func__, err);
144 goto wraperr; 134 goto wraperr;
145 }
146 msleep(250); /* let device settle */ 135 msleep(250); /* let device settle */
147 136
148 /* 2. We upload the FPGA firmware into the EMI 137 /* 2. We upload the FPGA firmware into the EMI
@@ -160,18 +149,14 @@ static int emi62_load_firmware (struct usb_device *dev)
160 rec = ihex_next_binrec(rec); 149 rec = ihex_next_binrec(rec);
161 } 150 }
162 err = emi62_writememory(dev, addr, buf, i, ANCHOR_LOAD_FPGA); 151 err = emi62_writememory(dev, addr, buf, i, ANCHOR_LOAD_FPGA);
163 if (err < 0) { 152 if (err < 0)
164 err("%s - error loading firmware: error = %d", __func__, err);
165 goto wraperr; 153 goto wraperr;
166 }
167 } while (rec); 154 } while (rec);
168 155
169 /* Assert reset (stop the CPU in the EMI) */ 156 /* Assert reset (stop the CPU in the EMI) */
170 err = emi62_set_reset(dev,1); 157 err = emi62_set_reset(dev,1);
171 if (err < 0) { 158 if (err < 0)
172 err("%s - error loading firmware: error = %d", __func__, err);
173 goto wraperr; 159 goto wraperr;
174 }
175 160
176 /* 3. We need to put the loader for the firmware into the EZ-USB (again...) */ 161 /* 3. We need to put the loader for the firmware into the EZ-USB (again...) */
177 for (rec = (const struct ihex_binrec *)loader_fw->data; 162 for (rec = (const struct ihex_binrec *)loader_fw->data;
@@ -179,18 +164,14 @@ static int emi62_load_firmware (struct usb_device *dev)
179 err = emi62_writememory(dev, be32_to_cpu(rec->addr), 164 err = emi62_writememory(dev, be32_to_cpu(rec->addr),
180 rec->data, be16_to_cpu(rec->len), 165 rec->data, be16_to_cpu(rec->len),
181 ANCHOR_LOAD_INTERNAL); 166 ANCHOR_LOAD_INTERNAL);
182 if (err < 0) { 167 if (err < 0)
183 err("%s - error loading firmware: error = %d", __func__, err);
184 goto wraperr; 168 goto wraperr;
185 }
186 } 169 }
187 170
188 /* De-assert reset (let the CPU run) */ 171 /* De-assert reset (let the CPU run) */
189 err = emi62_set_reset(dev,0); 172 err = emi62_set_reset(dev,0);
190 if (err < 0) { 173 if (err < 0)
191 err("%s - error loading firmware: error = %d", __func__, err);
192 goto wraperr; 174 goto wraperr;
193 }
194 msleep(250); /* let device settle */ 175 msleep(250); /* let device settle */
195 176
196 /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */ 177 /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */
@@ -201,19 +182,15 @@ static int emi62_load_firmware (struct usb_device *dev)
201 err = emi62_writememory(dev, be32_to_cpu(rec->addr), 182 err = emi62_writememory(dev, be32_to_cpu(rec->addr),
202 rec->data, be16_to_cpu(rec->len), 183 rec->data, be16_to_cpu(rec->len),
203 ANCHOR_LOAD_EXTERNAL); 184 ANCHOR_LOAD_EXTERNAL);
204 if (err < 0) { 185 if (err < 0)
205 err("%s - error loading firmware: error = %d", __func__, err);
206 goto wraperr; 186 goto wraperr;
207 }
208 } 187 }
209 } 188 }
210 189
211 /* Assert reset (stop the CPU in the EMI) */ 190 /* Assert reset (stop the CPU in the EMI) */
212 err = emi62_set_reset(dev,1); 191 err = emi62_set_reset(dev,1);
213 if (err < 0) { 192 if (err < 0)
214 err("%s - error loading firmware: error = %d", __func__, err);
215 goto wraperr; 193 goto wraperr;
216 }
217 194
218 for (rec = (const struct ihex_binrec *)firmware_fw->data; 195 for (rec = (const struct ihex_binrec *)firmware_fw->data;
219 rec; rec = ihex_next_binrec(rec)) { 196 rec; rec = ihex_next_binrec(rec)) {
@@ -221,19 +198,15 @@ static int emi62_load_firmware (struct usb_device *dev)
221 err = emi62_writememory(dev, be32_to_cpu(rec->addr), 198 err = emi62_writememory(dev, be32_to_cpu(rec->addr),
222 rec->data, be16_to_cpu(rec->len), 199 rec->data, be16_to_cpu(rec->len),
223 ANCHOR_LOAD_EXTERNAL); 200 ANCHOR_LOAD_EXTERNAL);
224 if (err < 0) { 201 if (err < 0)
225 err("%s - error loading firmware: error = %d", __func__, err);
226 goto wraperr; 202 goto wraperr;
227 }
228 } 203 }
229 } 204 }
230 205
231 /* De-assert reset (let the CPU run) */ 206 /* De-assert reset (let the CPU run) */
232 err = emi62_set_reset(dev,0); 207 err = emi62_set_reset(dev,0);
233 if (err < 0) { 208 if (err < 0)
234 err("%s - error loading firmware: error = %d", __func__, err);
235 goto wraperr; 209 goto wraperr;
236 }
237 msleep(250); /* let device settle */ 210 msleep(250); /* let device settle */
238 211
239 release_firmware(loader_fw); 212 release_firmware(loader_fw);
@@ -247,6 +220,9 @@ static int emi62_load_firmware (struct usb_device *dev)
247 return 1; 220 return 1;
248 221
249wraperr: 222wraperr:
223 if (err < 0)
224 dev_err(&dev->dev,"%s - error loading firmware: error = %d\n",
225 __func__, err);
250 release_firmware(loader_fw); 226 release_firmware(loader_fw);
251 release_firmware(bitstream_fw); 227 release_firmware(bitstream_fw);
252 release_firmware(firmware_fw); 228 release_firmware(firmware_fw);
diff --git a/drivers/usb/misc/idmouse.c b/drivers/usb/misc/idmouse.c
index 0dee24698504..c00fcd74d39d 100644
--- a/drivers/usb/misc/idmouse.c
+++ b/drivers/usb/misc/idmouse.c
@@ -366,14 +366,14 @@ static int idmouse_probe(struct usb_interface *interface,
366 kmalloc(IMGSIZE + dev->bulk_in_size, GFP_KERNEL); 366 kmalloc(IMGSIZE + dev->bulk_in_size, GFP_KERNEL);
367 367
368 if (!dev->bulk_in_buffer) { 368 if (!dev->bulk_in_buffer) {
369 err("Unable to allocate input buffer."); 369 dev_err(&interface->dev, "Unable to allocate input buffer.\n");
370 idmouse_delete(dev); 370 idmouse_delete(dev);
371 return -ENOMEM; 371 return -ENOMEM;
372 } 372 }
373 } 373 }
374 374
375 if (!(dev->bulk_in_endpointAddr)) { 375 if (!(dev->bulk_in_endpointAddr)) {
376 err("Unable to find bulk-in endpoint."); 376 dev_err(&interface->dev, "Unable to find bulk-in endpoint.\n");
377 idmouse_delete(dev); 377 idmouse_delete(dev);
378 return -ENODEV; 378 return -ENODEV;
379 } 379 }
@@ -385,7 +385,7 @@ static int idmouse_probe(struct usb_interface *interface,
385 result = usb_register_dev(interface, &idmouse_class); 385 result = usb_register_dev(interface, &idmouse_class);
386 if (result) { 386 if (result) {
387 /* something prevented us from registering this device */ 387 /* something prevented us from registering this device */
388 err("Unble to allocate minor number."); 388 dev_err(&interface->dev, "Unble to allocate minor number.\n");
389 usb_set_intfdata(interface, NULL); 389 usb_set_intfdata(interface, NULL);
390 idmouse_delete(dev); 390 idmouse_delete(dev);
391 return result; 391 return result;
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 4fd0dc835ae5..db46143c67a6 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -610,8 +610,8 @@ static int iowarrior_open(struct inode *inode, struct file *file)
610 interface = usb_find_interface(&iowarrior_driver, subminor); 610 interface = usb_find_interface(&iowarrior_driver, subminor);
611 if (!interface) { 611 if (!interface) {
612 mutex_unlock(&iowarrior_mutex); 612 mutex_unlock(&iowarrior_mutex);
613 err("%s - error, can't find device for minor %d", __func__, 613 printk(KERN_ERR "%s - error, can't find device for minor %d\n",
614 subminor); 614 __func__, subminor);
615 return -ENODEV; 615 return -ENODEV;
616 } 616 }
617 617
diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c
index 5db4ab52061e..ac762299eaa8 100644
--- a/drivers/usb/misc/ldusb.c
+++ b/drivers/usb/misc/ldusb.c
@@ -334,8 +334,8 @@ static int ld_usb_open(struct inode *inode, struct file *file)
334 interface = usb_find_interface(&ld_usb_driver, subminor); 334 interface = usb_find_interface(&ld_usb_driver, subminor);
335 335
336 if (!interface) { 336 if (!interface) {
337 err("%s - error, can't find device for minor %d\n", 337 printk(KERN_ERR "%s - error, can't find device for minor %d\n",
338 __func__, subminor); 338 __func__, subminor);
339 return -ENODEV; 339 return -ENODEV;
340 } 340 }
341 341
@@ -485,7 +485,7 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count,
485 /* verify that the device wasn't unplugged */ 485 /* verify that the device wasn't unplugged */
486 if (dev->intf == NULL) { 486 if (dev->intf == NULL) {
487 retval = -ENODEV; 487 retval = -ENODEV;
488 err("No device or device unplugged %d\n", retval); 488 printk(KERN_ERR "ldusb: No device or device unplugged %d\n", retval);
489 goto unlock_exit; 489 goto unlock_exit;
490 } 490 }
491 491
@@ -565,7 +565,7 @@ static ssize_t ld_usb_write(struct file *file, const char __user *buffer,
565 /* verify that the device wasn't unplugged */ 565 /* verify that the device wasn't unplugged */
566 if (dev->intf == NULL) { 566 if (dev->intf == NULL) {
567 retval = -ENODEV; 567 retval = -ENODEV;
568 err("No device or device unplugged %d\n", retval); 568 printk(KERN_ERR "ldusb: No device or device unplugged %d\n", retval);
569 goto unlock_exit; 569 goto unlock_exit;
570 } 570 }
571 571
@@ -603,7 +603,9 @@ static ssize_t ld_usb_write(struct file *file, const char __user *buffer,
603 bytes_to_write, 603 bytes_to_write,
604 USB_CTRL_SET_TIMEOUT * HZ); 604 USB_CTRL_SET_TIMEOUT * HZ);
605 if (retval < 0) 605 if (retval < 0)
606 err("Couldn't submit HID_REQ_SET_REPORT %d\n", retval); 606 dev_err(&dev->intf->dev,
607 "Couldn't submit HID_REQ_SET_REPORT %d\n",
608 retval);
607 goto unlock_exit; 609 goto unlock_exit;
608 } 610 }
609 611
@@ -624,7 +626,8 @@ static ssize_t ld_usb_write(struct file *file, const char __user *buffer,
624 retval = usb_submit_urb(dev->interrupt_out_urb, GFP_KERNEL); 626 retval = usb_submit_urb(dev->interrupt_out_urb, GFP_KERNEL);
625 if (retval) { 627 if (retval) {
626 dev->interrupt_out_busy = 0; 628 dev->interrupt_out_busy = 0;
627 err("Couldn't submit interrupt_out_urb %d\n", retval); 629 dev_err(&dev->intf->dev,
630 "Couldn't submit interrupt_out_urb %d\n", retval);
628 goto unlock_exit; 631 goto unlock_exit;
629 } 632 }
630 retval = bytes_to_write; 633 retval = bytes_to_write;
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index 575222042767..a2702cbfe804 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -354,8 +354,8 @@ static int tower_open (struct inode *inode, struct file *file)
354 interface = usb_find_interface (&tower_driver, subminor); 354 interface = usb_find_interface (&tower_driver, subminor);
355 355
356 if (!interface) { 356 if (!interface) {
357 err ("%s - error, can't find device for minor %d", 357 printk(KERN_ERR "%s - error, can't find device for minor %d\n",
358 __func__, subminor); 358 __func__, subminor);
359 retval = -ENODEV; 359 retval = -ENODEV;
360 goto exit; 360 goto exit;
361 } 361 }
@@ -397,7 +397,8 @@ static int tower_open (struct inode *inode, struct file *file)
397 sizeof(reset_reply), 397 sizeof(reset_reply),
398 1000); 398 1000);
399 if (result < 0) { 399 if (result < 0) {
400 err("LEGO USB Tower reset control request failed"); 400 dev_err(&dev->udev->dev,
401 "LEGO USB Tower reset control request failed\n");
401 retval = result; 402 retval = result;
402 goto unlock_exit; 403 goto unlock_exit;
403 } 404 }
@@ -420,7 +421,8 @@ static int tower_open (struct inode *inode, struct file *file)
420 421
421 retval = usb_submit_urb (dev->interrupt_in_urb, GFP_KERNEL); 422 retval = usb_submit_urb (dev->interrupt_in_urb, GFP_KERNEL);
422 if (retval) { 423 if (retval) {
423 err("Couldn't submit interrupt_in_urb %d", retval); 424 dev_err(&dev->udev->dev,
425 "Couldn't submit interrupt_in_urb %d\n", retval);
424 dev->interrupt_in_running = 0; 426 dev->interrupt_in_running = 0;
425 dev->open_count = 0; 427 dev->open_count = 0;
426 goto unlock_exit; 428 goto unlock_exit;
@@ -608,7 +610,7 @@ static ssize_t tower_read (struct file *file, char __user *buffer, size_t count,
608 /* verify that the device wasn't unplugged */ 610 /* verify that the device wasn't unplugged */
609 if (dev->udev == NULL) { 611 if (dev->udev == NULL) {
610 retval = -ENODEV; 612 retval = -ENODEV;
611 err("No device or device unplugged %d", retval); 613 printk(KERN_ERR "legousbtower: No device or device unplugged %d\n", retval);
612 goto unlock_exit; 614 goto unlock_exit;
613 } 615 }
614 616
@@ -697,7 +699,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t
697 /* verify that the device wasn't unplugged */ 699 /* verify that the device wasn't unplugged */
698 if (dev->udev == NULL) { 700 if (dev->udev == NULL) {
699 retval = -ENODEV; 701 retval = -ENODEV;
700 err("No device or device unplugged %d", retval); 702 printk(KERN_ERR "legousbtower: No device or device unplugged %d\n", retval);
701 goto unlock_exit; 703 goto unlock_exit;
702 } 704 }
703 705
@@ -744,7 +746,8 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t
744 retval = usb_submit_urb (dev->interrupt_out_urb, GFP_KERNEL); 746 retval = usb_submit_urb (dev->interrupt_out_urb, GFP_KERNEL);
745 if (retval) { 747 if (retval) {
746 dev->interrupt_out_busy = 0; 748 dev->interrupt_out_busy = 0;
747 err("Couldn't submit interrupt_out_urb %d", retval); 749 dev_err(&dev->udev->dev,
750 "Couldn't submit interrupt_out_urb %d\n", retval);
748 goto unlock_exit; 751 goto unlock_exit;
749 } 752 }
750 retval = bytes_to_write; 753 retval = bytes_to_write;
@@ -803,9 +806,10 @@ resubmit:
803 /* resubmit if we're still running */ 806 /* resubmit if we're still running */
804 if (dev->interrupt_in_running && dev->udev) { 807 if (dev->interrupt_in_running && dev->udev) {
805 retval = usb_submit_urb (dev->interrupt_in_urb, GFP_ATOMIC); 808 retval = usb_submit_urb (dev->interrupt_in_urb, GFP_ATOMIC);
806 if (retval) { 809 if (retval)
807 err("%s: usb_submit_urb failed (%d)", __func__, retval); 810 dev_err(&dev->udev->dev,
808 } 811 "%s: usb_submit_urb failed (%d)\n",
812 __func__, retval);
809 } 813 }
810 814
811exit: 815exit:
@@ -852,6 +856,7 @@ static void tower_interrupt_out_callback (struct urb *urb)
852 */ 856 */
853static int tower_probe (struct usb_interface *interface, const struct usb_device_id *id) 857static int tower_probe (struct usb_interface *interface, const struct usb_device_id *id)
854{ 858{
859 struct device *idev = &interface->dev;
855 struct usb_device *udev = interface_to_usbdev(interface); 860 struct usb_device *udev = interface_to_usbdev(interface);
856 struct lego_usb_tower *dev = NULL; 861 struct lego_usb_tower *dev = NULL;
857 struct usb_host_interface *iface_desc; 862 struct usb_host_interface *iface_desc;
@@ -871,7 +876,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
871 dev = kmalloc (sizeof(struct lego_usb_tower), GFP_KERNEL); 876 dev = kmalloc (sizeof(struct lego_usb_tower), GFP_KERNEL);
872 877
873 if (dev == NULL) { 878 if (dev == NULL) {
874 err ("Out of memory"); 879 dev_err(idev, "Out of memory\n");
875 goto exit; 880 goto exit;
876 } 881 }
877 882
@@ -915,37 +920,37 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
915 } 920 }
916 } 921 }
917 if(dev->interrupt_in_endpoint == NULL) { 922 if(dev->interrupt_in_endpoint == NULL) {
918 err("interrupt in endpoint not found"); 923 dev_err(idev, "interrupt in endpoint not found\n");
919 goto error; 924 goto error;
920 } 925 }
921 if (dev->interrupt_out_endpoint == NULL) { 926 if (dev->interrupt_out_endpoint == NULL) {
922 err("interrupt out endpoint not found"); 927 dev_err(idev, "interrupt out endpoint not found\n");
923 goto error; 928 goto error;
924 } 929 }
925 930
926 dev->read_buffer = kmalloc (read_buffer_size, GFP_KERNEL); 931 dev->read_buffer = kmalloc (read_buffer_size, GFP_KERNEL);
927 if (!dev->read_buffer) { 932 if (!dev->read_buffer) {
928 err("Couldn't allocate read_buffer"); 933 dev_err(idev, "Couldn't allocate read_buffer\n");
929 goto error; 934 goto error;
930 } 935 }
931 dev->interrupt_in_buffer = kmalloc (usb_endpoint_maxp(dev->interrupt_in_endpoint), GFP_KERNEL); 936 dev->interrupt_in_buffer = kmalloc (usb_endpoint_maxp(dev->interrupt_in_endpoint), GFP_KERNEL);
932 if (!dev->interrupt_in_buffer) { 937 if (!dev->interrupt_in_buffer) {
933 err("Couldn't allocate interrupt_in_buffer"); 938 dev_err(idev, "Couldn't allocate interrupt_in_buffer\n");
934 goto error; 939 goto error;
935 } 940 }
936 dev->interrupt_in_urb = usb_alloc_urb(0, GFP_KERNEL); 941 dev->interrupt_in_urb = usb_alloc_urb(0, GFP_KERNEL);
937 if (!dev->interrupt_in_urb) { 942 if (!dev->interrupt_in_urb) {
938 err("Couldn't allocate interrupt_in_urb"); 943 dev_err(idev, "Couldn't allocate interrupt_in_urb\n");
939 goto error; 944 goto error;
940 } 945 }
941 dev->interrupt_out_buffer = kmalloc (write_buffer_size, GFP_KERNEL); 946 dev->interrupt_out_buffer = kmalloc (write_buffer_size, GFP_KERNEL);
942 if (!dev->interrupt_out_buffer) { 947 if (!dev->interrupt_out_buffer) {
943 err("Couldn't allocate interrupt_out_buffer"); 948 dev_err(idev, "Couldn't allocate interrupt_out_buffer\n");
944 goto error; 949 goto error;
945 } 950 }
946 dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL); 951 dev->interrupt_out_urb = usb_alloc_urb(0, GFP_KERNEL);
947 if (!dev->interrupt_out_urb) { 952 if (!dev->interrupt_out_urb) {
948 err("Couldn't allocate interrupt_out_urb"); 953 dev_err(idev, "Couldn't allocate interrupt_out_urb\n");
949 goto error; 954 goto error;
950 } 955 }
951 dev->interrupt_in_interval = interrupt_in_interval ? interrupt_in_interval : dev->interrupt_in_endpoint->bInterval; 956 dev->interrupt_in_interval = interrupt_in_interval ? interrupt_in_interval : dev->interrupt_in_endpoint->bInterval;
@@ -958,7 +963,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
958 963
959 if (retval) { 964 if (retval) {
960 /* something prevented us from registering this driver */ 965 /* something prevented us from registering this driver */
961 err ("Not able to get a minor for this device."); 966 dev_err(idev, "Not able to get a minor for this device.\n");
962 usb_set_intfdata (interface, NULL); 967 usb_set_intfdata (interface, NULL);
963 goto error; 968 goto error;
964 } 969 }
@@ -980,7 +985,7 @@ static int tower_probe (struct usb_interface *interface, const struct usb_device
980 sizeof(get_version_reply), 985 sizeof(get_version_reply),
981 1000); 986 1000);
982 if (result < 0) { 987 if (result < 0) {
983 err("LEGO USB Tower get version control request failed"); 988 dev_err(idev, "LEGO USB Tower get version control request failed\n");
984 retval = result; 989 retval = result;
985 goto error; 990 goto error;
986 } 991 }
diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c
index 487a8ce0775e..cb55dc5330df 100644
--- a/drivers/usb/misc/rio500.c
+++ b/drivers/usb/misc/rio500.c
@@ -171,7 +171,9 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg)
171 if (result == -ETIMEDOUT) 171 if (result == -ETIMEDOUT)
172 retries--; 172 retries--;
173 else if (result < 0) { 173 else if (result < 0) {
174 err("Error executing ioctrl. code = %d", result); 174 dev_err(&rio->rio_dev->dev,
175 "Error executing ioctrl. code = %d\n",
176 result);
175 retries = 0; 177 retries = 0;
176 } else { 178 } else {
177 dbg("Executed ioctl. Result = %d (data=%02x)", 179 dbg("Executed ioctl. Result = %d (data=%02x)",
@@ -238,7 +240,9 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg)
238 if (result == -ETIMEDOUT) 240 if (result == -ETIMEDOUT)
239 retries--; 241 retries--;
240 else if (result < 0) { 242 else if (result < 0) {
241 err("Error executing ioctrl. code = %d", result); 243 dev_err(&rio->rio_dev->dev,
244 "Error executing ioctrl. code = %d\n",
245 result);
242 retries = 0; 246 retries = 0;
243 } else { 247 } else {
244 dbg("Executed ioctl. Result = %d", result); 248 dbg("Executed ioctl. Result = %d", result);
@@ -332,7 +336,8 @@ write_rio(struct file *file, const char __user *buffer,
332 break; 336 break;
333 }; 337 };
334 if (result) { 338 if (result) {
335 err("Write Whoops - %x", result); 339 dev_err(&rio->rio_dev->dev, "Write Whoops - %x\n",
340 result);
336 errn = -EIO; 341 errn = -EIO;
337 goto error; 342 goto error;
338 } 343 }
@@ -401,7 +406,8 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos)
401 } else if (result == -ETIMEDOUT || result == 15) { /* FIXME: 15 ??? */ 406 } else if (result == -ETIMEDOUT || result == 15) { /* FIXME: 15 ??? */
402 if (!maxretry--) { 407 if (!maxretry--) {
403 mutex_unlock(&(rio->lock)); 408 mutex_unlock(&(rio->lock));
404 err("read_rio: maxretry timeout"); 409 dev_err(&rio->rio_dev->dev,
410 "read_rio: maxretry timeout\n");
405 return -ETIME; 411 return -ETIME;
406 } 412 }
407 prepare_to_wait(&rio->wait_q, &wait, TASK_INTERRUPTIBLE); 413 prepare_to_wait(&rio->wait_q, &wait, TASK_INTERRUPTIBLE);
@@ -410,8 +416,9 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos)
410 continue; 416 continue;
411 } else if (result != -EREMOTEIO) { 417 } else if (result != -EREMOTEIO) {
412 mutex_unlock(&(rio->lock)); 418 mutex_unlock(&(rio->lock));
413 err("Read Whoops - result:%u partial:%u this_read:%u", 419 dev_err(&rio->rio_dev->dev,
414 result, partial, this_read); 420 "Read Whoops - result:%u partial:%u this_read:%u\n",
421 result, partial, this_read);
415 return -EIO; 422 return -EIO;
416 } else { 423 } else {
417 mutex_unlock(&(rio->lock)); 424 mutex_unlock(&(rio->lock));
@@ -459,21 +466,24 @@ static int probe_rio(struct usb_interface *intf,
459 466
460 retval = usb_register_dev(intf, &usb_rio_class); 467 retval = usb_register_dev(intf, &usb_rio_class);
461 if (retval) { 468 if (retval) {
462 err("Not able to get a minor for this device."); 469 dev_err(&dev->dev,
470 "Not able to get a minor for this device.\n");
463 return -ENOMEM; 471 return -ENOMEM;
464 } 472 }
465 473
466 rio->rio_dev = dev; 474 rio->rio_dev = dev;
467 475
468 if (!(rio->obuf = kmalloc(OBUF_SIZE, GFP_KERNEL))) { 476 if (!(rio->obuf = kmalloc(OBUF_SIZE, GFP_KERNEL))) {
469 err("probe_rio: Not enough memory for the output buffer"); 477 dev_err(&dev->dev,
478 "probe_rio: Not enough memory for the output buffer\n");
470 usb_deregister_dev(intf, &usb_rio_class); 479 usb_deregister_dev(intf, &usb_rio_class);
471 return -ENOMEM; 480 return -ENOMEM;
472 } 481 }
473 dbg("probe_rio: obuf address:%p", rio->obuf); 482 dbg("probe_rio: obuf address:%p", rio->obuf);
474 483
475 if (!(rio->ibuf = kmalloc(IBUF_SIZE, GFP_KERNEL))) { 484 if (!(rio->ibuf = kmalloc(IBUF_SIZE, GFP_KERNEL))) {
476 err("probe_rio: Not enough memory for the input buffer"); 485 dev_err(&dev->dev,
486 "probe_rio: Not enough memory for the input buffer\n");
477 usb_deregister_dev(intf, &usb_rio_class); 487 usb_deregister_dev(intf, &usb_rio_class);
478 kfree(rio->obuf); 488 kfree(rio->obuf);
479 return -ENOMEM; 489 return -ENOMEM;
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index e2b4bd31c2b6..c4ef9a1d5efd 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -87,8 +87,8 @@ static int lcd_open(struct inode *inode, struct file *file)
87 interface = usb_find_interface(&lcd_driver, subminor); 87 interface = usb_find_interface(&lcd_driver, subminor);
88 if (!interface) { 88 if (!interface) {
89 mutex_unlock(&lcd_mutex); 89 mutex_unlock(&lcd_mutex);
90 err("USBLCD: %s - error, can't find device for minor %d", 90 printk(KERN_ERR "USBLCD: %s - error, can't find device for minor %d\n",
91 __func__, subminor); 91 __func__, subminor);
92 return -ENODEV; 92 return -ENODEV;
93 } 93 }
94 94
@@ -268,8 +268,9 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer,
268 /* send the data out the bulk port */ 268 /* send the data out the bulk port */
269 retval = usb_submit_urb(urb, GFP_KERNEL); 269 retval = usb_submit_urb(urb, GFP_KERNEL);
270 if (retval) { 270 if (retval) {
271 err("USBLCD: %s - failed submitting write urb, error %d", 271 dev_err(&dev->udev->dev,
272 __func__, retval); 272 "%s - failed submitting write urb, error %d\n",
273 __func__, retval);
273 goto error_unanchor; 274 goto error_unanchor;
274 } 275 }
275 276
@@ -322,7 +323,7 @@ static int lcd_probe(struct usb_interface *interface,
322 /* allocate memory for our device state and initialize it */ 323 /* allocate memory for our device state and initialize it */
323 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 324 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
324 if (dev == NULL) { 325 if (dev == NULL) {
325 err("Out of memory"); 326 dev_err(&interface->dev, "Out of memory\n");
326 goto error; 327 goto error;
327 } 328 }
328 kref_init(&dev->kref); 329 kref_init(&dev->kref);
@@ -352,7 +353,8 @@ static int lcd_probe(struct usb_interface *interface,
352 dev->bulk_in_endpointAddr = endpoint->bEndpointAddress; 353 dev->bulk_in_endpointAddr = endpoint->bEndpointAddress;
353 dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL); 354 dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
354 if (!dev->bulk_in_buffer) { 355 if (!dev->bulk_in_buffer) {
355 err("Could not allocate bulk_in_buffer"); 356 dev_err(&interface->dev,
357 "Could not allocate bulk_in_buffer\n");
356 goto error; 358 goto error;
357 } 359 }
358 } 360 }
@@ -364,7 +366,8 @@ static int lcd_probe(struct usb_interface *interface,
364 } 366 }
365 } 367 }
366 if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr)) { 368 if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr)) {
367 err("Could not find both bulk-in and bulk-out endpoints"); 369 dev_err(&interface->dev,
370 "Could not find both bulk-in and bulk-out endpoints\n");
368 goto error; 371 goto error;
369 } 372 }
370 373
@@ -375,7 +378,8 @@ static int lcd_probe(struct usb_interface *interface,
375 retval = usb_register_dev(interface, &lcd_class); 378 retval = usb_register_dev(interface, &lcd_class);
376 if (retval) { 379 if (retval) {
377 /* something prevented us from registering this driver */ 380 /* something prevented us from registering this driver */
378 err("Not able to get a minor for this device."); 381 dev_err(&interface->dev,
382 "Not able to get a minor for this device.\n");
379 usb_set_intfdata(interface, NULL); 383 usb_set_intfdata(interface, NULL);
380 goto error; 384 goto error;
381 } 385 }
diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c
index 8b1d94a76914..7f64147ea229 100644
--- a/drivers/usb/misc/uss720.c
+++ b/drivers/usb/misc/uss720.c
@@ -118,7 +118,8 @@ static void async_complete(struct urb *urb)
118 priv = rq->priv; 118 priv = rq->priv;
119 pp = priv->pp; 119 pp = priv->pp;
120 if (status) { 120 if (status) {
121 err("async_complete: urb error %d", status); 121 dev_err(&urb->dev->dev, "async_complete: urb error %d\n",
122 status);
122 } else if (rq->dr.bRequest == 3) { 123 } else if (rq->dr.bRequest == 3) {
123 memcpy(priv->reg, rq->reg, sizeof(priv->reg)); 124 memcpy(priv->reg, rq->reg, sizeof(priv->reg));
124#if 0 125#if 0
@@ -151,7 +152,7 @@ static struct uss720_async_request *submit_async_request(struct parport_uss720_p
151 return NULL; 152 return NULL;
152 rq = kmalloc(sizeof(struct uss720_async_request), mem_flags); 153 rq = kmalloc(sizeof(struct uss720_async_request), mem_flags);
153 if (!rq) { 154 if (!rq) {
154 err("submit_async_request out of memory"); 155 dev_err(&usbdev->dev, "submit_async_request out of memory\n");
155 return NULL; 156 return NULL;
156 } 157 }
157 kref_init(&rq->ref_count); 158 kref_init(&rq->ref_count);
@@ -162,7 +163,7 @@ static struct uss720_async_request *submit_async_request(struct parport_uss720_p
162 rq->urb = usb_alloc_urb(0, mem_flags); 163 rq->urb = usb_alloc_urb(0, mem_flags);
163 if (!rq->urb) { 164 if (!rq->urb) {
164 kref_put(&rq->ref_count, destroy_async); 165 kref_put(&rq->ref_count, destroy_async);
165 err("submit_async_request out of memory"); 166 dev_err(&usbdev->dev, "submit_async_request out of memory\n");
166 return NULL; 167 return NULL;
167 } 168 }
168 rq->dr.bRequestType = requesttype; 169 rq->dr.bRequestType = requesttype;
@@ -182,7 +183,7 @@ static struct uss720_async_request *submit_async_request(struct parport_uss720_p
182 if (!ret) 183 if (!ret)
183 return rq; 184 return rq;
184 destroy_async(&rq->ref_count); 185 destroy_async(&rq->ref_count);
185 err("submit_async_request submit_urb failed with %d", ret); 186 dev_err(&usbdev->dev, "submit_async_request submit_urb failed with %d\n", ret);
186 return NULL; 187 return NULL;
187} 188}
188 189
@@ -217,7 +218,8 @@ static int get_1284_register(struct parport *pp, unsigned char reg, unsigned cha
217 priv = pp->private_data; 218 priv = pp->private_data;
218 rq = submit_async_request(priv, 3, 0xc0, ((unsigned int)reg) << 8, 0, mem_flags); 219 rq = submit_async_request(priv, 3, 0xc0, ((unsigned int)reg) << 8, 0, mem_flags);
219 if (!rq) { 220 if (!rq) {
220 err("get_1284_register(%u) failed", (unsigned int)reg); 221 dev_err(&priv->usbdev->dev, "get_1284_register(%u) failed",
222 (unsigned int)reg);
221 return -EIO; 223 return -EIO;
222 } 224 }
223 if (!val) { 225 if (!val) {
@@ -248,7 +250,8 @@ static int set_1284_register(struct parport *pp, unsigned char reg, unsigned cha
248 priv = pp->private_data; 250 priv = pp->private_data;
249 rq = submit_async_request(priv, 4, 0x40, (((unsigned int)reg) << 8) | val, 0, mem_flags); 251 rq = submit_async_request(priv, 4, 0x40, (((unsigned int)reg) << 8) | val, 0, mem_flags);
250 if (!rq) { 252 if (!rq) {
251 err("set_1284_register(%u,%u) failed", (unsigned int)reg, (unsigned int)val); 253 dev_err(&priv->usbdev->dev, "set_1284_register(%u,%u) failed",
254 (unsigned int)reg, (unsigned int)val);
252 return -EIO; 255 return -EIO;
253 } 256 }
254 kref_put(&rq->ref_count, destroy_async); 257 kref_put(&rq->ref_count, destroy_async);
diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c
index 70201462e19c..1d8ad4c5b99e 100644
--- a/drivers/usb/misc/yurex.c
+++ b/drivers/usb/misc/yurex.c
@@ -83,7 +83,8 @@ static void yurex_control_callback(struct urb *urb)
83 int status = urb->status; 83 int status = urb->status;
84 84
85 if (status) { 85 if (status) {
86 err("%s - control failed: %d\n", __func__, status); 86 dev_err(&urb->dev->dev, "%s - control failed: %d\n",
87 __func__, status);
87 wake_up_interruptible(&dev->waitq); 88 wake_up_interruptible(&dev->waitq);
88 return; 89 return;
89 } 90 }
@@ -137,8 +138,9 @@ static void yurex_interrupt(struct urb *urb)
137 case 0: /*success*/ 138 case 0: /*success*/
138 break; 139 break;
139 case -EOVERFLOW: 140 case -EOVERFLOW:
140 err("%s - overflow with length %d, actual length is %d", 141 dev_err(&dev->interface->dev,
141 __func__, YUREX_BUF_SIZE, dev->urb->actual_length); 142 "%s - overflow with length %d, actual length is %d\n",
143 __func__, YUREX_BUF_SIZE, dev->urb->actual_length);
142 case -ECONNRESET: 144 case -ECONNRESET:
143 case -ENOENT: 145 case -ENOENT:
144 case -ESHUTDOWN: 146 case -ESHUTDOWN:
@@ -146,7 +148,8 @@ static void yurex_interrupt(struct urb *urb)
146 /* The device is terminated, clean up */ 148 /* The device is terminated, clean up */
147 return; 149 return;
148 default: 150 default:
149 err("%s - unknown status received: %d", __func__, status); 151 dev_err(&dev->interface->dev,
152 "%s - unknown status received: %d\n", __func__, status);
150 goto exit; 153 goto exit;
151 } 154 }
152 155
@@ -179,7 +182,7 @@ static void yurex_interrupt(struct urb *urb)
179exit: 182exit:
180 retval = usb_submit_urb(dev->urb, GFP_ATOMIC); 183 retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
181 if (retval) { 184 if (retval) {
182 err("%s - usb_submit_urb failed: %d", 185 dev_err(&dev->interface->dev, "%s - usb_submit_urb failed: %d\n",
183 __func__, retval); 186 __func__, retval);
184 } 187 }
185} 188}
@@ -196,7 +199,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
196 /* allocate memory for our device state and initialize it */ 199 /* allocate memory for our device state and initialize it */
197 dev = kzalloc(sizeof(*dev), GFP_KERNEL); 200 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
198 if (!dev) { 201 if (!dev) {
199 err("Out of memory"); 202 dev_err(&interface->dev, "Out of memory\n");
200 goto error; 203 goto error;
201 } 204 }
202 kref_init(&dev->kref); 205 kref_init(&dev->kref);
@@ -219,7 +222,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
219 } 222 }
220 if (!dev->int_in_endpointAddr) { 223 if (!dev->int_in_endpointAddr) {
221 retval = -ENODEV; 224 retval = -ENODEV;
222 err("Could not find endpoints"); 225 dev_err(&interface->dev, "Could not find endpoints\n");
223 goto error; 226 goto error;
224 } 227 }
225 228
@@ -227,14 +230,14 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
227 /* allocate control URB */ 230 /* allocate control URB */
228 dev->cntl_urb = usb_alloc_urb(0, GFP_KERNEL); 231 dev->cntl_urb = usb_alloc_urb(0, GFP_KERNEL);
229 if (!dev->cntl_urb) { 232 if (!dev->cntl_urb) {
230 err("Could not allocate control URB"); 233 dev_err(&interface->dev, "Could not allocate control URB\n");
231 goto error; 234 goto error;
232 } 235 }
233 236
234 /* allocate buffer for control req */ 237 /* allocate buffer for control req */
235 dev->cntl_req = kmalloc(YUREX_BUF_SIZE, GFP_KERNEL); 238 dev->cntl_req = kmalloc(YUREX_BUF_SIZE, GFP_KERNEL);
236 if (!dev->cntl_req) { 239 if (!dev->cntl_req) {
237 err("Could not allocate cntl_req"); 240 dev_err(&interface->dev, "Could not allocate cntl_req\n");
238 goto error; 241 goto error;
239 } 242 }
240 243
@@ -243,7 +246,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
243 GFP_KERNEL, 246 GFP_KERNEL,
244 &dev->cntl_urb->transfer_dma); 247 &dev->cntl_urb->transfer_dma);
245 if (!dev->cntl_buffer) { 248 if (!dev->cntl_buffer) {
246 err("Could not allocate cntl_buffer"); 249 dev_err(&interface->dev, "Could not allocate cntl_buffer\n");
247 goto error; 250 goto error;
248 } 251 }
249 252
@@ -265,7 +268,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
265 /* allocate interrupt URB */ 268 /* allocate interrupt URB */
266 dev->urb = usb_alloc_urb(0, GFP_KERNEL); 269 dev->urb = usb_alloc_urb(0, GFP_KERNEL);
267 if (!dev->urb) { 270 if (!dev->urb) {
268 err("Could not allocate URB"); 271 dev_err(&interface->dev, "Could not allocate URB\n");
269 goto error; 272 goto error;
270 } 273 }
271 274
@@ -273,7 +276,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
273 dev->int_buffer = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE, 276 dev->int_buffer = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE,
274 GFP_KERNEL, &dev->urb->transfer_dma); 277 GFP_KERNEL, &dev->urb->transfer_dma);
275 if (!dev->int_buffer) { 278 if (!dev->int_buffer) {
276 err("Could not allocate int_buffer"); 279 dev_err(&interface->dev, "Could not allocate int_buffer\n");
277 goto error; 280 goto error;
278 } 281 }
279 282
@@ -285,7 +288,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
285 dev->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 288 dev->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
286 if (usb_submit_urb(dev->urb, GFP_KERNEL)) { 289 if (usb_submit_urb(dev->urb, GFP_KERNEL)) {
287 retval = -EIO; 290 retval = -EIO;
288 err("Could not submitting URB"); 291 dev_err(&interface->dev, "Could not submitting URB\n");
289 goto error; 292 goto error;
290 } 293 }
291 294
@@ -295,7 +298,8 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
295 /* we can register the device now, as it is ready */ 298 /* we can register the device now, as it is ready */
296 retval = usb_register_dev(interface, &yurex_class); 299 retval = usb_register_dev(interface, &yurex_class);
297 if (retval) { 300 if (retval) {
298 err("Not able to get a minor for this device."); 301 dev_err(&interface->dev,
302 "Not able to get a minor for this device.\n");
299 usb_set_intfdata(interface, NULL); 303 usb_set_intfdata(interface, NULL);
300 goto error; 304 goto error;
301 } 305 }
@@ -368,8 +372,8 @@ static int yurex_open(struct inode *inode, struct file *file)
368 372
369 interface = usb_find_interface(&yurex_driver, subminor); 373 interface = usb_find_interface(&yurex_driver, subminor);
370 if (!interface) { 374 if (!interface) {
371 err("%s - error, can't find device for minor %d", 375 printk(KERN_ERR "%s - error, can't find device for minor %d",
372 __func__, subminor); 376 __func__, subminor);
373 retval = -ENODEV; 377 retval = -ENODEV;
374 goto exit; 378 goto exit;
375 } 379 }
@@ -514,7 +518,9 @@ static ssize_t yurex_write(struct file *file, const char *user_buffer, size_t co
514 mutex_unlock(&dev->io_mutex); 518 mutex_unlock(&dev->io_mutex);
515 519
516 if (retval < 0) { 520 if (retval < 0) {
517 err("%s - failed to send bulk msg, error %d", __func__, retval); 521 dev_err(&dev->interface->dev,
522 "%s - failed to send bulk msg, error %d\n",
523 __func__, retval);
518 goto error; 524 goto error;
519 } 525 }
520 if (set && timeout) 526 if (set && timeout)