aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/int51x1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb/int51x1.c')
-rw-r--r--drivers/net/usb/int51x1.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/usb/int51x1.c b/drivers/net/usb/int51x1.c
index 55cf7081de10..be02a25da71a 100644
--- a/drivers/net/usb/int51x1.c
+++ b/drivers/net/usb/int51x1.c
@@ -29,6 +29,7 @@
29#include <linux/netdevice.h> 29#include <linux/netdevice.h>
30#include <linux/etherdevice.h> 30#include <linux/etherdevice.h>
31#include <linux/ethtool.h> 31#include <linux/ethtool.h>
32#include <linux/slab.h>
32#include <linux/mii.h> 33#include <linux/mii.h>
33#include <linux/usb.h> 34#include <linux/usb.h>
34#include <linux/usb/usbnet.h> 35#include <linux/usb/usbnet.h>
@@ -51,7 +52,7 @@ static int int51x1_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
51 int len; 52 int len;
52 53
53 if (!(pskb_may_pull(skb, INT51X1_HEADER_SIZE))) { 54 if (!(pskb_may_pull(skb, INT51X1_HEADER_SIZE))) {
54 deverr(dev, "unexpected tiny rx frame"); 55 netdev_err(dev->net, "unexpected tiny rx frame\n");
55 return 0; 56 return 0;
56 } 57 }
57 58
@@ -138,25 +139,25 @@ static void int51x1_set_multicast(struct net_device *netdev)
138 if (netdev->flags & IFF_PROMISC) { 139 if (netdev->flags & IFF_PROMISC) {
139 /* do not expect to see traffic of other PLCs */ 140 /* do not expect to see traffic of other PLCs */
140 filter |= PACKET_TYPE_PROMISCUOUS; 141 filter |= PACKET_TYPE_PROMISCUOUS;
141 devinfo(dev, "promiscuous mode enabled"); 142 netdev_info(dev->net, "promiscuous mode enabled\n");
142 } else if (netdev->mc_count || 143 } else if (!netdev_mc_empty(netdev) ||
143 (netdev->flags & IFF_ALLMULTI)) { 144 (netdev->flags & IFF_ALLMULTI)) {
144 filter |= PACKET_TYPE_ALL_MULTICAST; 145 filter |= PACKET_TYPE_ALL_MULTICAST;
145 devdbg(dev, "receive all multicast enabled"); 146 netdev_dbg(dev->net, "receive all multicast enabled\n");
146 } else { 147 } else {
147 /* ~PROMISCUOUS, ~MULTICAST */ 148 /* ~PROMISCUOUS, ~MULTICAST */
148 devdbg(dev, "receive own packets only"); 149 netdev_dbg(dev->net, "receive own packets only\n");
149 } 150 }
150 151
151 urb = usb_alloc_urb(0, GFP_ATOMIC); 152 urb = usb_alloc_urb(0, GFP_ATOMIC);
152 if (!urb) { 153 if (!urb) {
153 devwarn(dev, "Error allocating URB"); 154 netdev_warn(dev->net, "Error allocating URB\n");
154 return; 155 return;
155 } 156 }
156 157
157 req = kmalloc(sizeof(*req), GFP_ATOMIC); 158 req = kmalloc(sizeof(*req), GFP_ATOMIC);
158 if (!req) { 159 if (!req) {
159 devwarn(dev, "Error allocating control msg"); 160 netdev_warn(dev->net, "Error allocating control msg\n");
160 goto out; 161 goto out;
161 } 162 }
162 163
@@ -173,7 +174,8 @@ static void int51x1_set_multicast(struct net_device *netdev)
173 174
174 status = usb_submit_urb(urb, GFP_ATOMIC); 175 status = usb_submit_urb(urb, GFP_ATOMIC);
175 if (status < 0) { 176 if (status < 0) {
176 devwarn(dev, "Error submitting control msg, sts=%d", status); 177 netdev_warn(dev->net, "Error submitting control msg, sts=%d\n",
178 status);
177 goto out1; 179 goto out1;
178 } 180 }
179 return; 181 return;