aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/ti
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 21:24:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-09 21:24:39 -0400
commit496322bc91e35007ed754184dcd447a02b6dd685 (patch)
treef5298d0a74c0a6e65c0e98050b594b8d020904c1 /drivers/net/ethernet/ti
parent2e17c5a97e231f3cb426f4b7895eab5be5c5442e (diff)
parent56e0ef527b184b3de2d7f88c6190812b2b2ac6bf (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "This is a re-do of the net-next pull request for the current merge window. The only difference from the one I made the other day is that this has Eliezer's interface renames and the timeout handling changes made based upon your feedback, as well as a few bug fixes that have trickeled in. Highlights: 1) Low latency device polling, eliminating the cost of interrupt handling and context switches. Allows direct polling of a network device from socket operations, such as recvmsg() and poll(). Currently ixgbe, mlx4, and bnx2x support this feature. Full high level description, performance numbers, and design in commit 0a4db187a999 ("Merge branch 'll_poll'") From Eliezer Tamir. 2) With the routing cache removed, ip_check_mc_rcu() gets exercised more than ever before in the case where we have lots of multicast addresses. Use a hash table instead of a simple linked list, from Eric Dumazet. 3) Add driver for Atheros CQA98xx 802.11ac wireless devices, from Bartosz Markowski, Janusz Dziedzic, Kalle Valo, Marek Kwaczynski, Marek Puzyniak, Michal Kazior, and Sujith Manoharan. 4) Support reporting the TUN device persist flag to userspace, from Pavel Emelyanov. 5) Allow controlling network device VF link state using netlink, from Rony Efraim. 6) Support GRE tunneling in openvswitch, from Pravin B Shelar. 7) Adjust SOCK_MIN_RCVBUF and SOCK_MIN_SNDBUF for modern times, from Daniel Borkmann and Eric Dumazet. 8) Allow controlling of TCP quickack behavior on a per-route basis, from Cong Wang. 9) Several bug fixes and improvements to vxlan from Stephen Hemminger, Pravin B Shelar, and Mike Rapoport. In particular, support receiving on multiple UDP ports. 10) Major cleanups, particular in the area of debugging and cookie lifetime handline, to the SCTP protocol code. From Daniel Borkmann. 11) Allow packets to cross network namespaces when traversing tunnel devices. From Nicolas Dichtel. 12) Allow monitoring netlink traffic via AF_PACKET sockets, in a manner akin to how we monitor real network traffic via ptype_all. From Daniel Borkmann. 13) Several bug fixes and improvements for the new alx device driver, from Johannes Berg. 14) Fix scalability issues in the netem packet scheduler's time queue, by using an rbtree. From Eric Dumazet. 15) Several bug fixes in TCP loss recovery handling, from Yuchung Cheng. 16) Add support for GSO segmentation of MPLS packets, from Simon Horman. 17) Make network notifiers have a real data type for the opaque pointer that's passed into them. Use this to properly handle network device flag changes in arp_netdev_event(). From Jiri Pirko and Timo Teräs. 18) Convert several drivers over to module_pci_driver(), from Peter Huewe. 19) tcp_fixup_rcvbuf() can loop 500 times over loopback, just use a O(1) calculation instead. From Eric Dumazet. 20) Support setting of explicit tunnel peer addresses in ipv6, just like ipv4. From Nicolas Dichtel. 21) Protect x86 BPF JIT against spraying attacks, from Eric Dumazet. 22) Prevent a single high rate flow from overruning an individual cpu during RX packet processing via selective flow shedding. From Willem de Bruijn. 23) Don't use spinlocks in TCP md5 signing fast paths, from Eric Dumazet. 24) Don't just drop GSO packets which are above the TBF scheduler's burst limit, chop them up so they are in-bounds instead. Also from Eric Dumazet. 25) VLAN offloads are missed when configured on top of a bridge, fix from Vlad Yasevich. 26) Support IPV6 in ping sockets. From Lorenzo Colitti. 27) Receive flow steering targets should be updated at poll() time too, from David Majnemer. 28) Fix several corner case regressions in PMTU/redirect handling due to the routing cache removal, from Timo Teräs. 29) We have to be mindful of ipv4 mapped ipv6 sockets in upd_v6_push_pending_frames(). From Hannes Frederic Sowa. 30) Fix L2TP sequence number handling bugs, from James Chapman." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1214 commits) drivers/net: caif: fix wrong rtnl_is_locked() usage drivers/net: enic: release rtnl_lock on error-path vhost-net: fix use-after-free in vhost_net_flush net: mv643xx_eth: do not use port number as platform device id net: sctp: confirm route during forward progress virtio_net: fix race in RX VQ processing virtio: support unlocked queue poll net/cadence/macb: fix bug/typo in extracting gem_irq_read_clear bit Documentation: Fix references to defunct linux-net@vger.kernel.org net/fs: change busy poll time accounting net: rename low latency sockets functions to busy poll bridge: fix some kernel warning in multicast timer sfc: Fix memory leak when discarding scattered packets sit: fix tunnel update via netlink dt:net:stmmac: Add dt specific phy reset callback support. dt:net:stmmac: Add support to dwmac version 3.610 and 3.710 dt:net:stmmac: Allocate platform data only if its NULL. net:stmmac: fix memleak in the open method ipv6: rt6_check_neigh should successfully verify neigh if no NUD information are available net: ipv6: fix wrong ping_v6_sendmsg return value ...
Diffstat (limited to 'drivers/net/ethernet/ti')
-rw-r--r--drivers/net/ethernet/ti/cpsw.c7
-rw-r--r--drivers/net/ethernet/ti/davinci_cpdma.c5
-rw-r--r--drivers/net/ethernet/ti/davinci_emac.c119
-rw-r--r--drivers/net/ethernet/ti/davinci_mdio.c5
-rw-r--r--drivers/net/ethernet/ti/tlan.c3
-rw-r--r--drivers/net/ethernet/ti/tlan.h1
6 files changed, 46 insertions, 94 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index da4415d9dee6..05a1674e204f 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1555,6 +1555,8 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
1555 if (mac_addr) 1555 if (mac_addr)
1556 memcpy(slave_data->mac_addr, mac_addr, ETH_ALEN); 1556 memcpy(slave_data->mac_addr, mac_addr, ETH_ALEN);
1557 1557
1558 slave_data->phy_if = of_get_phy_mode(slave_node);
1559
1558 if (data->dual_emac) { 1560 if (data->dual_emac) {
1559 if (of_property_read_u32(slave_node, "dual_emac_res_vlan", 1561 if (of_property_read_u32(slave_node, "dual_emac_res_vlan",
1560 &prop)) { 1562 &prop)) {
@@ -1702,10 +1704,10 @@ static int cpsw_probe(struct platform_device *pdev)
1702 1704
1703 if (is_valid_ether_addr(data->slave_data[0].mac_addr)) { 1705 if (is_valid_ether_addr(data->slave_data[0].mac_addr)) {
1704 memcpy(priv->mac_addr, data->slave_data[0].mac_addr, ETH_ALEN); 1706 memcpy(priv->mac_addr, data->slave_data[0].mac_addr, ETH_ALEN);
1705 pr_info("Detected MACID = %pM", priv->mac_addr); 1707 pr_info("Detected MACID = %pM\n", priv->mac_addr);
1706 } else { 1708 } else {
1707 eth_random_addr(priv->mac_addr); 1709 eth_random_addr(priv->mac_addr);
1708 pr_info("Random MACID = %pM", priv->mac_addr); 1710 pr_info("Random MACID = %pM\n", priv->mac_addr);
1709 } 1711 }
1710 1712
1711 memcpy(ndev->dev_addr, priv->mac_addr, ETH_ALEN); 1713 memcpy(ndev->dev_addr, priv->mac_addr, ETH_ALEN);
@@ -1944,7 +1946,6 @@ static int cpsw_remove(struct platform_device *pdev)
1944 struct cpsw_priv *priv = netdev_priv(ndev); 1946 struct cpsw_priv *priv = netdev_priv(ndev);
1945 int i; 1947 int i;
1946 1948
1947 platform_set_drvdata(pdev, NULL);
1948 if (priv->data.dual_emac) 1949 if (priv->data.dual_emac)
1949 unregister_netdev(cpsw_get_slave_ndev(priv, 1)); 1950 unregister_netdev(cpsw_get_slave_ndev(priv, 1));
1950 unregister_netdev(ndev); 1951 unregister_netdev(ndev);
diff --git a/drivers/net/ethernet/ti/davinci_cpdma.c b/drivers/net/ethernet/ti/davinci_cpdma.c
index 053c84fd0853..031ebc81b50c 100644
--- a/drivers/net/ethernet/ti/davinci_cpdma.c
+++ b/drivers/net/ethernet/ti/davinci_cpdma.c
@@ -64,6 +64,7 @@
64#define CPDMA_DESC_TO_PORT_EN BIT(20) 64#define CPDMA_DESC_TO_PORT_EN BIT(20)
65#define CPDMA_TO_PORT_SHIFT 16 65#define CPDMA_TO_PORT_SHIFT 16
66#define CPDMA_DESC_PORT_MASK (BIT(18) | BIT(17) | BIT(16)) 66#define CPDMA_DESC_PORT_MASK (BIT(18) | BIT(17) | BIT(16))
67#define CPDMA_DESC_CRC_LEN 4
67 68
68#define CPDMA_TEARDOWN_VALUE 0xfffffffc 69#define CPDMA_TEARDOWN_VALUE 0xfffffffc
69 70
@@ -805,6 +806,10 @@ static int __cpdma_chan_process(struct cpdma_chan *chan)
805 status = -EBUSY; 806 status = -EBUSY;
806 goto unlock_ret; 807 goto unlock_ret;
807 } 808 }
809
810 if (status & CPDMA_DESC_PASS_CRC)
811 outlen -= CPDMA_DESC_CRC_LEN;
812
808 status = status & (CPDMA_DESC_EOQ | CPDMA_DESC_TD_COMPLETE | 813 status = status & (CPDMA_DESC_EOQ | CPDMA_DESC_TD_COMPLETE |
809 CPDMA_DESC_PORT_MASK); 814 CPDMA_DESC_PORT_MASK);
810 815
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 860e15ddfbcb..07b176bcf929 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1532,7 +1532,7 @@ static int emac_dev_open(struct net_device *ndev)
1532 struct device *emac_dev = &ndev->dev; 1532 struct device *emac_dev = &ndev->dev;
1533 u32 cnt; 1533 u32 cnt;
1534 struct resource *res; 1534 struct resource *res;
1535 int q, m, ret; 1535 int ret;
1536 int i = 0; 1536 int i = 0;
1537 int k = 0; 1537 int k = 0;
1538 struct emac_priv *priv = netdev_priv(ndev); 1538 struct emac_priv *priv = netdev_priv(ndev);
@@ -1567,8 +1567,9 @@ static int emac_dev_open(struct net_device *ndev)
1567 1567
1568 while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, k))) { 1568 while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, k))) {
1569 for (i = res->start; i <= res->end; i++) { 1569 for (i = res->start; i <= res->end; i++) {
1570 if (request_irq(i, emac_irq, IRQF_DISABLED, 1570 if (devm_request_irq(&priv->pdev->dev, i, emac_irq,
1571 ndev->name, ndev)) 1571 IRQF_DISABLED,
1572 ndev->name, ndev))
1572 goto rollback; 1573 goto rollback;
1573 } 1574 }
1574 k++; 1575 k++;
@@ -1641,15 +1642,7 @@ static int emac_dev_open(struct net_device *ndev)
1641 1642
1642rollback: 1643rollback:
1643 1644
1644 dev_err(emac_dev, "DaVinci EMAC: request_irq() failed"); 1645 dev_err(emac_dev, "DaVinci EMAC: devm_request_irq() failed");
1645
1646 for (q = k; k >= 0; k--) {
1647 for (m = i; m >= res->start; m--)
1648 free_irq(m, ndev);
1649 res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, k-1);
1650 m = res->end;
1651 }
1652
1653 ret = -EBUSY; 1646 ret = -EBUSY;
1654err: 1647err:
1655 pm_runtime_put(&priv->pdev->dev); 1648 pm_runtime_put(&priv->pdev->dev);
@@ -1667,9 +1660,6 @@ err:
1667 */ 1660 */
1668static int emac_dev_stop(struct net_device *ndev) 1661static int emac_dev_stop(struct net_device *ndev)
1669{ 1662{
1670 struct resource *res;
1671 int i = 0;
1672 int irq_num;
1673 struct emac_priv *priv = netdev_priv(ndev); 1663 struct emac_priv *priv = netdev_priv(ndev);
1674 struct device *emac_dev = &ndev->dev; 1664 struct device *emac_dev = &ndev->dev;
1675 1665
@@ -1685,13 +1675,6 @@ static int emac_dev_stop(struct net_device *ndev)
1685 if (priv->phydev) 1675 if (priv->phydev)
1686 phy_disconnect(priv->phydev); 1676 phy_disconnect(priv->phydev);
1687 1677
1688 /* Free IRQ */
1689 while ((res = platform_get_resource(priv->pdev, IORESOURCE_IRQ, i))) {
1690 for (irq_num = res->start; irq_num <= res->end; irq_num++)
1691 free_irq(irq_num, priv->ndev);
1692 i++;
1693 }
1694
1695 if (netif_msg_drv(priv)) 1678 if (netif_msg_drv(priv))
1696 dev_notice(emac_dev, "DaVinci EMAC: %s stopped\n", ndev->name); 1679 dev_notice(emac_dev, "DaVinci EMAC: %s stopped\n", ndev->name);
1697 1680
@@ -1771,29 +1754,22 @@ static const struct net_device_ops emac_netdev_ops = {
1771#endif 1754#endif
1772}; 1755};
1773 1756
1774#ifdef CONFIG_OF 1757static struct emac_platform_data *
1775static struct emac_platform_data 1758davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)
1776 *davinci_emac_of_get_pdata(struct platform_device *pdev,
1777 struct emac_priv *priv)
1778{ 1759{
1779 struct device_node *np; 1760 struct device_node *np;
1780 struct emac_platform_data *pdata = NULL; 1761 struct emac_platform_data *pdata = NULL;
1781 const u8 *mac_addr; 1762 const u8 *mac_addr;
1782 u32 data;
1783 int ret;
1784 1763
1785 pdata = pdev->dev.platform_data; 1764 if (!IS_ENABLED(CONFIG_OF) || !pdev->dev.of_node)
1786 if (!pdata) { 1765 return pdev->dev.platform_data;
1787 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 1766
1788 if (!pdata) 1767 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
1789 goto nodata; 1768 if (!pdata)
1790 } 1769 return NULL;
1791 1770
1792 np = pdev->dev.of_node; 1771 np = pdev->dev.of_node;
1793 if (!np) 1772 pdata->version = EMAC_VERSION_2;
1794 goto nodata;
1795 else
1796 pdata->version = EMAC_VERSION_2;
1797 1773
1798 if (!is_valid_ether_addr(pdata->mac_addr)) { 1774 if (!is_valid_ether_addr(pdata->mac_addr)) {
1799 mac_addr = of_get_mac_address(np); 1775 mac_addr = of_get_mac_address(np);
@@ -1801,47 +1777,31 @@ static struct emac_platform_data
1801 memcpy(pdata->mac_addr, mac_addr, ETH_ALEN); 1777 memcpy(pdata->mac_addr, mac_addr, ETH_ALEN);
1802 } 1778 }
1803 1779
1804 ret = of_property_read_u32(np, "ti,davinci-ctrl-reg-offset", &data); 1780 of_property_read_u32(np, "ti,davinci-ctrl-reg-offset",
1805 if (!ret) 1781 &pdata->ctrl_reg_offset);
1806 pdata->ctrl_reg_offset = data;
1807 1782
1808 ret = of_property_read_u32(np, "ti,davinci-ctrl-mod-reg-offset", 1783 of_property_read_u32(np, "ti,davinci-ctrl-mod-reg-offset",
1809 &data); 1784 &pdata->ctrl_mod_reg_offset);
1810 if (!ret)
1811 pdata->ctrl_mod_reg_offset = data;
1812 1785
1813 ret = of_property_read_u32(np, "ti,davinci-ctrl-ram-offset", &data); 1786 of_property_read_u32(np, "ti,davinci-ctrl-ram-offset",
1814 if (!ret) 1787 &pdata->ctrl_ram_offset);
1815 pdata->ctrl_ram_offset = data;
1816 1788
1817 ret = of_property_read_u32(np, "ti,davinci-ctrl-ram-size", &data); 1789 of_property_read_u32(np, "ti,davinci-ctrl-ram-size",
1818 if (!ret) 1790 &pdata->ctrl_ram_size);
1819 pdata->ctrl_ram_size = data;
1820 1791
1821 ret = of_property_read_u32(np, "ti,davinci-rmii-en", &data); 1792 of_property_read_u8(np, "ti,davinci-rmii-en", &pdata->rmii_en);
1822 if (!ret)
1823 pdata->rmii_en = data;
1824 1793
1825 ret = of_property_read_u32(np, "ti,davinci-no-bd-ram", &data); 1794 pdata->no_bd_ram = of_property_read_bool(np, "ti,davinci-no-bd-ram");
1826 if (!ret)
1827 pdata->no_bd_ram = data;
1828 1795
1829 priv->phy_node = of_parse_phandle(np, "phy-handle", 0); 1796 priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
1830 if (!priv->phy_node) 1797 if (!priv->phy_node)
1831 pdata->phy_id = ""; 1798 pdata->phy_id = "";
1832 1799
1833 pdev->dev.platform_data = pdata; 1800 pdev->dev.platform_data = pdata;
1834nodata: 1801
1835 return pdata; 1802 return pdata;
1836} 1803}
1837#else 1804
1838static struct emac_platform_data
1839 *davinci_emac_of_get_pdata(struct platform_device *pdev,
1840 struct emac_priv *priv)
1841{
1842 return pdev->dev.platform_data;
1843}
1844#endif
1845/** 1805/**
1846 * davinci_emac_probe - EMAC device probe 1806 * davinci_emac_probe - EMAC device probe
1847 * @pdev: The DaVinci EMAC device that we are removing 1807 * @pdev: The DaVinci EMAC device that we are removing
@@ -1856,7 +1816,7 @@ static int davinci_emac_probe(struct platform_device *pdev)
1856 struct resource *res; 1816 struct resource *res;
1857 struct net_device *ndev; 1817 struct net_device *ndev;
1858 struct emac_priv *priv; 1818 struct emac_priv *priv;
1859 unsigned long size, hw_ram_addr; 1819 unsigned long hw_ram_addr;
1860 struct emac_platform_data *pdata; 1820 struct emac_platform_data *pdata;
1861 struct device *emac_dev; 1821 struct device *emac_dev;
1862 struct cpdma_params dma_params; 1822 struct cpdma_params dma_params;
@@ -1907,25 +1867,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
1907 emac_dev = &ndev->dev; 1867 emac_dev = &ndev->dev;
1908 /* Get EMAC platform data */ 1868 /* Get EMAC platform data */
1909 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1869 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1910 if (!res) {
1911 dev_err(&pdev->dev,"error getting res\n");
1912 rc = -ENOENT;
1913 goto no_pdata;
1914 }
1915
1916 priv->emac_base_phys = res->start + pdata->ctrl_reg_offset; 1870 priv->emac_base_phys = res->start + pdata->ctrl_reg_offset;
1917 size = resource_size(res); 1871 priv->remap_addr = devm_ioremap_resource(&pdev->dev, res);
1918 if (!devm_request_mem_region(&pdev->dev, res->start, 1872 if (IS_ERR(priv->remap_addr)) {
1919 size, ndev->name)) { 1873 rc = PTR_ERR(priv->remap_addr);
1920 dev_err(&pdev->dev, "failed request_mem_region() for regs\n");
1921 rc = -ENXIO;
1922 goto no_pdata;
1923 }
1924
1925 priv->remap_addr = devm_ioremap(&pdev->dev, res->start, size);
1926 if (!priv->remap_addr) {
1927 dev_err(&pdev->dev, "unable to map IO\n");
1928 rc = -ENOMEM;
1929 goto no_pdata; 1874 goto no_pdata;
1930 } 1875 }
1931 priv->emac_base = priv->remap_addr + pdata->ctrl_reg_offset; 1876 priv->emac_base = priv->remap_addr + pdata->ctrl_reg_offset;
@@ -2037,8 +1982,6 @@ static int davinci_emac_remove(struct platform_device *pdev)
2037 1982
2038 dev_notice(&ndev->dev, "DaVinci EMAC: davinci_emac_remove()\n"); 1983 dev_notice(&ndev->dev, "DaVinci EMAC: davinci_emac_remove()\n");
2039 1984
2040 platform_set_drvdata(pdev, NULL);
2041
2042 if (priv->txchan) 1985 if (priv->txchan)
2043 cpdma_chan_destroy(priv->txchan); 1986 cpdma_chan_destroy(priv->txchan);
2044 if (priv->rxchan) 1987 if (priv->rxchan)
@@ -2078,11 +2021,13 @@ static const struct dev_pm_ops davinci_emac_pm_ops = {
2078 .resume = davinci_emac_resume, 2021 .resume = davinci_emac_resume,
2079}; 2022};
2080 2023
2024#if IS_ENABLED(CONFIG_OF)
2081static const struct of_device_id davinci_emac_of_match[] = { 2025static const struct of_device_id davinci_emac_of_match[] = {
2082 {.compatible = "ti,davinci-dm6467-emac", }, 2026 {.compatible = "ti,davinci-dm6467-emac", },
2083 {}, 2027 {},
2084}; 2028};
2085MODULE_DEVICE_TABLE(of, davinci_emac_of_match); 2029MODULE_DEVICE_TABLE(of, davinci_emac_of_match);
2030#endif
2086 2031
2087/* davinci_emac_driver: EMAC platform driver structure */ 2032/* davinci_emac_driver: EMAC platform driver structure */
2088static struct platform_driver davinci_emac_driver = { 2033static struct platform_driver davinci_emac_driver = {
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index ce7c4991e41c..16ddfc348062 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -292,6 +292,7 @@ static int davinci_mdio_write(struct mii_bus *bus, int phy_id,
292 return 0; 292 return 0;
293} 293}
294 294
295#if IS_ENABLED(CONFIG_OF)
295static int davinci_mdio_probe_dt(struct mdio_platform_data *data, 296static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
296 struct platform_device *pdev) 297 struct platform_device *pdev)
297{ 298{
@@ -309,7 +310,7 @@ static int davinci_mdio_probe_dt(struct mdio_platform_data *data,
309 310
310 return 0; 311 return 0;
311} 312}
312 313#endif
313 314
314static int davinci_mdio_probe(struct platform_device *pdev) 315static int davinci_mdio_probe(struct platform_device *pdev)
315{ 316{
@@ -487,11 +488,13 @@ static const struct dev_pm_ops davinci_mdio_pm_ops = {
487 .resume_early = davinci_mdio_resume, 488 .resume_early = davinci_mdio_resume,
488}; 489};
489 490
491#if IS_ENABLED(CONFIG_OF)
490static const struct of_device_id davinci_mdio_of_mtable[] = { 492static const struct of_device_id davinci_mdio_of_mtable[] = {
491 { .compatible = "ti,davinci_mdio", }, 493 { .compatible = "ti,davinci_mdio", },
492 { /* sentinel */ }, 494 { /* sentinel */ },
493}; 495};
494MODULE_DEVICE_TABLE(of, davinci_mdio_of_mtable); 496MODULE_DEVICE_TABLE(of, davinci_mdio_of_mtable);
497#endif
495 498
496static struct platform_driver davinci_mdio_driver = { 499static struct platform_driver davinci_mdio_driver = {
497 .driver = { 500 .driver = {
diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c
index 60c400f6d01f..591437e59b90 100644
--- a/drivers/net/ethernet/ti/tlan.c
+++ b/drivers/net/ethernet/ti/tlan.c
@@ -372,7 +372,7 @@ static int tlan_resume(struct pci_dev *pdev)
372 372
373 pci_set_power_state(pdev, PCI_D0); 373 pci_set_power_state(pdev, PCI_D0);
374 pci_restore_state(pdev); 374 pci_restore_state(pdev);
375 pci_enable_wake(pdev, 0, 0); 375 pci_enable_wake(pdev, PCI_D0, 0);
376 netif_device_attach(dev); 376 netif_device_attach(dev);
377 377
378 if (netif_running(dev)) 378 if (netif_running(dev))
@@ -533,7 +533,6 @@ static int tlan_probe1(struct pci_dev *pdev, long ioaddr, int irq, int rev,
533 /* This is a hack. We need to know which board structure 533 /* This is a hack. We need to know which board structure
534 * is suited for this adapter */ 534 * is suited for this adapter */
535 device_id = inw(ioaddr + EISA_ID2); 535 device_id = inw(ioaddr + EISA_ID2);
536 priv->is_eisa = 1;
537 if (device_id == 0x20F1) { 536 if (device_id == 0x20F1) {
538 priv->adapter = &board_info[13]; /* NetFlex-3/E */ 537 priv->adapter = &board_info[13]; /* NetFlex-3/E */
539 priv->adapter_rev = 23; /* TLAN 2.3 */ 538 priv->adapter_rev = 23; /* TLAN 2.3 */
diff --git a/drivers/net/ethernet/ti/tlan.h b/drivers/net/ethernet/ti/tlan.h
index 5fc98a8e4889..2eb33a250788 100644
--- a/drivers/net/ethernet/ti/tlan.h
+++ b/drivers/net/ethernet/ti/tlan.h
@@ -207,7 +207,6 @@ struct tlan_priv {
207 u8 tlan_full_duplex; 207 u8 tlan_full_duplex;
208 spinlock_t lock; 208 spinlock_t lock;
209 u8 link; 209 u8 link;
210 u8 is_eisa;
211 struct work_struct tlan_tqueue; 210 struct work_struct tlan_tqueue;
212 u8 neg_be_verbose; 211 u8 neg_be_verbose;
213}; 212};