aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/net/wireless/at76c50x-usb.c85
-rw-r--r--drivers/net/wireless/iwlegacy/common.h5
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/trans.c28
3 files changed, 52 insertions, 66 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 */
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index b4bb813362bd..e254cba4557a 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -2919,9 +2919,8 @@ do { \
2919#define IL_DBG(level, fmt, args...) \ 2919#define IL_DBG(level, fmt, args...) \
2920do { \ 2920do { \
2921 if (il_get_debug_level(il) & level) \ 2921 if (il_get_debug_level(il) & level) \
2922 dev_printk(KERN_ERR, &il->hw->wiphy->dev, \ 2922 dev_err(&il->hw->wiphy->dev, "%c %s " fmt, \
2923 "%c %s " fmt, in_interrupt() ? 'I' : 'U', \ 2923 in_interrupt() ? 'I' : 'U', __func__ , ##args); \
2924 __func__ , ## args); \
2925} while (0) 2924} while (0)
2926 2925
2927#define il_print_hex_dump(il, level, p, len) \ 2926#define il_print_hex_dump(il, level, p, len) \
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index f95d88df7772..4d9dfa7de4ec 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -699,13 +699,11 @@ static void iwl_apm_config(struct iwl_trans *trans)
699 PCI_CFG_LINK_CTRL_VAL_L1_EN) { 699 PCI_CFG_LINK_CTRL_VAL_L1_EN) {
700 /* L1-ASPM enabled; disable(!) L0S */ 700 /* L1-ASPM enabled; disable(!) L0S */
701 iwl_set_bit(trans, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); 701 iwl_set_bit(trans, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED);
702 dev_printk(KERN_INFO, trans->dev, 702 dev_info(trans->dev, "L1 Enabled; Disabling L0S\n");
703 "L1 Enabled; Disabling L0S\n");
704 } else { 703 } else {
705 /* L1-ASPM disabled; enable(!) L0S */ 704 /* L1-ASPM disabled; enable(!) L0S */
706 iwl_clear_bit(trans, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED); 705 iwl_clear_bit(trans, CSR_GIO_REG, CSR_GIO_REG_VAL_L0S_ENABLED);
707 dev_printk(KERN_INFO, trans->dev, 706 dev_info(trans->dev, "L1 Disabled; Enabling L0S\n");
708 "L1 Disabled; Enabling L0S\n");
709 } 707 }
710 trans->pm_support = !(lctl & PCI_CFG_LINK_CTRL_VAL_L0S_EN); 708 trans->pm_support = !(lctl & PCI_CFG_LINK_CTRL_VAL_L0S_EN);
711} 709}
@@ -2150,34 +2148,29 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
2150 DMA_BIT_MASK(32)); 2148 DMA_BIT_MASK(32));
2151 /* both attempts failed: */ 2149 /* both attempts failed: */
2152 if (err) { 2150 if (err) {
2153 dev_printk(KERN_ERR, &pdev->dev, 2151 dev_err(&pdev->dev, "No suitable DMA available\n");
2154 "No suitable DMA available.\n");
2155 goto out_pci_disable_device; 2152 goto out_pci_disable_device;
2156 } 2153 }
2157 } 2154 }
2158 2155
2159 err = pci_request_regions(pdev, DRV_NAME); 2156 err = pci_request_regions(pdev, DRV_NAME);
2160 if (err) { 2157 if (err) {
2161 dev_printk(KERN_ERR, &pdev->dev, 2158 dev_err(&pdev->dev, "pci_request_regions failed\n");
2162 "pci_request_regions failed\n");
2163 goto out_pci_disable_device; 2159 goto out_pci_disable_device;
2164 } 2160 }
2165 2161
2166 trans_pcie->hw_base = pci_ioremap_bar(pdev, 0); 2162 trans_pcie->hw_base = pci_ioremap_bar(pdev, 0);
2167 if (!trans_pcie->hw_base) { 2163 if (!trans_pcie->hw_base) {
2168 dev_printk(KERN_ERR, &pdev->dev, "pci_ioremap_bar failed\n"); 2164 dev_err(&pdev->dev, "pci_ioremap_bar failed\n");
2169 err = -ENODEV; 2165 err = -ENODEV;
2170 goto out_pci_release_regions; 2166 goto out_pci_release_regions;
2171 } 2167 }
2172 2168
2173 dev_printk(KERN_INFO, &pdev->dev, 2169 dev_info(&pdev->dev, "pci_resource_len = 0x%08llx\n",
2174 "pci_resource_len = 0x%08llx\n", 2170 (unsigned long long) pci_resource_len(pdev, 0));
2175 (unsigned long long) pci_resource_len(pdev, 0)); 2171 dev_info(&pdev->dev, "pci_resource_base = %p\n", trans_pcie->hw_base);
2176 dev_printk(KERN_INFO, &pdev->dev,
2177 "pci_resource_base = %p\n", trans_pcie->hw_base);
2178 2172
2179 dev_printk(KERN_INFO, &pdev->dev, 2173 dev_info(&pdev->dev, "HW Revision ID = 0x%X\n", pdev->revision);
2180 "HW Revision ID = 0x%X\n", pdev->revision);
2181 2174
2182 /* We disable the RETRY_TIMEOUT register (0x41) to keep 2175 /* We disable the RETRY_TIMEOUT register (0x41) to keep
2183 * PCI Tx retries from interfering with C3 CPU state */ 2176 * PCI Tx retries from interfering with C3 CPU state */
@@ -2185,8 +2178,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
2185 2178
2186 err = pci_enable_msi(pdev); 2179 err = pci_enable_msi(pdev);
2187 if (err) 2180 if (err)
2188 dev_printk(KERN_ERR, &pdev->dev, 2181 dev_err(&pdev->dev, "pci_enable_msi failed(0X%x)\n", err);
2189 "pci_enable_msi failed(0X%x)\n", err);
2190 2182
2191 trans->dev = &pdev->dev; 2183 trans->dev = &pdev->dev;
2192 trans_pcie->irq = pdev->irq; 2184 trans_pcie->irq = pdev->irq;