Skip to content

Commit d4cc597

Browse files
committed
Merge branch 'net-lan78xx-Minor-improvements'
Stefan Wahren says: ==================== net: lan78xx: Minor improvements This patch series contains some minor improvements for the lan78xx driver. Changes in V2: - Keep Copyright comment as multi-line - Add Raghuram's Reviewed-by ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 7848418 + 51ceac9 commit d4cc597

File tree

2 files changed

+14
-34
lines changed

2 files changed

+14
-34
lines changed

drivers/net/usb/lan78xx.c

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1+
// SPDX-License-Identifier: GPL-2.0+
12
/*
23
* Copyright (C) 2015 Microchip Technology
3-
*
4-
* This program is free software; you can redistribute it and/or
5-
* modify it under the terms of the GNU General Public License
6-
* as published by the Free Software Foundation; either version 2
7-
* of the License, or (at your option) any later version.
8-
*
9-
* This program is distributed in the hope that it will be useful,
10-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
* GNU General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU General Public License
15-
* along with this program; if not, see <http://www.gnu.org/licenses/>.
164
*/
175
#include <linux/version.h>
186
#include <linux/module.h>
@@ -1027,7 +1015,7 @@ static int lan78xx_dataport_write(struct lan78xx_net *dev, u32 ram_select,
10271015
static void lan78xx_set_addr_filter(struct lan78xx_priv *pdata,
10281016
int index, u8 addr[ETH_ALEN])
10291017
{
1030-
u32 temp;
1018+
u32 temp;
10311019

10321020
if ((pdata) && (index > 0) && (index < NUM_OF_MAF)) {
10331021
temp = addr[3];
@@ -2702,7 +2690,7 @@ static void lan78xx_terminate_urbs(struct lan78xx_net *dev)
27022690

27032691
static int lan78xx_stop(struct net_device *net)
27042692
{
2705-
struct lan78xx_net *dev = netdev_priv(net);
2693+
struct lan78xx_net *dev = netdev_priv(net);
27062694

27072695
if (timer_pending(&dev->stat_monitor))
27082696
del_timer_sync(&dev->stat_monitor);
@@ -2952,6 +2940,11 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf)
29522940
int i;
29532941

29542942
ret = lan78xx_get_endpoints(dev, intf);
2943+
if (ret) {
2944+
netdev_warn(dev->net, "lan78xx_get_endpoints failed: %d\n",
2945+
ret);
2946+
return ret;
2947+
}
29552948

29562949
dev->data[0] = (unsigned long)kzalloc(sizeof(*pdata), GFP_KERNEL);
29572950

@@ -3080,7 +3073,7 @@ static void lan78xx_rx_vlan_offload(struct lan78xx_net *dev,
30803073

30813074
static void lan78xx_skb_return(struct lan78xx_net *dev, struct sk_buff *skb)
30823075
{
3083-
int status;
3076+
int status;
30843077

30853078
if (test_bit(EVENT_RX_PAUSED, &dev->flags)) {
30863079
skb_queue_tail(&dev->rxq_pause, skb);
@@ -3640,10 +3633,10 @@ static void intr_complete(struct urb *urb)
36403633

36413634
static void lan78xx_disconnect(struct usb_interface *intf)
36423635
{
3643-
struct lan78xx_net *dev;
3644-
struct usb_device *udev;
3645-
struct net_device *net;
3646-
struct phy_device *phydev;
3636+
struct lan78xx_net *dev;
3637+
struct usb_device *udev;
3638+
struct net_device *net;
3639+
struct phy_device *phydev;
36473640

36483641
dev = usb_get_intfdata(intf);
36493642
usb_set_intfdata(intf, NULL);
@@ -3761,7 +3754,6 @@ static int lan78xx_probe(struct usb_interface *intf,
37613754
ret = lan78xx_bind(dev, intf);
37623755
if (ret < 0)
37633756
goto out2;
3764-
strcpy(netdev->name, "eth%d");
37653757

37663758
if (netdev->mtu > (dev->hard_mtu - netdev->hard_header_len))
37673759
netdev->mtu = dev->hard_mtu - netdev->hard_header_len;

drivers/net/usb/lan78xx.h

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1+
/* SPDX-License-Identifier: GPL-2.0+ */
12
/*
23
* Copyright (C) 2015 Microchip Technology
3-
*
4-
* This program is free software; you can redistribute it and/or
5-
* modify it under the terms of the GNU General Public License
6-
* as published by the Free Software Foundation; either version 2
7-
* of the License, or (at your option) any later version.
8-
*
9-
* This program is distributed in the hope that it will be useful,
10-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
* GNU General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU General Public License
15-
* along with this program; if not, see <http://www.gnu.org/licenses/>.
164
*/
175
#ifndef _LAN78XX_H
186
#define _LAN78XX_H

0 commit comments

Comments
 (0)