Skip to content

Commit

Permalink
libertas: Convert lbs_pr_<level> to pr_<level>
Browse files Browse the repository at this point in the history
Use the standard pr_<level> functions eases grep a bit.

Added a few missing terminating newlines to messages.
Coalesced long formats.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Joe Perches authored and John W. Linville committed May 11, 2011
1 parent 9fcce61 commit 0e4e06a
Show file tree
Hide file tree
Showing 12 changed files with 173 additions and 171 deletions.
15 changes: 8 additions & 7 deletions drivers/net/wireless/libertas/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/sched.h>
#include <linux/wait.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -1322,8 +1324,7 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
sme->ssid, sme->ssid_len,
WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
if (!bss) {
lbs_pr_err("assoc: bss %pM not in scan results\n",
sme->bssid);
pr_err("assoc: bss %pM not in scan results\n", sme->bssid);
ret = -ENOENT;
goto done;
}
Expand Down Expand Up @@ -1380,8 +1381,8 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
lbs_enable_rsn(priv, sme->crypto.cipher_group != 0);
break;
default:
lbs_pr_err("unsupported cipher group 0x%x\n",
sme->crypto.cipher_group);
pr_err("unsupported cipher group 0x%x\n",
sme->crypto.cipher_group);
ret = -ENOTSUPP;
goto done;
}
Expand Down Expand Up @@ -1499,7 +1500,7 @@ static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev,
params->key, params->key_len);
break;
default:
lbs_pr_err("unhandled cipher 0x%x\n", params->cipher);
pr_err("unhandled cipher 0x%x\n", params->cipher);
ret = -ENOTSUPP;
break;
}
Expand Down Expand Up @@ -2127,13 +2128,13 @@ int lbs_cfg_register(struct lbs_private *priv)

ret = wiphy_register(wdev->wiphy);
if (ret < 0)
lbs_pr_err("cannot register wiphy device\n");
pr_err("cannot register wiphy device\n");

priv->wiphy_registered = true;

ret = register_netdev(priv->dev);
if (ret)
lbs_pr_err("cannot register network device\n");
pr_err("cannot register network device\n");

INIT_DELAYED_WORK(&priv->scan_work, lbs_scan_worker);

Expand Down
36 changes: 18 additions & 18 deletions drivers/net/wireless/libertas/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* It prepares command and sends it to firmware when it is ready.
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/kfifo.h>
#include <linux/sched.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -110,7 +112,7 @@ int lbs_update_hw_spec(struct lbs_private *priv)
* CF card firmware 5.0.16p0: cap 0x00000303
* USB dongle firmware 5.110.17p2: cap 0x00000303
*/
lbs_pr_info("%pM, fw %u.%u.%up%u, cap 0x%08x\n",
pr_info("%pM, fw %u.%u.%up%u, cap 0x%08x\n",
cmd.permanentaddr,
priv->fwrelease >> 24 & 0xff,
priv->fwrelease >> 16 & 0xff,
Expand Down Expand Up @@ -141,7 +143,7 @@ int lbs_update_hw_spec(struct lbs_private *priv)
/* if it's unidentified region code, use the default (USA) */
if (i >= MRVDRV_MAX_REGION_CODE) {
priv->regioncode = 0x10;
lbs_pr_info("unidentified region code; using the default (USA)\n");
pr_info("unidentified region code; using the default (USA)\n");
}

if (priv->current_addr[0] == 0xff)
Expand Down Expand Up @@ -211,7 +213,7 @@ int lbs_host_sleep_cfg(struct lbs_private *priv, uint32_t criteria,
(uint8_t *)&cmd_config.wol_conf,
sizeof(struct wol_config));
} else {
lbs_pr_info("HOST_SLEEP_CFG failed %d\n", ret);
pr_info("HOST_SLEEP_CFG failed %d\n", ret);
}

return ret;
Expand Down Expand Up @@ -314,7 +316,7 @@ static int lbs_wait_for_ds_awake(struct lbs_private *priv)
if (priv->is_deep_sleep) {
if (!wait_event_interruptible_timeout(priv->ds_awake_q,
!priv->is_deep_sleep, (10 * HZ))) {
lbs_pr_err("ds_awake_q: timer expired\n");
pr_err("ds_awake_q: timer expired\n");
ret = -1;
}
}
Expand All @@ -339,7 +341,7 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
netif_carrier_off(priv->dev);
}
} else {
lbs_pr_err("deep sleep: already enabled\n");
pr_err("deep sleep: already enabled\n");
}
} else {
if (priv->is_deep_sleep) {
Expand All @@ -349,8 +351,7 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
if (!ret) {
ret = lbs_wait_for_ds_awake(priv);
if (ret)
lbs_pr_err("deep sleep: wakeup"
"failed\n");
pr_err("deep sleep: wakeup failed\n");
}
}
}
Expand Down Expand Up @@ -384,8 +385,8 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep)
ret = lbs_host_sleep_cfg(priv, priv->wol_criteria,
(struct wol_config *)NULL);
if (ret) {
lbs_pr_info("Host sleep configuration failed: "
"%d\n", ret);
pr_info("Host sleep configuration failed: %d\n",
ret);
return ret;
}
if (priv->psstate == PS_STATE_FULL_POWER) {
Expand All @@ -395,19 +396,19 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep)
sizeof(cmd),
lbs_ret_host_sleep_activate, 0);
if (ret)
lbs_pr_info("HOST_SLEEP_ACTIVATE "
"failed: %d\n", ret);
pr_info("HOST_SLEEP_ACTIVATE failed: %d\n",
ret);
}

