Skip to contentSkip to conversation

staging: gdm724x: use netdev_err() instead of pr_err()

PATCH New Lourdes Pedrajas 1 participant 1 message Mar 20, 2020 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: gdm724x: use netdev_err() instead of pr_err()

use netdev_err() which is a message printing function specific for network devices instead of pr_err(), in function netlink_send().

---
 drivers/staging/gdm724x/gdm_lte.c   | 2 +-
 drivers/staging/gdm724x/netlink_k.c | 7 ++++---
 drivers/staging/gdm724x/netlink_k.h | 3 ++-
 3 files changed, 7 insertions(+), 5 deletions(-)
drivers/staging/gdm724x/gdm_lte.c +1 -1
index db11498f6fc7..354727f0a1fc 100644
@@ -513,7 +513,7 @@ static int gdm_lte_event_send(struct net_device *dev, char *buf, int len)
 
 	length = gdm_dev16_to_cpu(phy_dev->get_endian(phy_dev->priv_dev),
 				  hci->len) + HCI_HEADER_SIZE;
-	return netlink_send(lte_event.sock, idx, 0, buf, length);
+	return netlink_send(lte_event.sock, idx, 0, buf, length, dev);
 }
 
 static void gdm_lte_event_rcv(struct net_device *dev, u16 type,
drivers/staging/gdm724x/netlink_k.c +4 -3
index 92440c3f055b..7902e52a699b 100644
@@ -89,7 +89,8 @@ struct sock *netlink_init(int unit,
 	return sock;
 }
 
-int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
+int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len,
+		 struct net_device *dev)
 {
 	static u32 seq;
 	struct sk_buff *skb = NULL;
@@ -118,8 +119,8 @@ int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
 		return len;
 
 	if (ret != -ESRCH)
-		pr_err("nl broadcast g=%d, t=%d, l=%d, r=%d\n",
-		       group, type, len, ret);
+		netdev_err(dev, "nl broadcast g=%d, t=%d, l=%d, r=%d\n",
+			   group, type, len, ret);
 	else if (netlink_has_listeners(sock, group + 1))
 		return -EAGAIN;
 
drivers/staging/gdm724x/netlink_k.h +2 -1
index c9e1d3b2d54f..d42eea9bea3e 100644
@@ -10,6 +10,7 @@
 struct sock *netlink_init(int unit,
 			  void (*cb)(struct net_device *dev,
 				     u16 type, void *msg, int len));
-int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len);
+int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len,
+		 struct net_device *dev);
 
 #endif /* _NETLINK_K_H_ */
Signature · 1 line
2.17.1