Commit d4cc5976 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 7848418e 51ceac9f
// SPDX-License-Identifier: GPL-2.0+
/* /*
* Copyright (C) 2015 Microchip Technology * Copyright (C) 2015 Microchip Technology
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
#include <linux/version.h> #include <linux/version.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -1027,7 +1015,7 @@ static int lan78xx_dataport_write(struct lan78xx_net *dev, u32 ram_select, ...@@ -1027,7 +1015,7 @@ static int lan78xx_dataport_write(struct lan78xx_net *dev, u32 ram_select,
static void lan78xx_set_addr_filter(struct lan78xx_priv *pdata, static void lan78xx_set_addr_filter(struct lan78xx_priv *pdata,
int index, u8 addr[ETH_ALEN]) int index, u8 addr[ETH_ALEN])
{ {
u32 temp; u32 temp;
if ((pdata) && (index > 0) && (index < NUM_OF_MAF)) { if ((pdata) && (index > 0) && (index < NUM_OF_MAF)) {
temp = addr[3]; temp = addr[3];
...@@ -2702,7 +2690,7 @@ static void lan78xx_terminate_urbs(struct lan78xx_net *dev) ...@@ -2702,7 +2690,7 @@ static void lan78xx_terminate_urbs(struct lan78xx_net *dev)
static int lan78xx_stop(struct net_device *net) static int lan78xx_stop(struct net_device *net)
{ {
struct lan78xx_net *dev = netdev_priv(net); struct lan78xx_net *dev = netdev_priv(net);
if (timer_pending(&dev->stat_monitor)) if (timer_pending(&dev->stat_monitor))
del_timer_sync(&dev->stat_monitor); del_timer_sync(&dev->stat_monitor);
...@@ -2952,6 +2940,11 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) ...@@ -2952,6 +2940,11 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf)
int i; int i;
ret = lan78xx_get_endpoints(dev, intf); ret = lan78xx_get_endpoints(dev, intf);
if (ret) {
netdev_warn(dev->net, "lan78xx_get_endpoints failed: %d\n",
ret);
return ret;
}
dev->data[0] = (unsigned long)kzalloc(sizeof(*pdata), GFP_KERNEL); dev->data[0] = (unsigned long)kzalloc(sizeof(*pdata), GFP_KERNEL);
...@@ -3080,7 +3073,7 @@ static void lan78xx_rx_vlan_offload(struct lan78xx_net *dev, ...@@ -3080,7 +3073,7 @@ static void lan78xx_rx_vlan_offload(struct lan78xx_net *dev,
static void lan78xx_skb_return(struct lan78xx_net *dev, struct sk_buff *skb) static void lan78xx_skb_return(struct lan78xx_net *dev, struct sk_buff *skb)
{ {
int status; int status;
if (test_bit(EVENT_RX_PAUSED, &dev->flags)) { if (test_bit(EVENT_RX_PAUSED, &dev->flags)) {
skb_queue_tail(&dev->rxq_pause, skb); skb_queue_tail(&dev->rxq_pause, skb);
...@@ -3640,10 +3633,10 @@ static void intr_complete(struct urb *urb) ...@@ -3640,10 +3633,10 @@ static void intr_complete(struct urb *urb)
static void lan78xx_disconnect(struct usb_interface *intf) static void lan78xx_disconnect(struct usb_interface *intf)
{ {
struct lan78xx_net *dev; struct lan78xx_net *dev;
struct usb_device *udev; struct usb_device *udev;
struct net_device *net; struct net_device *net;
struct phy_device *phydev; struct phy_device *phydev;
dev = usb_get_intfdata(intf); dev = usb_get_intfdata(intf);
usb_set_intfdata(intf, NULL); usb_set_intfdata(intf, NULL);
...@@ -3761,7 +3754,6 @@ static int lan78xx_probe(struct usb_interface *intf, ...@@ -3761,7 +3754,6 @@ static int lan78xx_probe(struct usb_interface *intf,
ret = lan78xx_bind(dev, intf); ret = lan78xx_bind(dev, intf);
if (ret < 0) if (ret < 0)
goto out2; goto out2;
strcpy(netdev->name, "eth%d");
if (netdev->mtu > (dev->hard_mtu - netdev->hard_header_len)) if (netdev->mtu > (dev->hard_mtu - netdev->hard_header_len))
netdev->mtu = dev->hard_mtu - netdev->hard_header_len; netdev->mtu = dev->hard_mtu - netdev->hard_header_len;
......
/* SPDX-License-Identifier: GPL-2.0+ */
/* /*
* Copyright (C) 2015 Microchip Technology * Copyright (C) 2015 Microchip Technology
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef _LAN78XX_H #ifndef _LAN78XX_H
#define _LAN78XX_H #define _LAN78XX_H
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment