|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
1 | 2 | /*
|
2 | 3 | * 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/>. |
16 | 4 | */
|
17 | 5 | #include <linux/version.h>
|
18 | 6 | #include <linux/module.h>
|
@@ -1027,7 +1015,7 @@ static int lan78xx_dataport_write(struct lan78xx_net *dev, u32 ram_select,
|
1027 | 1015 | static void lan78xx_set_addr_filter(struct lan78xx_priv *pdata,
|
1028 | 1016 | int index, u8 addr[ETH_ALEN])
|
1029 | 1017 | {
|
1030 |
| - u32 temp; |
| 1018 | + u32 temp; |
1031 | 1019 |
|
1032 | 1020 | if ((pdata) && (index > 0) && (index < NUM_OF_MAF)) {
|
1033 | 1021 | temp = addr[3];
|
@@ -2702,7 +2690,7 @@ static void lan78xx_terminate_urbs(struct lan78xx_net *dev)
|
2702 | 2690 |
|
2703 | 2691 | static int lan78xx_stop(struct net_device *net)
|
2704 | 2692 | {
|
2705 |
| - struct lan78xx_net *dev = netdev_priv(net); |
| 2693 | + struct lan78xx_net *dev = netdev_priv(net); |
2706 | 2694 |
|
2707 | 2695 | if (timer_pending(&dev->stat_monitor))
|
2708 | 2696 | del_timer_sync(&dev->stat_monitor);
|
@@ -2952,6 +2940,11 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf)
|
2952 | 2940 | int i;
|
2953 | 2941 |
|
2954 | 2942 | 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 | + } |
2955 | 2948 |
|
2956 | 2949 | dev->data[0] = (unsigned long)kzalloc(sizeof(*pdata), GFP_KERNEL);
|
2957 | 2950 |
|
@@ -3080,7 +3073,7 @@ static void lan78xx_rx_vlan_offload(struct lan78xx_net *dev,
|
3080 | 3073 |
|
3081 | 3074 | static void lan78xx_skb_return(struct lan78xx_net *dev, struct sk_buff *skb)
|
3082 | 3075 | {
|
3083 |
| - int status; |
| 3076 | + int status; |
3084 | 3077 |
|
3085 | 3078 | if (test_bit(EVENT_RX_PAUSED, &dev->flags)) {
|
3086 | 3079 | skb_queue_tail(&dev->rxq_pause, skb);
|
@@ -3640,10 +3633,10 @@ static void intr_complete(struct urb *urb)
|
3640 | 3633 |
|
3641 | 3634 | static void lan78xx_disconnect(struct usb_interface *intf)
|
3642 | 3635 | {
|
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; |
3647 | 3640 |
|
3648 | 3641 | dev = usb_get_intfdata(intf);
|
3649 | 3642 | usb_set_intfdata(intf, NULL);
|
@@ -3761,7 +3754,6 @@ static int lan78xx_probe(struct usb_interface *intf,
|
3761 | 3754 | ret = lan78xx_bind(dev, intf);
|
3762 | 3755 | if (ret < 0)
|
3763 | 3756 | goto out2;
|
3764 |
| - strcpy(netdev->name, "eth%d"); |
3765 | 3757 |
|
3766 | 3758 | if (netdev->mtu > (dev->hard_mtu - netdev->hard_header_len))
|
3767 | 3759 | netdev->mtu = dev->hard_mtu - netdev->hard_header_len;
|
|
0 commit comments