diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-05-01 08:47:44 -0700 | 
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-05-01 08:47:44 -0700 | 
| commit | bf61c8840efe60fd8f91446860b63338fb424158 (patch) | |
| tree | 7a71832407a4f0d6346db773343f4c3ae2257b19 /drivers/net/ethernet/smsc | |
| parent | 5846115b30f3a881e542c8bfde59a699c1c13740 (diff) | |
| parent | 0c6a61657da78098472fd0eb71cc01f2387fa1bb (diff) | |
| download | olio-linux-3.10-bf61c8840efe60fd8f91446860b63338fb424158.tar.xz olio-linux-3.10-bf61c8840efe60fd8f91446860b63338fb424158.zip  | |
Merge branch 'next' into for-linus
Prepare first set of updates for 3.10 merge window.
Diffstat (limited to 'drivers/net/ethernet/smsc')
| -rw-r--r-- | drivers/net/ethernet/smsc/epic100.c | 13 | ||||
| -rw-r--r-- | drivers/net/ethernet/smsc/smc911x.c | 29 | ||||
| -rw-r--r-- | drivers/net/ethernet/smsc/smc911x.h | 16 | ||||
| -rw-r--r-- | drivers/net/ethernet/smsc/smc91x.c | 33 | ||||
| -rw-r--r-- | drivers/net/ethernet/smsc/smc91x.h | 20 | ||||
| -rw-r--r-- | drivers/net/ethernet/smsc/smsc911x.c | 59 | ||||
| -rw-r--r-- | drivers/net/ethernet/smsc/smsc9420.c | 17 | 
7 files changed, 86 insertions, 101 deletions
diff --git a/drivers/net/ethernet/smsc/epic100.c b/drivers/net/ethernet/smsc/epic100.c index d01e59c348a..03b256af7ed 100644 --- a/drivers/net/ethernet/smsc/epic100.c +++ b/drivers/net/ethernet/smsc/epic100.c @@ -90,9 +90,9 @@ static int rx_copybreak;  #include <asm/byteorder.h>  /* These identify the driver base version and may not be removed. */ -static char version[] __devinitdata = +static char version[] =  DRV_NAME ".c:v1.11 1/7/2001 Written by Donald Becker <becker@scyld.com>\n"; -static char version2[] __devinitdata = +static char version2[] =  "  (unofficial 2.4.x kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n";  MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); @@ -318,8 +318,7 @@ static const struct net_device_ops epic_netdev_ops = {  	.ndo_validate_addr	= eth_validate_addr,  }; -static int __devinit epic_init_one(struct pci_dev *pdev, -				   const struct pci_device_id *ent) +static int epic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)  {  	static int card_idx = -1;  	void __iomem *ioaddr; @@ -569,7 +568,7 @@ static inline void epic_napi_irq_on(struct net_device *dev,  	ew32(INTMASK, ep->irq_mask | EpicNapiEvent);  } -static int __devinit read_eeprom(struct epic_private *ep, int location) +static int read_eeprom(struct epic_private *ep, int location)  {  	void __iomem *ioaddr = ep->ioaddr;  	int i; @@ -1524,7 +1523,7 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)  } -static void __devexit epic_remove_one(struct pci_dev *pdev) +static void epic_remove_one(struct pci_dev *pdev)  {  	struct net_device *dev = pci_get_drvdata(pdev);  	struct epic_private *ep = netdev_priv(dev); @@ -1577,7 +1576,7 @@ static struct pci_driver epic_driver = {  	.name		= DRV_NAME,  	.id_table	= epic_pci_tbl,  	.probe		= epic_init_one, -	.remove		= __devexit_p(epic_remove_one), +	.remove		= epic_remove_one,  #ifdef CONFIG_PM  	.suspend	= epic_suspend,  	.resume		= epic_resume, diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c index 8d15f7a74b4..9dd842dbb85 100644 --- a/drivers/net/ethernet/smsc/smc911x.c +++ b/drivers/net/ethernet/smsc/smc911x.c @@ -1400,16 +1400,6 @@ smc911x_open(struct net_device *dev)  	DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __func__); -	/* -	 * Check that the address is valid.  If its not, refuse -	 * to bring the device up.	 The user must specify an -	 * address using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx -	 */ -	if (!is_valid_ether_addr(dev->dev_addr)) { -		PRINTK("%s: no valid ethernet hw addr\n", __func__); -		return -EINVAL; -	} -  	/* reset the hardware */  	smc911x_reset(dev); @@ -1532,9 +1522,10 @@ smc911x_ethtool_setsettings(struct net_device *dev, struct ethtool_cmd *cmd)  static void  smc911x_ethtool_getdrvinfo(struct net_device *dev, struct ethtool_drvinfo *info)  { -	strncpy(info->driver, CARDNAME, sizeof(info->driver)); -	strncpy(info->version, version, sizeof(info->version)); -	strncpy(info->bus_info, dev_name(dev->dev.parent), sizeof(info->bus_info)); +	strlcpy(info->driver, CARDNAME, sizeof(info->driver)); +	strlcpy(info->version, version, sizeof(info->version)); +	strlcpy(info->bus_info, dev_name(dev->dev.parent), +		sizeof(info->bus_info));  }  static int smc911x_ethtool_nwayreset(struct net_device *dev) @@ -1722,7 +1713,7 @@ static const struct ethtool_ops smc911x_ethtool_ops = {   * This routine has a simple purpose -- make the SMC chip generate an   * interrupt, so an auto-detect routine can detect it, and find the IRQ,   */ -static int __devinit smc911x_findirq(struct net_device *dev) +static int smc911x_findirq(struct net_device *dev)  {  	struct smc911x_local *lp = netdev_priv(dev);  	int timeout = 20; @@ -1800,7 +1791,7 @@ static const struct net_device_ops smc911x_netdev_ops = {   * o  actually GRAB the irq.   * o  GRAB the region   */ -static int __devinit smc911x_probe(struct net_device *dev) +static int smc911x_probe(struct net_device *dev)  {  	struct smc911x_local *lp = netdev_priv(dev);  	int i, retval; @@ -2040,12 +2031,12 @@ err_out:   *	 0 --> there is a device   *	 anything else, error   */ -static int __devinit smc911x_drv_probe(struct platform_device *pdev) +static int smc911x_drv_probe(struct platform_device *pdev)  {  	struct net_device *ndev;  	struct resource *res;  	struct smc911x_local *lp; -	unsigned int *addr; +	void __iomem *addr;  	int ret;  	DBG(SMC_DEBUG_FUNC, "--> %s\n",  __func__); @@ -2115,7 +2106,7 @@ out:  	return ret;  } -static int __devexit smc911x_drv_remove(struct platform_device *pdev) +static int smc911x_drv_remove(struct platform_device *pdev)  {  	struct net_device *ndev = platform_get_drvdata(pdev);  	struct smc911x_local *lp = netdev_priv(ndev); @@ -2186,7 +2177,7 @@ static int smc911x_drv_resume(struct platform_device *dev)  static struct platform_driver smc911x_driver = {  	.probe		 = smc911x_drv_probe, -	.remove	 = __devexit_p(smc911x_drv_remove), +	.remove	 = smc911x_drv_remove,  	.suspend	 = smc911x_drv_suspend,  	.resume	 = smc911x_drv_resume,  	.driver	 = { diff --git a/drivers/net/ethernet/smsc/smc911x.h b/drivers/net/ethernet/smsc/smc911x.h index 3269292efec..d51261ba464 100644 --- a/drivers/net/ethernet/smsc/smc911x.h +++ b/drivers/net/ethernet/smsc/smc911x.h @@ -159,12 +159,12 @@ static inline void SMC_insl(struct smc911x_local *lp, int reg,  	void __iomem *ioaddr = lp->base + reg;  	if (lp->cfg.flags & SMC911X_USE_32BIT) { -		readsl(ioaddr, addr, count); +		ioread32_rep(ioaddr, addr, count);  		return;  	}  	if (lp->cfg.flags & SMC911X_USE_16BIT) { -		readsw(ioaddr, addr, count * 2); +		ioread16_rep(ioaddr, addr, count * 2);  		return;  	} @@ -177,12 +177,12 @@ static inline void SMC_outsl(struct smc911x_local *lp, int reg,  	void __iomem *ioaddr = lp->base + reg;  	if (lp->cfg.flags & SMC911X_USE_32BIT) { -		writesl(ioaddr, addr, count); +		iowrite32_rep(ioaddr, addr, count);  		return;  	}  	if (lp->cfg.flags & SMC911X_USE_16BIT) { -		writesw(ioaddr, addr, count * 2); +		iowrite16_rep(ioaddr, addr, count * 2);  		return;  	} @@ -196,14 +196,14 @@ static inline void SMC_outsl(struct smc911x_local *lp, int reg,  		 writew(v & 0xFFFF, (lp)->base + (r));	 \  		 writew(v >> 16, (lp)->base + (r) + 2); \  	 } while (0) -#define SMC_insl(lp, r, p, l)	 readsw((short*)((lp)->base + (r)), p, l*2) -#define SMC_outsl(lp, r, p, l)	 writesw((short*)((lp)->base + (r)), p, l*2) +#define SMC_insl(lp, r, p, l)	 ioread16_rep((short*)((lp)->base + (r)), p, l*2) +#define SMC_outsl(lp, r, p, l)	 iowrite16_rep((short*)((lp)->base + (r)), p, l*2)  #elif	SMC_USE_32BIT  #define SMC_inl(lp, r)		 readl((lp)->base + (r))  #define SMC_outl(v, lp, r)	 writel(v, (lp)->base + (r)) -#define SMC_insl(lp, r, p, l)	 readsl((int*)((lp)->base + (r)), p, l) -#define SMC_outsl(lp, r, p, l)	 writesl((int*)((lp)->base + (r)), p, l) +#define SMC_insl(lp, r, p, l)	 ioread32_rep((int*)((lp)->base + (r)), p, l) +#define SMC_outsl(lp, r, p, l)	 iowrite32_rep((int*)((lp)->base + (r)), p, l)  #endif /* SMC_USE_16BIT */  #endif /* SMC_DYNAMIC_BUS_CONFIG */ diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c index 318adc935a5..591650a8de3 100644 --- a/drivers/net/ethernet/smsc/smc91x.c +++ b/drivers/net/ethernet/smsc/smc91x.c @@ -1474,16 +1474,6 @@ smc_open(struct net_device *dev)  	DBG(2, "%s: %s\n", dev->name, __func__); -	/* -	 * Check that the address is valid.  If its not, refuse -	 * to bring the device up.  The user must specify an -	 * address using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx -	 */ -	if (!is_valid_ether_addr(dev->dev_addr)) { -		PRINTK("%s: no valid ethernet hw addr\n", __func__); -		return -EINVAL; -	} -  	/* Setup the default Register Modes */  	lp->tcr_cur_mode = TCR_DEFAULT;  	lp->rcr_cur_mode = RCR_DEFAULT; @@ -1607,9 +1597,10 @@ smc_ethtool_setsettings(struct net_device *dev, struct ethtool_cmd *cmd)  static void  smc_ethtool_getdrvinfo(struct net_device *dev, struct ethtool_drvinfo *info)  { -	strncpy(info->driver, CARDNAME, sizeof(info->driver)); -	strncpy(info->version, version, sizeof(info->version)); -	strncpy(info->bus_info, dev_name(dev->dev.parent), sizeof(info->bus_info)); +	strlcpy(info->driver, CARDNAME, sizeof(info->driver)); +	strlcpy(info->version, version, sizeof(info->version)); +	strlcpy(info->bus_info, dev_name(dev->dev.parent), +		sizeof(info->bus_info));  }  static int smc_ethtool_nwayreset(struct net_device *dev) @@ -1789,7 +1780,7 @@ static const struct net_device_ops smc_netdev_ops = {   * I just deleted auto_irq.c, since it was never built...   *   --jgarzik   */ -static int __devinit smc_findirq(struct smc_local *lp) +static int smc_findirq(struct smc_local *lp)  {  	void __iomem *ioaddr = lp->base;  	int timeout = 20; @@ -1863,8 +1854,8 @@ static int __devinit smc_findirq(struct smc_local *lp)   * o  actually GRAB the irq.   * o  GRAB the region   */ -static int __devinit smc_probe(struct net_device *dev, void __iomem *ioaddr, -			    unsigned long irq_flags) +static int smc_probe(struct net_device *dev, void __iomem *ioaddr, +		     unsigned long irq_flags)  {  	struct smc_local *lp = netdev_priv(dev);  	static int version_printed = 0; @@ -2211,7 +2202,7 @@ static void smc_release_datacs(struct platform_device *pdev, struct net_device *   *	0 --> there is a device   *	anything else, error   */ -static int __devinit smc_drv_probe(struct platform_device *pdev) +static int smc_drv_probe(struct platform_device *pdev)  {  	struct smc91x_platdata *pd = pdev->dev.platform_data;  	struct smc_local *lp; @@ -2324,7 +2315,7 @@ static int __devinit smc_drv_probe(struct platform_device *pdev)  	return ret;  } -static int __devexit smc_drv_remove(struct platform_device *pdev) +static int smc_drv_remove(struct platform_device *pdev)  {  	struct net_device *ndev = platform_get_drvdata(pdev);  	struct smc_local *lp = netdev_priv(ndev); @@ -2396,8 +2387,6 @@ static const struct of_device_id smc91x_match[] = {  	{},  };  MODULE_DEVICE_TABLE(of, smc91x_match); -#else -#define smc91x_match NULL  #endif  static struct dev_pm_ops smc_drv_pm_ops = { @@ -2407,12 +2396,12 @@ static struct dev_pm_ops smc_drv_pm_ops = {  static struct platform_driver smc_driver = {  	.probe		= smc_drv_probe, -	.remove		= __devexit_p(smc_drv_remove), +	.remove		= smc_drv_remove,  	.driver		= {  		.name	= CARDNAME,  		.owner	= THIS_MODULE,  		.pm	= &smc_drv_pm_ops, -		.of_match_table = smc91x_match, +		.of_match_table = of_match_ptr(smc91x_match),  	},  }; diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h index 5f53fbbf67b..370e13dde11 100644 --- a/drivers/net/ethernet/smsc/smc91x.h +++ b/drivers/net/ethernet/smsc/smc91x.h @@ -286,16 +286,16 @@ static inline void mcf_outsw(void *a, unsigned char *p, int l)  #define SMC_IO_SHIFT		(lp->io_shift) -#define SMC_inb(a, r)		readb((a) + (r)) -#define SMC_inw(a, r)		readw((a) + (r)) -#define SMC_inl(a, r)		readl((a) + (r)) -#define SMC_outb(v, a, r)	writeb(v, (a) + (r)) -#define SMC_outw(v, a, r)	writew(v, (a) + (r)) -#define SMC_outl(v, a, r)	writel(v, (a) + (r)) -#define SMC_insw(a, r, p, l)	readsw((a) + (r), p, l) -#define SMC_outsw(a, r, p, l)	writesw((a) + (r), p, l) -#define SMC_insl(a, r, p, l)	readsl((a) + (r), p, l) -#define SMC_outsl(a, r, p, l)	writesl((a) + (r), p, l) +#define SMC_inb(a, r)		ioread8((a) + (r)) +#define SMC_inw(a, r)		ioread16((a) + (r)) +#define SMC_inl(a, r)		ioread32((a) + (r)) +#define SMC_outb(v, a, r)	iowrite8(v, (a) + (r)) +#define SMC_outw(v, a, r)	iowrite16(v, (a) + (r)) +#define SMC_outl(v, a, r)	iowrite32(v, (a) + (r)) +#define SMC_insw(a, r, p, l)	ioread16_rep((a) + (r), p, l) +#define SMC_outsw(a, r, p, l)	iowrite16_rep((a) + (r), p, l) +#define SMC_insl(a, r, p, l)	ioread32_rep((a) + (r), p, l) +#define SMC_outsl(a, r, p, l)	iowrite32_rep((a) + (r), p, l)  #define RPC_LSA_DEFAULT		RPC_LED_100_10  #define RPC_LSB_DEFAULT		RPC_LED_TX_RX diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c index 62d1baf111e..da5cc9a3b34 100644 --- a/drivers/net/ethernet/smsc/smsc911x.c +++ b/drivers/net/ethernet/smsc/smsc911x.c @@ -253,7 +253,7 @@ smsc911x_tx_writefifo(struct smsc911x_data *pdata, unsigned int *buf,  	}  	if (pdata->config.flags & SMSC911X_USE_32BIT) { -		writesl(pdata->ioaddr + TX_DATA_FIFO, buf, wordcount); +		iowrite32_rep(pdata->ioaddr + TX_DATA_FIFO, buf, wordcount);  		goto out;  	} @@ -285,7 +285,7 @@ smsc911x_tx_writefifo_shift(struct smsc911x_data *pdata, unsigned int *buf,  	}  	if (pdata->config.flags & SMSC911X_USE_32BIT) { -		writesl(pdata->ioaddr + __smsc_shift(pdata, +		iowrite32_rep(pdata->ioaddr + __smsc_shift(pdata,  						TX_DATA_FIFO), buf, wordcount);  		goto out;  	} @@ -319,7 +319,7 @@ smsc911x_rx_readfifo(struct smsc911x_data *pdata, unsigned int *buf,  	}  	if (pdata->config.flags & SMSC911X_USE_32BIT) { -		readsl(pdata->ioaddr + RX_DATA_FIFO, buf, wordcount); +		ioread32_rep(pdata->ioaddr + RX_DATA_FIFO, buf, wordcount);  		goto out;  	} @@ -351,7 +351,7 @@ smsc911x_rx_readfifo_shift(struct smsc911x_data *pdata, unsigned int *buf,  	}  	if (pdata->config.flags & SMSC911X_USE_32BIT) { -		readsl(pdata->ioaddr + __smsc_shift(pdata, +		ioread32_rep(pdata->ioaddr + __smsc_shift(pdata,  						RX_DATA_FIFO), buf, wordcount);  		goto out;  	} @@ -997,9 +997,8 @@ static int smsc911x_mii_probe(struct net_device *dev)  	SMSC_TRACE(pdata, probe, "PHY: addr %d, phy_id 0x%08X",  		   phydev->addr, phydev->phy_id); -	ret = phy_connect_direct(dev, phydev, -			&smsc911x_phy_adjust_link, 0, -			pdata->config.phy_interface); +	ret = phy_connect_direct(dev, phydev, &smsc911x_phy_adjust_link, +				 pdata->config.phy_interface);  	if (ret) {  		netdev_err(dev, "Could not attach to PHY\n"); @@ -1031,8 +1030,8 @@ static int smsc911x_mii_probe(struct net_device *dev)  	return 0;  } -static int __devinit smsc911x_mii_init(struct platform_device *pdev, -				       struct net_device *dev) +static int smsc911x_mii_init(struct platform_device *pdev, +			     struct net_device *dev)  {  	struct smsc911x_data *pdata = netdev_priv(dev);  	int err = -ENXIO, i; @@ -1463,11 +1462,6 @@ static int smsc911x_open(struct net_device *dev)  		return -EAGAIN;  	} -	if (!is_valid_ether_addr(dev->dev_addr)) { -		SMSC_WARN(pdata, hw, "dev_addr is not a valid MAC address"); -		return -EADDRNOTAVAIL; -	} -  	/* Reset the LAN911x */  	if (smsc911x_soft_reset(pdata)) {  		SMSC_WARN(pdata, hw, "soft reset failed"); @@ -1836,7 +1830,6 @@ static int smsc911x_set_mac_address(struct net_device *dev, void *p)  	if (!is_valid_ether_addr(addr->sa_data))  		return -EADDRNOTAVAIL; -	dev->addr_assign_type &= ~NET_ADDR_RANDOM;  	memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);  	spin_lock_irq(&pdata->mac_lock); @@ -2092,7 +2085,7 @@ static const struct net_device_ops smsc911x_netdev_ops = {  };  /* copies the current mac address from hardware to dev->dev_addr */ -static void __devinit smsc911x_read_mac_address(struct net_device *dev) +static void smsc911x_read_mac_address(struct net_device *dev)  {  	struct smsc911x_data *pdata = netdev_priv(dev);  	u32 mac_high16 = smsc911x_mac_read(pdata, ADDRH); @@ -2107,10 +2100,10 @@ static void __devinit smsc911x_read_mac_address(struct net_device *dev)  }  /* Initializing private device structures, only called from probe */ -static int __devinit smsc911x_init(struct net_device *dev) +static int smsc911x_init(struct net_device *dev)  {  	struct smsc911x_data *pdata = netdev_priv(dev); -	unsigned int byte_test; +	unsigned int byte_test, mask;  	unsigned int to = 100;  	SMSC_TRACE(pdata, probe, "Driver Parameters:"); @@ -2130,9 +2123,22 @@ static int __devinit smsc911x_init(struct net_device *dev)  	/*  	 * poll the READY bit in PMT_CTRL. Any other access to the device is  	 * forbidden while this bit isn't set. Try for 100ms +	 * +	 * Note that this test is done before the WORD_SWAP register is +	 * programmed. So in some configurations the READY bit is at 16 before +	 * WORD_SWAP is written to. This issue is worked around by waiting +	 * until either bit 0 or bit 16 gets set in PMT_CTRL. +	 * +	 * SMSC has confirmed that checking bit 16 (marked as reserved in +	 * the datasheet) is fine since these bits "will either never be set +	 * or can only go high after READY does (so also indicate the device +	 * is ready)".  	 */ -	while (!(smsc911x_reg_read(pdata, PMT_CTRL) & PMT_CTRL_READY_) && --to) + +	mask = PMT_CTRL_READY_ | swahw32(PMT_CTRL_READY_); +	while (!(smsc911x_reg_read(pdata, PMT_CTRL) & mask) && --to)  		udelay(1000); +  	if (to == 0) {  		pr_err("Device not READY in 100ms aborting\n");  		return -ENODEV; @@ -2231,7 +2237,7 @@ static int __devinit smsc911x_init(struct net_device *dev)  	return 0;  } -static int __devexit smsc911x_drv_remove(struct platform_device *pdev) +static int smsc911x_drv_remove(struct platform_device *pdev)  {  	struct net_device *dev;  	struct smsc911x_data *pdata; @@ -2288,9 +2294,8 @@ static const struct smsc911x_ops shifted_smsc911x_ops = {  };  #ifdef CONFIG_OF -static int __devinit smsc911x_probe_config_dt( -				struct smsc911x_platform_config *config, -				struct device_node *np) +static int smsc911x_probe_config_dt(struct smsc911x_platform_config *config, +				    struct device_node *np)  {  	const char *mac;  	u32 width = 0; @@ -2338,7 +2343,7 @@ static inline int smsc911x_probe_config_dt(  }  #endif /* CONFIG_OF */ -static int __devinit smsc911x_drv_probe(struct platform_device *pdev) +static int smsc911x_drv_probe(struct platform_device *pdev)  {  	struct device_node *np = pdev->dev.of_node;  	struct net_device *dev; @@ -2568,20 +2573,22 @@ static const struct dev_pm_ops smsc911x_pm_ops = {  #define SMSC911X_PM_OPS NULL  #endif +#ifdef CONFIG_OF  static const struct of_device_id smsc911x_dt_ids[] = {  	{ .compatible = "smsc,lan9115", },  	{ /* sentinel */ }  };  MODULE_DEVICE_TABLE(of, smsc911x_dt_ids); +#endif  static struct platform_driver smsc911x_driver = {  	.probe = smsc911x_drv_probe, -	.remove = __devexit_p(smsc911x_drv_remove), +	.remove = smsc911x_drv_remove,  	.driver = {  		.name	= SMSC_CHIPNAME,  		.owner	= THIS_MODULE,  		.pm	= SMSC911X_PM_OPS, -		.of_match_table = smsc911x_dt_ids, +		.of_match_table = of_match_ptr(smsc911x_dt_ids),  	},  }; diff --git a/drivers/net/ethernet/smsc/smsc9420.c b/drivers/net/ethernet/smsc/smsc9420.c index 1fcd914ec39..d457fa2d750 100644 --- a/drivers/net/ethernet/smsc/smsc9420.c +++ b/drivers/net/ethernet/smsc/smsc9420.c @@ -1179,7 +1179,7 @@ static int smsc9420_mii_probe(struct net_device *dev)  		phydev->phy_id);  	phydev = phy_connect(dev, dev_name(&phydev->dev), -		smsc9420_phy_adjust_link, 0, PHY_INTERFACE_MODE_MII); +			     smsc9420_phy_adjust_link, PHY_INTERFACE_MODE_MII);  	if (IS_ERR(phydev)) {  		pr_err("%s: Could not attach to PHY\n", dev->name); @@ -1250,12 +1250,11 @@ static int smsc9420_alloc_tx_ring(struct smsc9420_pdata *pd)  	BUG_ON(!pd->tx_ring); -	pd->tx_buffers = kmalloc((sizeof(struct smsc9420_ring_info) * -		TX_RING_SIZE), GFP_KERNEL); -	if (!pd->tx_buffers) { -		smsc_warn(IFUP, "Failed to allocated tx_buffers"); +	pd->tx_buffers = kmalloc_array(TX_RING_SIZE, +				       sizeof(struct smsc9420_ring_info), +				       GFP_KERNEL); +	if (!pd->tx_buffers)  		return -ENOMEM; -	}  	/* Initialize the TX Ring */  	for (i = 0; i < TX_RING_SIZE; i++) { @@ -1577,7 +1576,7 @@ static const struct net_device_ops smsc9420_netdev_ops = {  #endif /* CONFIG_NET_POLL_CONTROLLER */  }; -static int __devinit +static int  smsc9420_probe(struct pci_dev *pdev, const struct pci_device_id *id)  {  	struct net_device *dev; @@ -1702,7 +1701,7 @@ out_0:  	return -ENODEV;  } -static void __devexit smsc9420_remove(struct pci_dev *pdev) +static void smsc9420_remove(struct pci_dev *pdev)  {  	struct net_device *dev;  	struct smsc9420_pdata *pd; @@ -1736,7 +1735,7 @@ static struct pci_driver smsc9420_driver = {  	.name = DRV_NAME,  	.id_table = smsc9420_id_table,  	.probe = smsc9420_probe, -	.remove = __devexit_p(smsc9420_remove), +	.remove = smsc9420_remove,  #ifdef CONFIG_PM  	.suspend = smsc9420_suspend,  	.resume = smsc9420_resume,  |