aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/at76c50x-usb.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-10-28 04:05:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-11-14 14:55:32 -0500
commit6a4b09f807afab788b58b529c4a9d6dc27cc6933 (patch)
tree30d3085facc5a5a06eb05cf86a92a4728303ce2a /drivers/net/wireless/at76c50x-usb.c
parent0f01545346cd97f823fc0aaf0c02d4fc7bec6d46 (diff)
wireless: Convert dev_printk(KERN_<LEVEL> to dev_<level>(
dev_<level> calls take less code than dev_printk(KERN_<LEVEL> and reducing object size is good. Coalesce formats for easier grep. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/at76c50x-usb.c')
-rw-r--r--drivers/net/wireless/at76c50x-usb.c85
1 files changed, 40 insertions, 45 deletions
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index 99b9ddf21273..77fa4286e5e9 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -379,7 +379,7 @@ static int at76_usbdfu_download(struct usb_device *udev, u8 *buf, u32 size,
379 manifest_sync_timeout); 379 manifest_sync_timeout);
380 380
381 if (!size) { 381 if (!size) {
382 dev_printk(KERN_ERR, &udev->dev, "FW buffer length invalid!\n"); 382 dev_err(&udev->dev, "FW buffer length invalid!\n");
383 return -EINVAL; 383 return -EINVAL;
384 } 384 }
385 385
@@ -391,8 +391,8 @@ static int at76_usbdfu_download(struct usb_device *udev, u8 *buf, u32 size,
391 if (need_dfu_state) { 391 if (need_dfu_state) {
392 ret = at76_dfu_get_state(udev, &dfu_state); 392 ret = at76_dfu_get_state(udev, &dfu_state);
393 if (ret < 0) { 393 if (ret < 0) {
394 dev_printk(KERN_ERR, &udev->dev, 394 dev_err(&udev->dev,
395 "cannot get DFU state: %d\n", ret); 395 "cannot get DFU state: %d\n", ret);
396 goto exit; 396 goto exit;
397 } 397 }
398 need_dfu_state = 0; 398 need_dfu_state = 0;
@@ -407,9 +407,9 @@ static int at76_usbdfu_download(struct usb_device *udev, u8 *buf, u32 size,
407 dfu_timeout = at76_get_timeout(&dfu_stat_buf); 407 dfu_timeout = at76_get_timeout(&dfu_stat_buf);
408 need_dfu_state = 0; 408 need_dfu_state = 0;
409 } else 409 } else
410 dev_printk(KERN_ERR, &udev->dev, 410 dev_err(&udev->dev,
411 "at76_dfu_get_status returned %d\n", 411 "at76_dfu_get_status returned %d\n",
412 ret); 412 ret);
413 break; 413 break;
414 414
415 case STATE_DFU_DOWNLOAD_BUSY: 415 case STATE_DFU_DOWNLOAD_BUSY:
@@ -438,9 +438,9 @@ static int at76_usbdfu_download(struct usb_device *udev, u8 *buf, u32 size,
438 blockno++; 438 blockno++;
439 439
440 if (ret != bsize) 440 if (ret != bsize)
441 dev_printk(KERN_ERR, &udev->dev, 441 dev_err(&udev->dev,
442 "at76_load_int_fw_block " 442 "at76_load_int_fw_block returned %d\n",
443 "returned %d\n", ret); 443 ret);
444 need_dfu_state = 1; 444 need_dfu_state = 1;
445 break; 445 break;
446 446
@@ -1255,8 +1255,7 @@ static int at76_load_external_fw(struct usb_device *udev, struct fwentry *fwe)
1255 at76_dbg(DBG_DEVSTART, "opmode %d", op_mode); 1255 at76_dbg(DBG_DEVSTART, "opmode %d", op_mode);
1256 1256
1257 if (op_mode != OPMODE_NORMAL_NIC_WITHOUT_FLASH) { 1257 if (op_mode != OPMODE_NORMAL_NIC_WITHOUT_FLASH) {
1258 dev_printk(KERN_ERR, &udev->dev, "unexpected opmode %d\n", 1258 dev_err(&udev->dev, "unexpected opmode %d\n", op_mode);
1259 op_mode);
1260 return -EINVAL; 1259 return -EINVAL;
1261 } 1260 }
1262 1261
@@ -1275,9 +1274,9 @@ static int at76_load_external_fw(struct usb_device *udev, struct fwentry *fwe)
1275 size, bsize, blockno); 1274 size, bsize, blockno);
1276 ret = at76_load_ext_fw_block(udev, blockno, block, bsize); 1275 ret = at76_load_ext_fw_block(udev, blockno, block, bsize);
1277 if (ret != bsize) { 1276 if (ret != bsize) {
1278 dev_printk(KERN_ERR, &udev->dev, 1277 dev_err(&udev->dev,
1279 "loading %dth firmware block failed: %d\n", 1278 "loading %dth firmware block failed: %d\n",
1280 blockno, ret); 1279 blockno, ret);
1281 goto exit; 1280 goto exit;
1282 } 1281 }
1283 buf += bsize; 1282 buf += bsize;
@@ -1293,8 +1292,8 @@ static int at76_load_external_fw(struct usb_device *udev, struct fwentry *fwe)
1293exit: 1292exit:
1294 kfree(block); 1293 kfree(block);
1295 if (ret < 0) 1294 if (ret < 0)
1296 dev_printk(KERN_ERR, &udev->dev, 1295 dev_err(&udev->dev,
1297 "downloading external firmware failed: %d\n", ret); 1296 "downloading external firmware failed: %d\n", ret);
1298 return ret; 1297 return ret;
1299} 1298}
1300 1299
@@ -1308,8 +1307,8 @@ static int at76_load_internal_fw(struct usb_device *udev, struct fwentry *fwe)
1308 need_remap ? 0 : 2 * HZ); 1307 need_remap ? 0 : 2 * HZ);
1309 1308
1310 if (ret < 0) { 1309 if (ret < 0) {
1311 dev_printk(KERN_ERR, &udev->dev, 1310 dev_err(&udev->dev,
1312 "downloading internal fw failed with %d\n", ret); 1311 "downloading internal fw failed with %d\n", ret);
1313 goto exit; 1312 goto exit;
1314 } 1313 }
1315 1314
@@ -1319,8 +1318,8 @@ static int at76_load_internal_fw(struct usb_device *udev, struct fwentry *fwe)
1319 if (need_remap) { 1318 if (need_remap) {
1320 ret = at76_remap(udev); 1319 ret = at76_remap(udev);
1321 if (ret < 0) { 1320 if (ret < 0) {
1322 dev_printk(KERN_ERR, &udev->dev, 1321 dev_err(&udev->dev,
1323 "sending REMAP failed with %d\n", ret); 1322 "sending REMAP failed with %d\n", ret);
1324 goto exit; 1323 goto exit;
1325 } 1324 }
1326 } 1325 }
@@ -1555,11 +1554,10 @@ static struct fwentry *at76_load_firmware(struct usb_device *udev,
1555 at76_dbg(DBG_FW, "downloading firmware %s", fwe->fwname); 1554 at76_dbg(DBG_FW, "downloading firmware %s", fwe->fwname);
1556 ret = request_firmware(&fwe->fw, fwe->fwname, &udev->dev); 1555 ret = request_firmware(&fwe->fw, fwe->fwname, &udev->dev);
1557 if (ret < 0) { 1556 if (ret < 0) {
1558 dev_printk(KERN_ERR, &udev->dev, "firmware %s not found!\n", 1557 dev_err(&udev->dev, "firmware %s not found!\n",
1559 fwe->fwname); 1558 fwe->fwname);
1560 dev_printk(KERN_ERR, &udev->dev, 1559 dev_err(&udev->dev,
1561 "you may need to download the firmware from " 1560 "you may need to download the firmware from http://developer.berlios.de/projects/at76c503a/\n");
1562 "http://developer.berlios.de/projects/at76c503a/\n");
1563 goto exit; 1561 goto exit;
1564 } 1562 }
1565 1563
@@ -1567,17 +1565,17 @@ static struct fwentry *at76_load_firmware(struct usb_device *udev,
1567 fwh = (struct at76_fw_header *)(fwe->fw->data); 1565 fwh = (struct at76_fw_header *)(fwe->fw->data);
1568 1566
1569 if (fwe->fw->size <= sizeof(*fwh)) { 1567 if (fwe->fw->size <= sizeof(*fwh)) {
1570 dev_printk(KERN_ERR, &udev->dev, 1568 dev_err(&udev->dev,
1571 "firmware is too short (0x%zx)\n", fwe->fw->size); 1569 "firmware is too short (0x%zx)\n", fwe->fw->size);
1572 goto exit; 1570 goto exit;
1573 } 1571 }
1574 1572
1575 /* CRC currently not checked */ 1573 /* CRC currently not checked */
1576 fwe->board_type = le32_to_cpu(fwh->board_type); 1574 fwe->board_type = le32_to_cpu(fwh->board_type);
1577 if (fwe->board_type != board_type) { 1575 if (fwe->board_type != board_type) {
1578 dev_printk(KERN_ERR, &udev->dev, 1576 dev_err(&udev->dev,
1579 "board type mismatch, requested %u, got %u\n", 1577 "board type mismatch, requested %u, got %u\n",
1580 board_type, fwe->board_type); 1578 board_type, fwe->board_type);
1581 goto exit; 1579 goto exit;
1582 } 1580 }
1583 1581
@@ -2150,8 +2148,7 @@ static int at76_alloc_urbs(struct at76_priv *priv,
2150 } 2148 }
2151 2149
2152 if (!ep_in || !ep_out) { 2150 if (!ep_in || !ep_out) {
2153 dev_printk(KERN_ERR, &interface->dev, 2151 dev_err(&interface->dev, "bulk endpoints missing\n");
2154 "bulk endpoints missing\n");
2155 return -ENXIO; 2152 return -ENXIO;
2156 } 2153 }
2157 2154
@@ -2161,15 +2158,14 @@ static int at76_alloc_urbs(struct at76_priv *priv,
2161 priv->rx_urb = usb_alloc_urb(0, GFP_KERNEL); 2158 priv->rx_urb = usb_alloc_urb(0, GFP_KERNEL);
2162 priv->tx_urb = usb_alloc_urb(0, GFP_KERNEL); 2159 priv->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
2163 if (!priv->rx_urb || !priv->tx_urb) { 2160 if (!priv->rx_urb || !priv->tx_urb) {
2164 dev_printk(KERN_ERR, &interface->dev, "cannot allocate URB\n"); 2161 dev_err(&interface->dev, "cannot allocate URB\n");
2165 return -ENOMEM; 2162 return -ENOMEM;
2166 } 2163 }
2167 2164
2168 buffer_size = sizeof(struct at76_tx_buffer) + MAX_PADDING_SIZE; 2165 buffer_size = sizeof(struct at76_tx_buffer) + MAX_PADDING_SIZE;
2169 priv->bulk_out_buffer = kmalloc(buffer_size, GFP_KERNEL); 2166 priv->bulk_out_buffer = kmalloc(buffer_size, GFP_KERNEL);
2170 if (!priv->bulk_out_buffer) { 2167 if (!priv->bulk_out_buffer) {
2171 dev_printk(KERN_ERR, &interface->dev, 2168 dev_err(&interface->dev, "cannot allocate output buffer\n");
2172 "cannot allocate output buffer\n");
2173 return -ENOMEM; 2169 return -ENOMEM;
2174 } 2170 }
2175 2171
@@ -2230,8 +2226,7 @@ static int at76_init_new_device(struct at76_priv *priv,
2230 /* MAC address */ 2226 /* MAC address */
2231 ret = at76_get_hw_config(priv); 2227 ret = at76_get_hw_config(priv);
2232 if (ret < 0) { 2228 if (ret < 0) {
2233 dev_printk(KERN_ERR, &interface->dev, 2229 dev_err(&interface->dev, "cannot get MAC address\n");
2234 "cannot get MAC address\n");
2235 goto exit; 2230 goto exit;
2236 } 2231 }
2237 2232
@@ -2358,8 +2353,8 @@ static int at76_probe(struct usb_interface *interface,
2358 we get 204 with 2.4.23, Fiberline FL-WL240u (505A+RFMD2958) ??? */ 2353 we get 204 with 2.4.23, Fiberline FL-WL240u (505A+RFMD2958) ??? */
2359 2354
2360 if (op_mode == OPMODE_HW_CONFIG_MODE) { 2355 if (op_mode == OPMODE_HW_CONFIG_MODE) {
2361 dev_printk(KERN_ERR, &interface->dev, 2356 dev_err(&interface->dev,
2362 "cannot handle a device in HW_CONFIG_MODE\n"); 2357 "cannot handle a device in HW_CONFIG_MODE\n");
2363 ret = -EBUSY; 2358 ret = -EBUSY;
2364 goto error; 2359 goto error;
2365 } 2360 }
@@ -2371,9 +2366,9 @@ static int at76_probe(struct usb_interface *interface,
2371 "downloading internal firmware\n"); 2366 "downloading internal firmware\n");
2372 ret = at76_load_internal_fw(udev, fwe); 2367 ret = at76_load_internal_fw(udev, fwe);
2373 if (ret < 0) { 2368 if (ret < 0) {
2374 dev_printk(KERN_ERR, &interface->dev, 2369 dev_err(&interface->dev,
2375 "error %d downloading internal firmware\n", 2370 "error %d downloading internal firmware\n",
2376 ret); 2371 ret);
2377 goto error; 2372 goto error;
2378 } 2373 }
2379 usb_put_dev(udev); 2374 usb_put_dev(udev);
@@ -2408,8 +2403,8 @@ static int at76_probe(struct usb_interface *interface,
2408 /* Re-check firmware version */ 2403 /* Re-check firmware version */
2409 ret = at76_get_mib(udev, MIB_FW_VERSION, &fwv, sizeof(fwv)); 2404 ret = at76_get_mib(udev, MIB_FW_VERSION, &fwv, sizeof(fwv));
2410 if (ret < 0) { 2405 if (ret < 0) {
2411 dev_printk(KERN_ERR, &interface->dev, 2406 dev_err(&interface->dev,
2412 "error %d getting firmware version\n", ret); 2407 "error %d getting firmware version\n", ret);
2413 goto error; 2408 goto error;
2414 } 2409 }
2415 } 2410 }
@@ -2449,7 +2444,7 @@ static void at76_disconnect(struct usb_interface *interface)
2449 2444
2450 wiphy_info(priv->hw->wiphy, "disconnecting\n"); 2445 wiphy_info(priv->hw->wiphy, "disconnecting\n");
2451 at76_delete_device(priv); 2446 at76_delete_device(priv);
2452 dev_printk(KERN_INFO, &interface->dev, "disconnected\n"); 2447 dev_info(&interface->dev, "disconnected\n");
2453} 2448}
2454 2449
2455/* Structure for registering this driver with the USB subsystem */ 2450/* Structure for registering this driver with the USB subsystem */