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: YAMANE Toshiaki <[email protected]>
---
drivers/staging/gdm72xx/gdm_wimax.c | 60 ++++++++++++++++++-----------------
1 file changed, 31 insertions(+), 29 deletions(-)
diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c
index dad6fd3..c302769 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.c
+++ b/drivers/staging/gdm72xx/gdm_wimax.c
@@ -11,6 +11,8 @@
* GNU General Public License for more details.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/etherdevice.h>
#include <asm/byteorder.h>
#include <linux/ip.h>
@@ -274,7 +276,7 @@ static int gdm_wimax_event_init(void)
return 0;
}
- printk(KERN_ERR "Creating WiMax Event netlink is failed\n");
+ pr_err("Creating WiMax Event netlink is failed\n");
return -1;
}
@@ -370,7 +372,7 @@ static int gdm_wimax_event_send(struct net_device *dev, char *buf, int size)
e = get_event_entry();
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);
return -ENOMEM;
}
@@ -436,10 +438,10 @@ static int gdm_wimax_tx(struct sk_buff *skb, struct net_device *dev)
#if !defined(LOOPBACK_TEST)
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) {
- printk(KERN_EMERG "ASSERTION ERROR: Device is NOT ready. status=%d\n",
- fsm->m_status);
+ netdev_emerg(dev, "ASSERTION ERROR: Device is NOT ready. status=%d\n",
+ fsm->m_status);
kfree_skb(skb);
return 0;
}
@@ -625,9 +627,8 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
case SIOCG_DATA:
case SIOCS_DATA:
if (req->data_id >= SIOC_DATA_MAX) {
- printk(KERN_ERR
- "%s error: data-index(%d) is invalid!!\n",
- __func__, req->data_id);
+ netdev_err(dev, "%s error: data-index(%d) is invalid!!\n",
+ __func__, req->data_id);
return -EOPNOTSUPP;
}
if (req->cmd == SIOCG_DATA) {
@@ -649,7 +650,7 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
}
break;
default:
- printk(KERN_ERR "%s: %x unknown ioctl\n", __func__, cmd);
+ netdev_err(dev, "%s: %x unknown ioctl\n", __func__, cmd);
return -EOPNOTSUPP;
}
@@ -695,7 +696,7 @@ static void gdm_wimax_prepare_device(struct net_device *dev)
hci->length = H2B(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)
@@ -729,28 +730,28 @@ static int gdm_wimax_get_prepared_info(struct net_device *dev, char *buf,
cmd_len = B2H(*(u16 *)&buf[2]);
if (len < cmd_len + HCI_HEADER_SIZE) {
- printk(KERN_ERR "%s: invalid length [%d/%d]\n", __func__,
- cmd_len + HCI_HEADER_SIZE, len);
+ netdev_err(dev, "%s: invalid length [%d/%d]\n", __func__,
+ cmd_len + HCI_HEADER_SIZE, len);
return -1;
}
if (cmd_evt == WIMAX_GET_INFO_RESULT) {
if (cmd_len < 2) {
- printk(KERN_ERR "%s: len is too short [%x/%d]\n",
- __func__, cmd_evt, len);
+ netdev_err(dev, "%s: len is too short [%x/%d]\n",
+ __func__, cmd_evt, len);
return -1;
}
pos += gdm_wimax_hci_get_tlv(&buf[pos], &T, &L, &V);
if (T == TLV_T(T_MAC_ADDRESS)) {
if (L != dev->addr_len) {
- printk(KERN_ERR
- "%s Invalid inofrmation result T/L "
- "[%x/%d]\n", __func__, T, L);
+ netdev_err(dev,
+ "%s Invalid inofrmation result T/L [%x/%d]\n",
+ __func__, T, L);
return -1;
}
- printk(KERN_INFO "MAC change [%pM]->[%pM]\n",
- dev->dev_addr, V);
+ netdev_info(dev, "MAC change [%pM]->[%pM]\n",
+ dev->dev_addr, V);
memcpy(dev->dev_addr, V, dev->addr_len);
return 1;
}
@@ -772,7 +773,7 @@ static void gdm_wimax_netif_rx(struct net_device *dev, char *buf, int len)
skb = dev_alloc_skb(len + 2);
if (!skb) {
- printk(KERN_ERR "%s: dev_alloc_skb failed!\n", __func__);
+ netdev_err(dev, "%s: dev_alloc_skb failed!\n", __func__);
return;
}
skb_reserve(skb, 2);
@@ -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);
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,
@@ -802,8 +803,8 @@ static void gdm_wimax_transmit_aggr_pkt(struct net_device *dev, char *buf,
hci = (struct hci_s *) buf;
if (B2H(hci->cmd_evt) != WIMAX_RX_SDU) {
- printk(KERN_ERR "Wrong cmd_evt(0x%04X)\n",
- B2H(hci->cmd_evt));
+ netdev_err(dev, "Wrong cmd_evt(0x%04X)\n",
+ B2H(hci->cmd_evt));
break;
}
@@ -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)
- printk(KERN_ERR "%s: invalid length [%d/%d]\n",
- __func__, cmd_len + HCI_HEADER_SIZE, len);
+ netdev_err(dev, "%s: invalid length [%d/%d]\n",
+ __func__, cmd_len + HCI_HEADER_SIZE, len);
return;
}
@@ -918,7 +919,8 @@ static void prepare_rx_complete(void *arg, void *data, int len)
gdm_wimax_rcv_with_cb(nic, rx_complete, nic);
else {
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);
#if 0
/* Re-prepare WiMax device */
@@ -952,7 +954,7 @@ int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev)
"wm%d", ether_setup);
if (dev == NULL) {
- printk(KERN_ERR "alloc_etherdev failed\n");
+ pr_err("alloc_etherdev failed\n");
return -ENOMEM;
}
@@ -972,7 +974,7 @@ int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev)
/* event socket init */
ret = gdm_wimax_event_init();
if (ret < 0) {
- printk(KERN_ERR "Cannot create event.\n");
+ pr_err("Cannot create event.\n");
goto cleanup;
}
@@ -999,7 +1001,7 @@ int register_wimax_device(struct phy_dev *phy_dev, struct device *pdev)
return 0;
cleanup:
- printk(KERN_ERR "register_netdev failed\n");
+ pr_err("register_netdev failed\n");
free_netdev(dev);
return ret;
}
--
1.7.9.5
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ...
and add pr_fmt.
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/gdm72xx/gdm_qos.c | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c
index e26c6a8..1e63031 100644
--- a/drivers/staging/gdm72xx/gdm_qos.c
+++ b/drivers/staging/gdm72xx/gdm_qos.c
@@ -11,6 +11,8 @@
* GNU General Public License for more details.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/etherdevice.h>
#include <asm/byteorder.h>
@@ -24,15 +26,6 @@
#define B2H(x) __be16_to_cpu(x)
-#undef dprintk
-#define dprintk(fmt, args ...) printk(KERN_DEBUG "[QoS] " fmt, ## args)
-#undef wprintk
-#define wprintk(fmt, args ...) \
- printk(KERN_WARNING "[QoS WARNING] " fmt, ## args)
-#undef eprintk
-#define eprintk(fmt, args ...) printk(KERN_ERR "[QoS ERROR] " fmt, ## args)
-
-
#define MAX_FREE_LIST_CNT 32
static struct {
struct list_head head;
@@ -95,7 +88,7 @@ static void free_qos_entry_list(struct list_head *free_list)
total_free++;
}
- dprintk("%s: total_free_cnt=%d\n", __func__, total_free);
+ pr_debug("%s: total_free_cnt=%d\n", __func__, total_free);
}
void gdm_qos_init(void *nic_ptr)
@@ -240,7 +233,9 @@ static u32 extract_qos_list(struct nic *nic, struct list_head *head)
qcb->csr[i].qos_buf_count++;
if (!list_empty(&qcb->qos_list[i]))
- wprintk("QoS Index(%d) is piled!!\n", i);
+ netdev_warn(nic->netdev,
+ "Index(%d) is piled!!\n",
+ i);
}
}
}
@@ -280,7 +275,8 @@ int gdm_qos_send_hci_pkt(struct sk_buff *skb, struct net_device *dev)
entry = alloc_qos_entry();
entry->skb = skb;
entry->dev = dev;
- dprintk("qcb->qos_list_cnt=%d\n", qcb->qos_list_cnt);
+ netdev_dbg(dev, "qcb->qos_list_cnt=%d\n",
+ qcb->qos_list_cnt);
}
spin_lock_irqsave(&qcb->qos_lock, flags);
@@ -362,7 +358,7 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size)
index = get_csr(qcb, SFID, 0);
if (index == -1) {
spin_unlock_irqrestore(&qcb->qos_lock, flags);
- eprintk("QoS ERROR: No SF\n");
+ netdev_err(nic->netdev, "QoS ERROR: No SF\n");
return;
}
qcb->csr[index].qos_buf_count = buf[(i*5)+10];
@@ -383,11 +379,12 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size)
index = get_csr(qcb, SFID, 1);
if (index == -1) {
- eprintk("QoS ERROR: csr Update Error\n");
+ netdev_err(nic->netdev, "QoS ERROR: csr Update Error\n");
return;
}
- dprintk("QOS_ADD SFID = 0x%x, index=%d\n", SFID, index);
+ netdev_dbg(nic->netdev, "QOS_ADD SFID = 0x%x, index=%d\n",
+ SFID, index);
spin_lock_irqsave(&qcb->qos_lock, flags);
qcb->csr[index].SFID = SFID;
@@ -435,11 +432,13 @@ void gdm_recv_qos_hci_packet(void *nic_ptr, u8 *buf, int size)
SFID += (buf[pos++]);
index = get_csr(qcb, SFID, 1);
if (index == -1) {
- eprintk("QoS ERROR: Wrong index(%d)\n", index);
+ netdev_err(nic->netdev, "QoS ERROR: Wrong index(%d)\n",
+ index);
return;
}
- dprintk("QOS_CHANGE_DEL SFID = 0x%x, index=%d\n", SFID, index);
+ netdev_dbg(nic->netdev, "QOS_CHANGE_DEL SFID = 0x%x, index=%d\n",
+ SFID, index);
INIT_LIST_HEAD(&free_list);
--
1.7.9.5
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
and add pr_fmt.
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/gdm72xx/netlink_k.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/gdm72xx/netlink_k.c b/drivers/staging/gdm72xx/netlink_k.c
index 20d0aec..52c25ba 100644
--- a/drivers/staging/gdm72xx/netlink_k.c
+++ b/drivers/staging/gdm72xx/netlink_k.c
@@ -11,6 +11,8 @@
* GNU General Public License for more details.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/etherdevice.h>
#include <linux/netlink.h>
@@ -54,8 +56,8 @@ static void netlink_rcv_cb(struct sk_buff *skb)
if (skb->len < nlh->nlmsg_len ||
nlh->nlmsg_len > ND_MAX_MSG_LEN) {
- printk(KERN_ERR "Invalid length (%d,%d)\n", skb->len,
- nlh->nlmsg_len);
+ netdev_err(skb->dev, "Invalid length (%d,%d)\n",
+ skb->len, nlh->nlmsg_len);
return;
}
@@ -69,10 +71,11 @@ static void netlink_rcv_cb(struct sk_buff *skb)
rcv_cb(dev, nlh->nlmsg_type, msg, mlen);
dev_put(dev);
} else
- printk(KERN_ERR "dev_get_by_index(%d) "
- "is not found.\n", ifindex);
+ netdev_err(skb->dev,
+ "dev_get_by_index(%d) is not found.\n",
+ ifindex);
} else
- printk(KERN_ERR "Unregistered Callback\n");
+ netdev_err(skb->dev, "Unregistered Callback\n");
}
}
@@ -116,14 +119,14 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
int ret = 0;
if (group > ND_MAX_GROUP) {
- printk(KERN_ERR "Group %d is invalied.\n", group);
- printk(KERN_ERR "Valid group is 0 ~ %d.\n", ND_MAX_GROUP);
+ pr_err("Group %d is invalied.\n", group);
+ pr_err("Valid group is 0 ~ %d.\n", ND_MAX_GROUP);
return -EINVAL;
}
skb = alloc_skb(NLMSG_SPACE(len), GFP_ATOMIC);
if (!skb) {
- printk(KERN_ERR "netlink_broadcast ret=%d\n", ret);
+ pr_err("netlink_broadcast ret=%d\n", ret);
return -ENOMEM;
}
@@ -144,8 +147,8 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
return len;
else {
if (ret != -ESRCH) {
- printk(KERN_ERR "netlink_broadcast g=%d, t=%d, l=%d, r=%d\n",
- group, type, len, ret);
+ pr_err("netlink_broadcast g=%d, t=%d, l=%d, r=%d\n",
+ group, type, len, ret);
}
ret = 0;
}
--
1.7.9.5
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/gdm72xx/gdm_sdio.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/gdm72xx/gdm_sdio.c b/drivers/staging/gdm72xx/gdm_sdio.c
index ca38d71..8b8ed98 100644
--- a/drivers/staging/gdm72xx/gdm_sdio.c
+++ b/drivers/staging/gdm72xx/gdm_sdio.c
@@ -157,7 +157,7 @@ static int init_sdio(struct sdiowm_dev *sdev)
tx->sdu_buf = kmalloc(SDU_TX_BUF_SIZE, GFP_KERNEL);
if (tx->sdu_buf == NULL) {
- printk(KERN_ERR "Failed to allocate SDU tx buffer.\n");
+ dev_err(&sdev->func->dev, "Failed to allocate SDU tx buffer.\n");
goto fail;
}
@@ -186,7 +186,7 @@ static int init_sdio(struct sdiowm_dev *sdev)
rx->rx_buf = kmalloc(RX_BUF_SIZE, GFP_KERNEL);
if (rx->rx_buf == NULL) {
- printk(KERN_ERR "Failed to allocate rx buffer.\n");
+ dev_err(&sdev->func->dev, "Failed to allocate rx buffer.\n");
goto fail;
}
@@ -246,7 +246,8 @@ static void send_sdio_pkt(struct sdio_func *func, u8 *data, int len)
ret = sdio_memcpy_toio(func, 0, data, n);
if (ret < 0) {
if (ret != -ENOMEDIUM)
- printk(KERN_ERR "gdmwms: %s error: ret = %d\n",
+ dev_err(&func->dev,
+ "gdmwms: %s error: ret = %d\n",
__func__, ret);
goto end_io;
}
@@ -259,7 +260,8 @@ static void send_sdio_pkt(struct sdio_func *func, u8 *data, int len)
ret = sdio_memcpy_toio(func, 0, data + n, remain);
if (ret < 0) {
if (ret != -ENOMEDIUM)
- printk(KERN_ERR "gdmwms: %s error: ret = %d\n",
+ dev_err(&func->dev,
+ "gdmwms: %s error: ret = %d\n",
__func__, ret);
goto end_io;
}
@@ -522,13 +524,14 @@ static void gdm_sdio_irq(struct sdio_func *func)
ret = sdio_memcpy_fromio(func, hdr, 0x0, TYPE_A_LOOKAHEAD_SIZE);
if (ret) {
- printk(KERN_ERR "Cannot read from function %d\n", func->num);
+ dev_err(&func->dev,
+ "Cannot read from function %d\n", func->num);
goto done;
}
len = (hdr[2] << 16) | (hdr[1] << 8) | hdr[0];
if (len > (RX_BUF_SIZE - TYPE_A_HEADER_SIZE)) {
- printk(KERN_ERR "Too big Type-A size: %d\n", len);
+ dev_err(&func->dev, "Too big Type-A size: %d\n", len);
goto done;
}
@@ -562,8 +565,8 @@ static void gdm_sdio_irq(struct sdio_func *func)
n = blocks * func->cur_blksize;
ret = sdio_memcpy_fromio(func, buf, 0x0, n);
if (ret) {
- printk(KERN_ERR "Cannot read from function %d\n",
- func->num);
+ dev_err(&func->dev,
+ "Cannot read from function %d\n", func->num);
goto done;
}
buf += n;
@@ -573,8 +576,8 @@ static void gdm_sdio_irq(struct sdio_func *func)
if (remain) {
ret = sdio_memcpy_fromio(func, buf, 0x0, remain);
if (ret) {
- printk(KERN_ERR "Cannot read from function %d\n",
- func->num);
+ dev_err(&func->dev,
+ "Cannot read from function %d\n", func->num);
goto done;
}
}
@@ -637,9 +640,9 @@ static int sdio_wimax_probe(struct sdio_func *func,
struct phy_dev *phy_dev = NULL;
struct sdiowm_dev *sdev = NULL;
- printk(KERN_INFO "Found GDM SDIO VID = 0x%04x PID = 0x%04x...\n",
- func->vendor, func->device);
- printk(KERN_INFO "GCT WiMax driver version %s\n", DRIVER_VERSION);
+ dev_info(&func->dev, "Found GDM SDIO VID = 0x%04x PID = 0x%04x...\n",
+ func->vendor, func->device);
+ dev_info(&func->dev, "GCT WiMax driver version %s\n", DRIVER_VERSION);
sdio_claim_host(func);
sdio_enable_func(func);
--
1.7.9.5
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/gdm72xx/sdio_boot.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/gdm72xx/sdio_boot.c b/drivers/staging/gdm72xx/sdio_boot.c
index 38feb1a..6291829 100644
--- a/drivers/staging/gdm72xx/sdio_boot.c
+++ b/drivers/staging/gdm72xx/sdio_boot.c
@@ -65,15 +65,15 @@ static int download_image(struct sdio_func *func, const char *img_name)
ret = request_firmware(&firm, img_name, &func->dev);
if (ret < 0) {
- printk(KERN_ERR
- "requesting firmware %s failed with error %d\n",
+ dev_err(&func->dev,
+ "requesting firmware %s failed with error %d\n",
img_name, ret);
return ret;
}
buf = kmalloc(DOWNLOAD_SIZE + TYPE_A_HEADER_SIZE, GFP_KERNEL);
if (buf == NULL) {
- printk(KERN_ERR "Error: kmalloc\n");
+ dev_err(&func->dev, "Error: kmalloc\n");
return -ENOMEM;
}
@@ -101,8 +101,9 @@ static int download_image(struct sdio_func *func, const char *img_name)
memcpy(buf+TYPE_A_HEADER_SIZE, firm->data + pos, len);
ret = sdio_memcpy_toio(func, 0, buf, len + TYPE_A_HEADER_SIZE);
if (ret < 0) {
- printk(KERN_ERR "gdmwm: send image error: "
- "packet number = %d ret = %d\n", pno, ret);
+ dev_err(&func->dev,
+ "send image error: packet number = %d ret = %d\n",
+ pno, ret);
goto out;
}
@@ -110,13 +111,14 @@ static int download_image(struct sdio_func *func, const char *img_name)
break;
if (!ack_ready(func)) {
ret = -EIO;
- printk(KERN_ERR "gdmwm: Ack is not ready.\n");
+ dev_err(&func->dev, "Ack is not ready.\n");
goto out;
}
ret = sdio_memcpy_fromio(func, buf, 0, TYPE_A_LOOKAHEAD_SIZE);
if (ret < 0) {
- printk(KERN_ERR "gdmwm: receive ack error: "
- "packet number = %d ret = %d\n", pno, ret);
+ dev_err(&func->dev,
+ "receive ack error: packet number = %d ret = %d\n",
+ pno, ret);
goto out;
}
sdio_writeb(func, 0x01, 0x13, &ret);
@@ -140,19 +142,20 @@ int sdio_boot(struct sdio_func *func)
tx_buf = kmalloc(YMEM0_SIZE, GFP_KERNEL);
if (tx_buf == NULL) {
- printk(KERN_ERR "Error: kmalloc: %s %d\n", __func__, __LINE__);
+ dev_err(&func->dev, "Error: kmalloc: %s %d\n",
+ __func__, __LINE__);
return -ENOMEM;
}
ret = download_image(func, krn_name);
if (ret)
goto restore_fs;
- printk(KERN_INFO "GCT: Kernel download success.\n");
+ dev_info(&func->dev, "GCT: Kernel download success.\n");
ret = download_image(func, rfs_name);
if (ret)
goto restore_fs;
- printk(KERN_INFO "GCT: Filesystem download success.\n");
+ dev_info(&func->dev, "GCT: Filesystem download success.\n");
restore_fs:
kfree(tx_buf);
--
1.7.9.5
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/gdm72xx/gdm_usb.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/gdm72xx/gdm_usb.c b/drivers/staging/gdm72xx/gdm_usb.c
index 39db582..435037f 100644
--- a/drivers/staging/gdm72xx/gdm_usb.c
+++ b/drivers/staging/gdm72xx/gdm_usb.c
@@ -305,7 +305,7 @@ static int gdm_usb_send(void *priv_dev, void *data, int len,
unsigned long flags;
if (!udev->usbdev) {
- printk(KERN_ERR "%s: No such device\n", __func__);
+ dev_err(&usbdev->dev, "%s: No such device\n", __func__);
return -ENODEV;
}
@@ -484,7 +484,7 @@ static int gdm_usb_receive(void *priv_dev,
unsigned long flags;
if (!udev->usbdev) {
- printk(KERN_ERR "%s: No such device\n", __func__);
+ dev_err(&usbdev->dev, "%s: No such device\n", __func__);
return -ENODEV;
}
@@ -559,9 +559,9 @@ static int gdm_usb_probe(struct usb_interface *intf,
idProduct = L2H(usbdev->descriptor.idProduct);
bcdDevice = L2H(usbdev->descriptor.bcdDevice);
- printk(KERN_INFO "Found GDM USB VID = 0x%04x PID = 0x%04x...\n",
- idVendor, idProduct);
- printk(KERN_INFO "GCT WiMax driver version %s\n", DRIVER_VERSION);
+ dev_info(&intf->dev, "Found GDM USB VID = 0x%04x PID = 0x%04x...\n",
+ idVendor, idProduct);
+ dev_info(&intf->dev, "GCT WiMax driver version %s\n", DRIVER_VERSION);
if (idProduct == EMERGENCY_PID) {
--
1.7.9.5
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...
Signed-off-by: YAMANE Toshiaki <[email protected]>
---
drivers/staging/gdm72xx/usb_boot.c | 49 ++++++++++++++++++------------------
1 file changed, 25 insertions(+), 24 deletions(-)
diff --git a/drivers/staging/gdm72xx/usb_boot.c b/drivers/staging/gdm72xx/usb_boot.c
index 0787188..3e2103a 100644
--- a/drivers/staging/gdm72xx/usb_boot.c
+++ b/drivers/staging/gdm72xx/usb_boot.c
@@ -82,7 +82,8 @@ static int gdm_wibro_send(struct usb_device *usbdev, void *data, int len)
&actual, 1000);
if (ret < 0) {
- printk(KERN_ERR "Error : usb_bulk_msg ( result = %d )\n", ret);
+ dev_err(&usbdev->dev, "Error : usb_bulk_msg ( result = %d )\n",
+ ret);
return ret;
}
return 0;
@@ -97,8 +98,8 @@ static int gdm_wibro_recv(struct usb_device *usbdev, void *data, int len)
&actual, 5000);
if (ret < 0) {
- printk(KERN_ERR "Error : usb_bulk_msg(recv) ( result = %d )\n",
- ret);
+ dev_err(&usbdev->dev,
+ "Error : usb_bulk_msg(recv) ( result = %d )\n", ret);
return ret;
}
return 0;
@@ -150,20 +151,20 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
ret = request_firmware(&firm, img_name, &usbdev->dev);
if (ret < 0) {
- printk(KERN_ERR
- "requesting firmware %s failed with error %d\n",
+ dev_err(&usbdev->dev,
+ "requesting firmware %s failed with error %d\n",
img_name, ret);
return ret;
}
tx_buf = kmalloc(DOWNLOAD_SIZE, GFP_KERNEL);
if (tx_buf == NULL) {
- printk(KERN_ERR "Error: kmalloc\n");
+ dev_err(&usbdev->dev, "Error: kmalloc\n");
return -ENOMEM;
}
if (firm->size < sizeof(hdr)) {
- printk(KERN_ERR "gdmwm: Cannot read the image info.\n");
+ dev_err(&usbdev->dev, "Cannot read the image info.\n");
ret = -EIO;
goto out;
}
@@ -172,23 +173,22 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
array_le32_to_cpu((u32 *)&hdr, 19);
#if 0
if (hdr.magic_code != 0x10767fff) {
- printk(KERN_ERR "gdmwm: Invalid magic code 0x%08x\n",
+ dev_err(&usbdev->dev, "Invalid magic code 0x%08x\n",
hdr.magic_code);
ret = -EINVAL;
goto out;
}
#endif
if (hdr.count > MAX_IMG_CNT) {
- printk(KERN_ERR "gdmwm: Too many images. %d\n", hdr.count);
+ dev_err(&usbdev->dev, "Too many images. %d\n", hdr.count);
ret = -EINVAL;
goto out;
}
for (i = 0; i < hdr.count; i++) {
if (hdr.offset[i] > hdr.len) {
- printk(KERN_ERR "gdmwm: Invalid offset. "
- "Entry = %d Offset = 0x%08x "
- "Image length = 0x%08x\n",
+ dev_err(&usbdev->dev,
+ "Invalid offset. Entry = %d Offset = 0x%08x Image length = 0x%08x\n",
i, hdr.offset[i], hdr.len);
ret = -EINVAL;
goto out;
@@ -196,7 +196,7 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
pos = hdr.offset[i];
if (firm->size < sizeof(fw_info) + pos) {
- printk(KERN_ERR "gdmwm: Cannot read the FW info.\n");
+ dev_err(&usbdev->dev, "Cannot read the FW info.\n");
ret = -EIO;
goto out;
}
@@ -205,7 +205,7 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
array_le32_to_cpu((u32 *)&fw_info, 8);
#if 0
if ((fw_info.id & 0xfffff000) != 0x10767000) {
- printk(KERN_ERR "gdmwm: Invalid FW id. 0x%08x\n",
+ dev_err(&usbdev->dev, "Invalid FW id. 0x%08x\n",
fw_info.id);
ret = -EIO;
goto out;
@@ -217,7 +217,7 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
pos = hdr.offset[i] + fw_info.kernel_offset;
if (firm->size < fw_info.kernel_len + pos) {
- printk(KERN_ERR "gdmwm: Kernel FW is too small.\n");
+ dev_err(&usbdev->dev, "Kernel FW is too small.\n");
goto out;
}
@@ -225,24 +225,25 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
fw_info.kernel_len, DN_KERNEL_MAGIC_NUMBER);
if (ret < 0)
goto out;
- printk(KERN_INFO "GCT: Kernel download success.\n");
+ dev_info(&usbdev->dev, "GCT: Kernel download success.\n");
pos = hdr.offset[i] + fw_info.rootfs_offset;
if (firm->size < fw_info.rootfs_len + pos) {
- printk(KERN_ERR "gdmwm: Filesystem FW is too small.\n");
+ dev_err(&usbdev->dev, "Filesystem FW is too small.\n");
goto out;
}
ret = download_image(usbdev, firm, pos, fw_info.rootfs_len,
DN_ROOTFS_MAGIC_NUMBER);
if (ret < 0)
goto out;
- printk(KERN_INFO "GCT: Filesystem download success.\n");
+ dev_info(&usbdev->dev, "GCT: Filesystem download success.\n");
break;
}
if (i == hdr.count) {
- printk(KERN_ERR "Firmware for gsk%x is not installed.\n", pid);
+ dev_err(&usbdev->dev, "Firmware for gsk%x is not installed.\n",
+ pid);
ret = -EINVAL;
}
out:
@@ -293,15 +294,15 @@ static int em_download_image(struct usb_device *usbdev, const char *img_name,
ret = request_firmware(&firm, img_name, &usbdev->dev);
if (ret < 0) {
- printk(KERN_ERR
- "requesting firmware %s failed with error %d\n",
+ dev_err(&usbdev->dev,
+ "requesting firmware %s failed with error %d\n",
img_name, ret);
return ret;
}
buf = kmalloc(DOWNLOAD_CHUCK + pad_size, GFP_KERNEL);
if (buf == NULL) {
- printk(KERN_ERR "Error: kmalloc\n");
+ dev_err(&usbdev->dev, "Error: kmalloc\n");
return -ENOMEM;
}
@@ -366,12 +367,12 @@ int usb_emergency(struct usb_device *usbdev)
ret = em_download_image(usbdev, kern_name, KERNEL_TYPE_STRING);
if (ret < 0)
return ret;
- printk(KERN_INFO "GCT Emergency: Kernel download success.\n");
+ dev_err(&usbdev->dev, "GCT Emergency: Kernel download success.\n");
ret = em_download_image(usbdev, fs_name, FS_TYPE_STRING);
if (ret < 0)
return ret;
- printk(KERN_INFO "GCT Emergency: Filesystem download success.\n");
+ dev_info(&usbdev->dev, "GCT Emergency: Filesystem download success.\n");
ret = em_fw_reset(usbdev);
--
1.7.9.5