if (!wait_event_interruptible_timeout(
priv->host_sleep_q,
priv->is_host_sleep_activated,
(10 * HZ))) {
lbs_pr_err("host_sleep_q: timer expired\n");
pr_err("host_sleep_q: timer expired\n");
ret = -1;
}
} else {
lbs_pr_err("host sleep: already enabled\n");
pr_err("host sleep: already enabled\n");
}
} else {
if (priv->is_host_sleep_activated)
Expand Down Expand Up @@ -1007,7 +1008,7 @@ static void lbs_submit_command(struct lbs_private *priv,
ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) cmd, cmdsize);

if (ret) {
lbs_pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret);
pr_info("DNLD_CMD: hw_host_to_card failed: %d\n", ret);
/* Let the timer kick in and retry, and potentially reset
the whole thing if the condition persists */
timeo = HZ/4;
Expand Down Expand Up @@ -1276,7 +1277,7 @@ int lbs_execute_next_command(struct lbs_private *priv)
spin_lock_irqsave(&priv->driver_lock, flags);

if (priv->cur_cmd) {
lbs_pr_alert( "EXEC_NEXT_CMD: already processing command!\n");
pr_alert( "EXEC_NEXT_CMD: already processing command!\n");
spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1;
goto done;
Expand Down Expand Up @@ -1438,7 +1439,7 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
ret = priv->hw_host_to_card(priv, MVMS_CMD, (u8 *) &confirm_sleep,
sizeof(confirm_sleep));
if (ret) {
lbs_pr_alert("confirm_sleep failed\n");
pr_alert("confirm_sleep failed\n");
goto out;
}

Expand Down Expand Up @@ -1664,8 +1665,7 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command,
spin_lock_irqsave(&priv->driver_lock, flags);
ret = cmdnode->result;
if (ret)
lbs_pr_info("PREP_CMD: command 0x%04x failed: %d\n",
command, ret);
pr_info("PREP_CMD: command 0x%04x failed: %d\n", command, ret);

__lbs_cleanup_and_insert_cmd(priv, cmdnode);
spin_unlock_irqrestore(&priv->driver_lock, flags);
Expand Down
29 changes: 17 additions & 12 deletions drivers/net/wireless/libertas/cmdresp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* This file contains the handling of command
* responses as well as events generated by firmware.
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/sched.h>
Expand Down Expand Up @@ -85,15 +88,17 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, len);

