net: ndo_set_config/ifmap cleanups
Subsystems (5)
cover net: ndo_set_config/ifmap cleanups
Hi David,
This patch series removes a bunch of useless ndo_set_config in non PCMCIA Ethernet drivers.
Florian Fainelli (4):
net: ethoc: remove ethoc_config
net: cpmac: remove cpmac_config
net: sxgbe: remove sxgbe_config
stmmac: remove stmmac_config
drivers/net/ethernet/ethoc.c | 6 ---- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 35 ----------------------- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 22 -------------- drivers/net/ethernet/ti/cpmac.c | 14 --------- 4 files changed, 77 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/4 net: ethoc: remove ethoc_config
ethoc_config() returns -ENOSYS and does not implement anything useful, let's remove it such that net/core/dev_ioctl.c::dev_ifsioc can return something meaningful like -EOPNOTSUPP.
--- drivers/net/ethernet/ethoc.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/net/ethernet/ethoc.c +0 -6
@@ -769,11 +769,6 @@ static int ethoc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)return phy_mii_ioctl (phy, ifr, cmd); } -static int ethoc_config (struct net_device *dev,struct ifmap *map) -{ -return -ENOSYS ; -} -static void ethoc_do_set_mac_address (struct net_device *dev) {struct ethoc *priv =netdev_priv (dev);
@@ -995,7 +990,6 @@ static const struct net_device_ops ethoc_netdev_ops = { .ndo_open = ethoc_open, .ndo_stop = ethoc_stop, .ndo_do_ioctl = ethoc_ioctl, - .ndo_set_config = ethoc_config, .ndo_set_mac_address = ethoc_set_mac_address, .ndo_set_rx_mode = ethoc_set_multicast_list, .ndo_change_mtu = ethoc_change_mtu,
Signature · 1 line
1.9.1
Re: [PATCH net-next 1/4] net: ethoc: remove ethoc_config
Quoted 8 lines · Florian Fainelli
ethoc_config()returns-ENOSYSand does not implement anything useful, let's remove it such that net/core/dev_ioctl.c::dev_ifsioc can return something meaningful like-EOPNOTSUPP.Signed-off-by Florian Fainelli <[email protected]>--- drivers/net/ethernet/ethoc.c | 6 ------ 1 file changed, 6 deletions(-)
Signature · 2 lines
Thanks. -- Max
PATCH 2/4 net: cpmac: remove cpmac_config
In reply to Florian Fainellicpmac_config() refuses changing the base address parameter, and ignores all other parameters, which means that it is pretty useless as it is, so let's remove it.
--- drivers/net/ethernet/ti/cpmac.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/net/ethernet/ti/cpmac.c +0 -14
@@ -313,19 +313,6 @@ static int mii_irqs[PHY_MAX_ADDR] = { PHY_POLL, };static struct mii_bus *cpmac_mii; -static int cpmac_config (struct net_device *dev,struct ifmap *map) -{ -if (dev->flags &IFF_UP ) -return -EBUSY ; - -/* Don't allow changing the I/O address */ -if (map->base_addr != dev->base_addr) -return -EOPNOTSUPP ; - -/* ignore other fields */ -return 0 ; -} -static void cpmac_set_multicast_list (struct net_device *dev) {struct netdev_hw_addr *ha;
@@ -1100,7 +1087,6 @@ static const struct net_device_ops cpmac_netdev_ops = { .ndo_tx_timeout = cpmac_tx_timeout, .ndo_set_rx_mode = cpmac_set_multicast_list, .ndo_do_ioctl = cpmac_ioctl, - .ndo_set_config = cpmac_config, .ndo_change_mtu = eth_change_mtu, .ndo_validate_addr = eth_validate_addr, .ndo_set_mac_address = eth_mac_addr,
Signature · 1 line
1.9.1
PATCH 3/4 net: sxgbe: remove sxgbe_config
In reply to Florian Fainellisxgbe_config() denies changing the base address and interrupt, and ignores all other 'struct ifmap' members, which means that it is useless as is, so let's remove it.
--- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 35 ------------------------- 1 file changed, 35 deletions(-)
drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +0 -35
@@ -1909,40 +1909,6 @@ static void sxgbe_set_rx_mode(struct net_device *dev) readl(ioaddr + SXGBE_HASH_LOW)); } -/** -* sxgbe_config - entry point for changing configuration mode passed on by -* ifconfig -* @dev : pointer to the device structure -* @map : pointer to the device mapping structure -* Description: -* This function is a driver entry point which gets called by the kernel -* whenever some device configuration is changed. -* Return value: -* This function returns 0 if success and appropriate error otherwise. -*/ -static int sxgbe_config (struct net_device *dev,struct ifmap *map) -{ -struct sxgbe_priv_data *priv =netdev_priv (dev); - -/* Can't act on a running interface */ -if (dev->flags &IFF_UP ) -return -EBUSY ; - -/* Don't allow changing the I/O address */ -if (map->base_addr != (unsigned long )priv->ioaddr) { -netdev_warn (dev,"can't change I/O address\n" ); -return -EOPNOTSUPP ; - } - -/* Don't allow changing the IRQ */ -if (map->irq != priv->irq) { -netdev_warn (dev,"not change IRQ number %d\n" , priv->irq); -return -EOPNOTSUPP ; - } - -return 0 ; -} -#ifdef CONFIG_NET_POLL_CONTROLLER /** * sxgbe_poll_controller - entry point for polling receive by device
@@ -2004,7 +1970,6 @@ static const struct net_device_ops sxgbe_netdev_ops = { .ndo_set_rx_mode = sxgbe_set_rx_mode, .ndo_tx_timeout = sxgbe_tx_timeout, .ndo_do_ioctl = sxgbe_ioctl, - .ndo_set_config = sxgbe_config,#ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = sxgbe_poll_controller,#endif
Signature · 1 line
1.9.1
PATCH 4/4 stmmac: remove stmmac_config
In reply to Florian Fainellistmmac_config() denies changing the base address and interrupt parameters, and ignores any other settings from the ifmap parameters, thus making stmmac_config() useless, remove it.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 22 ---------------------- 1 file changed, 22 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +0 -22
@@ -2214,27 +2214,6 @@ static void stmmac_tx_timeout(struct net_device *dev)stmmac_tx_err (priv); } -/* Configuration changes (passed on by ifconfig) */ -static int stmmac_config (struct net_device *dev,struct ifmap *map) -{ -if (dev->flags &IFF_UP )/* can't act on a running interface */ -return -EBUSY ; - -/* Don't allow changing the I/O address */ -if (map->base_addr != dev->base_addr) { -pr_warn ("%s: can't change I/O address\n" , dev->name); -return -EOPNOTSUPP ; - } - -/* Don't allow changing the IRQ */ -if (map->irq != dev->irq) { -pr_warn ("%s: not change IRQ number %d\n" , dev->name, dev->irq); -return -EOPNOTSUPP ; - } - -return 0 ; -} -/** * stmmac_set_rx_mode - entry point for multicast addressing * @dev : pointer to the device structure
@@ -2600,7 +2579,6 @@ static const struct net_device_ops stmmac_netdev_ops = { .ndo_set_rx_mode = stmmac_set_rx_mode, .ndo_tx_timeout = stmmac_tx_timeout, .ndo_do_ioctl = stmmac_ioctl, - .ndo_set_config = stmmac_config,#ifdef CONFIG_NET_POLL_CONTROLLER .ndo_poll_controller = stmmac_poll_controller,#endif
Signature · 1 line
1.9.1
David Miller
maintainerFrom: Florian Fainelli <[email protected]>
Date: Mon, 21 Apr 2014 09:09:18 -0700
Quoted 2 lines
This patch series removes a bunch of useless
ndo_set_configin non PCMCIA Ethernet drivers.
Series applied, thanks Florian.