.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * smc91x.c |
---|
3 | 4 | * This is a driver for SMSC's 91C9x/91C1xx single-chip Ethernet devices. |
---|
.. | .. |
---|
7 | 8 | * Developed by Simple Network Magic Corporation |
---|
8 | 9 | * Copyright (C) 2003 Monta Vista Software, Inc. |
---|
9 | 10 | * Unified SMC91x driver by Nicolas Pitre |
---|
10 | | - * |
---|
11 | | - * This program is free software; you can redistribute it and/or modify |
---|
12 | | - * it under the terms of the GNU General Public License as published by |
---|
13 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
14 | | - * (at your option) any later version. |
---|
15 | | - * |
---|
16 | | - * This program is distributed in the hope that it will be useful, |
---|
17 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
19 | | - * GNU General Public License for more details. |
---|
20 | | - * |
---|
21 | | - * You should have received a copy of the GNU General Public License |
---|
22 | | - * along with this program; if not, see <http://www.gnu.org/licenses/>. |
---|
23 | 11 | * |
---|
24 | 12 | * Arguments: |
---|
25 | 13 | * io = for the base address |
---|
.. | .. |
---|
390 | 378 | pending_skb = lp->pending_tx_skb; |
---|
391 | 379 | lp->pending_tx_skb = NULL; |
---|
392 | 380 | spin_unlock_irq(&lp->lock); |
---|
393 | | - if (pending_skb) |
---|
394 | | - dev_kfree_skb(pending_skb); |
---|
| 381 | + dev_kfree_skb(pending_skb); |
---|
395 | 382 | |
---|
396 | 383 | /* and tell the card to stay away from that nasty outside world */ |
---|
397 | 384 | SMC_SELECT_BANK(lp, 0); |
---|
.. | .. |
---|
548 | 535 | /* |
---|
549 | 536 | * This is called to actually send a packet to the chip. |
---|
550 | 537 | */ |
---|
551 | | -static void smc_hardware_send_pkt(unsigned long data) |
---|
| 538 | +static void smc_hardware_send_pkt(struct tasklet_struct *t) |
---|
552 | 539 | { |
---|
553 | | - struct net_device *dev = (struct net_device *)data; |
---|
554 | | - struct smc_local *lp = netdev_priv(dev); |
---|
| 540 | + struct smc_local *lp = from_tasklet(lp, t, tx_task); |
---|
| 541 | + struct net_device *dev = lp->dev; |
---|
555 | 542 | void __iomem *ioaddr = lp->base; |
---|
556 | 543 | struct sk_buff *skb; |
---|
557 | 544 | unsigned int packet_no, len; |
---|
.. | .. |
---|
701 | 688 | * Allocation succeeded: push packet to the chip's own memory |
---|
702 | 689 | * immediately. |
---|
703 | 690 | */ |
---|
704 | | - smc_hardware_send_pkt((unsigned long)dev); |
---|
| 691 | + smc_hardware_send_pkt(&lp->tx_task); |
---|
705 | 692 | } |
---|
706 | 693 | |
---|
707 | 694 | return NETDEV_TX_OK; |
---|
.. | .. |
---|
1049 | 1036 | int phyaddr = lp->mii.phy_id; |
---|
1050 | 1037 | int my_phy_caps; /* My PHY capabilities */ |
---|
1051 | 1038 | int my_ad_caps; /* My Advertised capabilities */ |
---|
1052 | | - int status; |
---|
1053 | 1039 | |
---|
1054 | 1040 | DBG(3, dev, "smc_program_phy()\n"); |
---|
1055 | 1041 | |
---|
.. | .. |
---|
1123 | 1109 | * auto-negotiation is restarted, sometimes it isn't ready and |
---|
1124 | 1110 | * the link does not come up. |
---|
1125 | 1111 | */ |
---|
1126 | | - status = smc_phy_read(dev, phyaddr, MII_ADVERTISE); |
---|
| 1112 | + smc_phy_read(dev, phyaddr, MII_ADVERTISE); |
---|
1127 | 1113 | |
---|
1128 | 1114 | DBG(2, dev, "phy caps=%x\n", my_phy_caps); |
---|
1129 | 1115 | DBG(2, dev, "phy advertised caps=%x\n", my_ad_caps); |
---|
.. | .. |
---|
1334 | 1320 | #endif |
---|
1335 | 1321 | |
---|
1336 | 1322 | /* Our watchdog timed out. Called by the networking layer */ |
---|
1337 | | -static void smc_timeout(struct net_device *dev) |
---|
| 1323 | +static void smc_timeout(struct net_device *dev, unsigned int txqueue) |
---|
1338 | 1324 | { |
---|
1339 | 1325 | struct smc_local *lp = netdev_priv(dev); |
---|
1340 | 1326 | void __iomem *ioaddr = lp->base; |
---|
.. | .. |
---|
1978 | 1964 | dev->netdev_ops = &smc_netdev_ops; |
---|
1979 | 1965 | dev->ethtool_ops = &smc_ethtool_ops; |
---|
1980 | 1966 | |
---|
1981 | | - tasklet_init(&lp->tx_task, smc_hardware_send_pkt, (unsigned long)dev); |
---|
| 1967 | + tasklet_setup(&lp->tx_task, smc_hardware_send_pkt); |
---|
1982 | 1968 | INIT_WORK(&lp->phy_configure, smc_phy_configure); |
---|
1983 | 1969 | lp->dev = dev; |
---|
1984 | 1970 | lp->mii.phy_id_mask = 0x1f; |
---|
.. | .. |
---|
2447 | 2433 | |
---|
2448 | 2434 | static int smc_drv_suspend(struct device *dev) |
---|
2449 | 2435 | { |
---|
2450 | | - struct platform_device *pdev = to_platform_device(dev); |
---|
2451 | | - struct net_device *ndev = platform_get_drvdata(pdev); |
---|
| 2436 | + struct net_device *ndev = dev_get_drvdata(dev); |
---|
2452 | 2437 | |
---|
2453 | 2438 | if (ndev) { |
---|
2454 | 2439 | if (netif_running(ndev)) { |
---|