if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) {
lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n",
le16_to_cpu(resp->seqnum), le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n",
le16_to_cpu(resp->seqnum),
le16_to_cpu(priv->cur_cmd->cmdbuf->seqnum));
spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1;
goto done;
}
if (respcmd != CMD_RET(curcmd) &&
respcmd != CMD_RET_802_11_ASSOCIATE && curcmd != CMD_802_11_ASSOCIATE) {
lbs_pr_info("Invalid CMD_RESP %x to command %x!\n", respcmd, curcmd);
pr_info("Invalid CMD_RESP %x to command %x!\n",
respcmd, curcmd);
spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1;
goto done;
Expand All @@ -102,8 +107,8 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
if (resp->result == cpu_to_le16(0x0004)) {
/* 0x0004 means -EAGAIN. Drop the response, let it time out
and be resubmitted */
lbs_pr_info("Firmware returns DEFER to command %x. Will let it time out...\n",
le16_to_cpu(resp->command));
pr_info("Firmware returns DEFER to command %x. Will let it time out...\n",
le16_to_cpu(resp->command));
spin_unlock_irqrestore(&priv->driver_lock, flags);
ret = -1;
goto done;
Expand Down Expand Up @@ -314,28 +319,28 @@ int lbs_process_event(struct lbs_private *priv, u32 event)
lbs_deb_cmd("EVENT: ADHOC beacon lost\n");
break;
case MACREG_INT_CODE_RSSI_LOW:
lbs_pr_alert("EVENT: rssi low\n");
pr_alert("EVENT: rssi low\n");
break;
case MACREG_INT_CODE_SNR_LOW:
lbs_pr_alert("EVENT: snr low\n");
pr_alert("EVENT: snr low\n");
break;
case MACREG_INT_CODE_MAX_FAIL:
lbs_pr_alert("EVENT: max fail\n");
pr_alert("EVENT: max fail\n");
break;
case MACREG_INT_CODE_RSSI_HIGH:
lbs_pr_alert("EVENT: rssi high\n");
pr_alert("EVENT: rssi high\n");
break;
case MACREG_INT_CODE_SNR_HIGH:
lbs_pr_alert("EVENT: snr high\n");
pr_alert("EVENT: snr high\n");
break;

case MACREG_INT_CODE_MESH_AUTO_STARTED:
/* Ignore spurious autostart events */
lbs_pr_info("EVENT: MESH_AUTO_STARTED (ignoring)\n");
pr_info("EVENT: MESH_AUTO_STARTED (ignoring)\n");
break;

default:
lbs_pr_alert("EVENT: unknown event id %d\n", event);
pr_alert("EVENT: unknown event id %d\n", event);
break;
}

Expand Down
6 changes: 4 additions & 2 deletions drivers/net/wireless/libertas/debugfs.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/dcache.h>
#include <linux/debugfs.h>
#include <linux/delay.h>
Expand Down Expand Up @@ -151,13 +153,13 @@ static ssize_t lbs_host_sleep_write(struct file *file,
ret = lbs_set_host_sleep(priv, 0);
else if (host_sleep == 1) {
if (priv->wol_criteria == EHS_REMOVE_WAKEUP) {
lbs_pr_info("wake parameters not configured");
pr_info("wake parameters not configured\n");
ret = -EINVAL;
goto out_unlock;
}
ret = lbs_set_host_sleep(priv, 1);
} else {
lbs_pr_err("invalid option\n");
pr_err("invalid option\n");
ret = -EINVAL;
}

Expand Down
7 changes: 0 additions & 7 deletions drivers/net/wireless/libertas/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,6 @@ do { if ((lbs_debug & (grp)) == (grp)) \
#define lbs_deb_spi(fmt, args...) LBS_DEB_LL(LBS_DEB_SPI, " spi", fmt, ##args)
#define lbs_deb_cfg80211(fmt, args...) LBS_DEB_LL(LBS_DEB_CFG80211, " cfg80211", fmt, ##args)

#define lbs_pr_info(format, args...) \
printk(KERN_INFO DRV_NAME": " format, ## args)
#define lbs_pr_err(format, args...) \
printk(KERN_ERR DRV_NAME": " format, ## args)
#define lbs_pr_alert(format, args...) \
printk(KERN_ALERT DRV_NAME": " format, ## args)

#ifdef DEBUG
static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, int len)
{
Expand Down
Loading

0 comments on commit 0e4e06a

Please sign in to comment.