Commit f57cee11 authored by YAMANE Toshiaki's avatar YAMANE Toshiaki Committed by Greg Kroah-Hartman

staging/gdm72xx: Use netdev_ or pr_ printks in gdm_wimax.c

fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
- WARNING: Prefer netdev_emerg(netdev, ... then dev_emerg(dev, ... then pr_emerg(...  to printk(KERN_EMERG ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...

and add pr_fmt.
Signed-off-by: default avatarYAMANE Toshiaki <yamanetoshi@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d6c31c12
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include <linux/ip.h> #include <linux/ip.h>
...@@ -274,7 +276,7 @@ static int gdm_wimax_event_init(void) ...@@ -274,7 +276,7 @@ static int gdm_wimax_event_init(void)
return 0; return 0;
} }
printk(KERN_ERR "Creating WiMax Event netlink is failed\n"); pr_err("Creating WiMax Event netlink is failed\n");
return -1; return -1;
} }
...@@ -370,7 +372,7 @@ static int gdm_wimax_event_send(struct net_device *dev, char *buf, int size) ...@@ -370,7 +372,7 @@ static int gdm_wimax_event_send(struct net_device *dev, char *buf, int size)
e = get_event_entry(); e = get_event_entry();
if (!e) { if (!e) {
printk(KERN_ERR "%s: No memory for event\n", __func__); netdev_err(dev, "%s: No memory for event\n", __func__);
spin_unlock_irqrestore(&wm_event.evt_lock, flags); spin_unlock_irqrestore(&wm_event.evt_lock, flags);
return -ENOMEM; return -ENOMEM;
} }
...@@ -436,10 +438,10 @@ static int gdm_wimax_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -436,10 +438,10 @@ static int gdm_wimax_tx(struct sk_buff *skb, struct net_device *dev)
#if !defined(LOOPBACK_TEST) #if !defined(LOOPBACK_TEST)
if (!fsm) if (!fsm)
printk(KERN_ERR "ASSERTION ERROR: fsm is NULL!!\n"); netdev_err(dev, "ASSERTION ERROR: fsm is NULL!!\n");
else if (fsm->m_status != M_CONNECTED) { else if (fsm->m_status != M_CONNECTED) {
printk(KERN_EMERG "ASSERTION ERROR: Device is NOT ready. status=%d\n", netdev_emerg(dev, "ASSERTION ERROR: Device is NOT ready. status=%d\n",
fsm->m_status); fsm->m_status);
kfree_skb(skb); kfree_skb(skb);
return 0; return 0;
} }
...@@ -625,9 +627,8 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -625,9 +627,8 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
case SIOCG_DATA: case SIOCG_DATA:
case SIOCS_DATA: case SIOCS_DATA:
if (req->data_id >= SIOC_DATA_MAX) { if (req->data_id >= SIOC_DATA_MAX) {
printk(KERN_ERR netdev_err(dev, "%s error: data-index(%d) is invalid!!\n",
"%s error: data-index(%d) is invalid!!\n", __func__, req->data_id);
__func__, req->data_id);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
if (req->cmd == SIOCG_DATA) { if (req->cmd == SIOCG_DATA) {
...@@ -649,7 +650,7 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -649,7 +650,7 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
} }
break; break;
default: default:
printk(KERN_ERR "%s: %x unknown ioctl\n", __func__, cmd); netdev_err(dev, "%s: %x unknown ioctl\n", __func__, cmd);
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
...@@ -695,7 +696,7 @@ static void gdm_wimax_prepare_device(struct net_device *dev) ...@@ -695,7 +696,7 @@ static void gdm_wimax_prepare_device(struct net_device *dev)
hci->length = H2B(len); hci->length = H2B(len);
gdm_wimax_send(nic, hci, HCI_HEADER_SIZE+len); gdm_wimax_send(nic, hci, HCI_HEADER_SIZE+len);
printk(KERN_INFO "GDM WiMax Set CAPABILITY: 0x%08X\n", DB2H(val)); netdev_info(dev, "GDM WiMax Set CAPABILITY: 0x%08X\n", DB2H(val));
} }
static int gdm_wimax_hci_get_tlv(u8 *buf, u8 *T, u16 *L, u8 **V) static int gdm_wimax_hci_get_tlv(u8 *buf, u8 *T, u16 *L, u8 **V)
...@@ -729,28 +730,28 @@ static int gdm_wimax_get_prepared_info(struct net_device *dev, char *buf, ...@@ -729,28 +730,28 @@ static int gdm_wimax_get_prepared_info(struct net_device *dev, char *buf,
cmd_len = B2H(*(u16 *)&buf[2]); cmd_len = B2H(*(u16 *)&buf[2]);
if (len < cmd_len + HCI_HEADER_SIZE) { if (len < cmd_len + HCI_HEADER_SIZE) {
printk(KERN_ERR "%s: invalid length [%d/%d]\n", __func__, netdev_err(dev, "%s: invalid length [%d/%d]\n", __func__,
cmd_len + HCI_HEADER_SIZE, len); cmd_len + HCI_HEADER_SIZE, len);
return -1; return -1;
} }
if (cmd_evt == WIMAX_GET_INFO_RESULT) { if (cmd_evt == WIMAX_GET_INFO_RESULT) {
if (cmd_len < 2) { if (cmd_len < 2) {
printk(KERN_ERR "%s: len is too short [%x/%d]\n", netdev_err(dev, "%s: len is too short [%x/%d]\n",
__func__, cmd_evt, len); __func__, cmd_evt, len);
return -1; return -1;
} }
pos += gdm_wimax_hci_get_tlv(&buf[pos], &T, &L, &V); pos += gdm_wimax_hci_get_tlv(&buf[pos], &T, &L, &V);
if (T == TLV_T(T_MAC_ADDRESS)) { if (T == TLV_T(T_MAC_ADDRESS)) {
if (L != dev->addr_len) { if (L != dev->addr_len) {
printk(KERN_ERR netdev_err(dev,
"%s Invalid inofrmation result T/L " "%s Invalid inofrmation result T/L [%x/%d]\n",
"[%x/%d]\n", __func__, T, L); __func__, T, L);
return -1; return -1;
} }
printk(KERN_INFO "MAC change [%pM]->[%pM]\n", netdev_info(dev, "MAC change [%pM]->[%pM]\n",
dev->dev_addr, V); dev->dev_addr, V);
memcpy(dev->dev_addr, V, dev->addr_len); memcpy(dev->dev_addr, V, dev->addr_len);
return 1; return 1;
} }
...@@ -772,7 +773,7 @@ static void gdm_wimax_netif_rx(struct net_device *dev, char *buf, int len) ...@@ -772,7 +773,7 @@ static void gdm_wimax_netif_rx(struct net_device *dev, char *buf, int len)
skb = dev_alloc_skb(len + 2); skb = dev_alloc_skb(len + 2);
if (!skb) { if (!skb) {
printk(KERN_ERR "%s: dev_alloc_skb failed!\n", __func__); netdev_err(dev, "%s: dev_alloc_skb failed!\n", __func__);
return; return;
} }
skb_reserve(skb, 2); skb_reserve(skb, 2);
...@@ -787,7 +788,7 @@ static void gdm_wimax_netif_rx(struct net_device *dev, char *buf, int len) ...@@ -787,7 +788,7 @@ static void gdm_wimax_netif_rx(struct net_device *dev, char *buf, int len)
ret = in_interrupt() ? netif_rx(skb) : netif_rx_ni(skb); ret = in_interrupt() ? netif_rx(skb) : netif_rx_ni(skb);
if (ret == NET_RX_DROP) if (ret == NET_RX_DROP)
printk(KERN_ERR "%s skb dropped\n", __func__); netdev_err(dev, "%s skb dropped\n", __func__);
} }
static void gdm_wimax_transmit_aggr_pkt(struct net_device *dev, char *buf, static void gdm_wimax_transmit_aggr_pkt(struct net_device *dev, char *buf,
...@@ -802,8 +803,8 @@ static void gdm_wimax_transmit_aggr_pkt(struct net_device *dev, char *buf, ...@@ -802,8 +803,8 @@ static void gdm_wimax_transmit_aggr_pkt(struct net_device *dev, char *buf,
hci = (struct hci_s *) buf; hci = (struct hci_s *) buf;
if (B2H(hci->cmd_evt) != WIMAX_RX_SDU) { if (B2H(hci->cmd_evt) != WIMAX_RX_SDU) {
printk(KERN_ERR "Wrong cmd_evt(0x%04X)\n", netdev_err(dev, "Wrong cmd_evt(0x%04X)\n",
B2H(hci->cmd_evt)); B2H(hci->cmd_evt));
break; break;
} }
...@@ -837,8 +838,8 @@ static void gdm_wimax_transmit_pkt(struct net_device *dev, char *buf, int len) ...@@ -837,8 +838,8 @@ static void gdm_wimax_transmit_pkt(struct net_device *dev, char *buf, int len)
if (len < cmd_len + HCI_HEADER_SIZE) { if (len < cmd_len + HCI_HEADER_SIZE) {
if (len) if (len)
printk(KERN_ERR "%s: invalid length [%d/%d]\n", netdev_err(dev, "%s: invalid length [%d/%d]\n",
__func__, cmd_len + HCI_HEADER_SIZE, len); __func__, cmd_len + HCI_HEADER_SIZE, len);
return; return;
} }
...@@ -918,7 +919,8 @@ static void prepare_rx_complete(void *arg, void *data, int len) ...@@ -918,7 +919,8 @@ static void prepare_rx_complete(void *arg, void *data, int len)
gdm_wimax_rcv_with_cb(nic, rx_complete, nic); gdm_wimax_rcv_with_cb(nic, rx_complete, nic);
else { else {
if (ret < 0) if (ret < 0)
printk(KERN_ERR "get_prepared_info failed(%d)\n", ret); netdev_err(nic->netdev,
"get_prepared_info failed(%d)\n", ret);
gdm_wimax_rcv_with_cb(nic, prepare_rx_complete, nic); gdm_wimax_rcv_with_cb(nic, prepare_rx_complete, nic);
#if 0 #if 0
/* Re-prepare WiMax device */ /* Re-prepare WiMax device */
...@@ -952,7 +954,7 @@ int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev) ...@@ -952,7 +954,7 @@ int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev)
"wm%d", ether_setup); "wm%d", ether_setup);
if (dev == NULL) { if (dev == NULL) {
printk(KERN_ERR "alloc_etherdev failed\n"); pr_err("alloc_etherdev failed\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -972,7 +974,7 @@ int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev) ...@@ -972,7 +974,7 @@ int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev)
/* event socket init */ /* event socket init */
ret = gdm_wimax_event_init(); ret = gdm_wimax_event_init();
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "Cannot create event.\n"); pr_err("Cannot create event.\n");
goto cleanup; goto cleanup;
} }
...@@ -999,7 +1001,7 @@ int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev) ...@@ -999,7 +1001,7 @@ int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev)
return 0; return 0;
cleanup: cleanup:
printk(KERN_ERR "register_netdev failed\n"); pr_err("register_netdev failed\n");
free_netdev(dev); free_netdev(dev);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment