Skip to content

Commit

Permalink
netdev: drivers should make ethtool_ops const
Browse files Browse the repository at this point in the history
No need to put ethtool_ops in data, they should be const.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Sep 2, 2009
1 parent daf09de commit 0fc0b73
Show file tree
Hide file tree
Showing 50 changed files with 54 additions and 54 deletions.
2 changes: 1 addition & 1 deletion arch/um/drivers/net_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ static void uml_net_get_drvinfo(struct net_device *dev,
strcpy(info->version, "42");
}

static struct ethtool_ops uml_net_ethtool_ops = {
static const struct ethtool_ops uml_net_ethtool_ops = {
.get_drvinfo = uml_net_get_drvinfo,
.get_link = ethtool_op_get_link,
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/firewire/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ static void fwnet_get_drvinfo(struct net_device *net,
strcpy(info->bus_info, "ieee1394");
}

static struct ethtool_ops fwnet_ethtool_ops = {
static const struct ethtool_ops fwnet_ethtool_ops = {
.get_drvinfo = fwnet_get_drvinfo,
};

Expand Down
4 changes: 2 additions & 2 deletions drivers/ieee1394/eth1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static netdev_tx_t ether1394_tx(struct sk_buff *skb,
struct net_device *dev);
static void ether1394_iso(struct hpsb_iso *iso);

static struct ethtool_ops ethtool_ops;
static const struct ethtool_ops ethtool_ops;

static int ether1394_write(struct hpsb_host *host, int srcid, int destid,
quadlet_t *data, u64 addr, size_t len, u16 flags);
Expand Down Expand Up @@ -1706,7 +1706,7 @@ static void ether1394_get_drvinfo(struct net_device *dev,
strcpy(info->bus_info, "ieee1394"); /* FIXME provide more detail? */
}

static struct ethtool_ops ethtool_ops = {
static const struct ethtool_ops ethtool_ops = {
.get_drvinfo = ether1394_get_drvinfo
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/nes/nes_nic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ static int nes_netdev_set_settings(struct net_device *netdev, struct ethtool_cmd
}


static struct ethtool_ops nes_ethtool_ops = {
static const struct ethtool_ops nes_ethtool_ops = {
.get_link = ethtool_op_get_link,
.get_settings = nes_netdev_get_settings,
.set_settings = nes_netdev_set_settings,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/arm/ep93xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ static u32 ep93xx_get_link(struct net_device *dev)
return mii_link_ok(&ep->mii);
}

static struct ethtool_ops ep93xx_ethtool_ops = {
static const struct ethtool_ops ep93xx_ethtool_ops = {
.get_drvinfo = ep93xx_get_drvinfo,
.get_settings = ep93xx_get_settings,
.set_settings = ep93xx_set_settings,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/arm/ixp4xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ static int ixp4xx_nway_reset(struct net_device *dev)
return phy_start_aneg(port->phydev);
}

static struct ethtool_ops ixp4xx_ethtool_ops = {
static const struct ethtool_ops ixp4xx_ethtool_ops = {
.get_drvinfo = ixp4xx_get_drvinfo,
.get_settings = ixp4xx_get_settings,
.set_settings = ixp4xx_set_settings,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/arm/ks8695net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ ks8695_get_drvinfo(struct net_device *ndev, struct ethtool_drvinfo *info)
sizeof(info->bus_info));
}

static struct ethtool_ops ks8695_ethtool_ops = {
static const struct ethtool_ops ks8695_ethtool_ops = {
.get_msglevel = ks8695_get_msglevel,
.set_msglevel = ks8695_set_msglevel,
.get_settings = ks8695_get_settings,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/atl1c/atl1c_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ static int atl1c_nway_reset(struct net_device *netdev)
return 0;
}

static struct ethtool_ops atl1c_ethtool_ops = {
static const struct ethtool_ops atl1c_ethtool_ops = {
.get_settings = atl1c_get_settings,
.set_settings = atl1c_set_settings,
.get_drvinfo = atl1c_get_drvinfo,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/atl1e/atl1e_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ static int atl1e_nway_reset(struct net_device *netdev)
return 0;
}

static struct ethtool_ops atl1e_ethtool_ops = {
static const struct ethtool_ops atl1e_ethtool_ops = {
.get_settings = atl1e_get_settings,
.set_settings = atl1e_set_settings,
.get_drvinfo = atl1e_get_drvinfo,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/atlx/atl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,7 @@ static int atl2_nway_reset(struct net_device *netdev)
return 0;
}

static struct ethtool_ops atl2_ethtool_ops = {
static const struct ethtool_ops atl2_ethtool_ops = {
.get_settings = atl2_get_settings,
.set_settings = atl2_set_settings,
.get_drvinfo = atl2_get_drvinfo,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/benet/be.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ struct be_adapter {
bool promiscuous;
};

extern struct ethtool_ops be_ethtool_ops;
extern const struct ethtool_ops be_ethtool_ops;

#define drvr_stats(adapter) (&adapter->stats.drvr_stats)

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/benet/be_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
return status;
}

struct ethtool_ops be_ethtool_ops = {
const struct ethtool_ops be_ethtool_ops = {
.get_settings = be_get_settings,
.get_drvinfo = be_get_drvinfo,
.get_link = ethtool_op_get_link,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/bfin_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ static void bfin_mac_ethtool_getdrvinfo(struct net_device *dev,
strcpy(info->bus_info, dev_name(&dev->dev));
}

static struct ethtool_ops bfin_mac_ethtool_ops = {
static const struct ethtool_ops bfin_mac_ethtool_ops = {
.get_settings = bfin_mac_ethtool_getsettings,
.set_settings = bfin_mac_ethtool_setsettings,
.get_link = ethtool_op_get_link,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -10606,7 +10606,7 @@ static int bnx2x_phys_id(struct net_device *dev, u32 data)
return 0;
}

static struct ethtool_ops bnx2x_ethtool_ops = {
static const struct ethtool_ops bnx2x_ethtool_ops = {
.get_settings = bnx2x_get_settings,
.set_settings = bnx2x_set_settings,
.get_drvinfo = bnx2x_get_drvinfo,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ static void enic_set_msglevel(struct net_device *netdev, u32 value)
enic->msg_enable = value;
}

static struct ethtool_ops enic_ethtool_ops = {
static const struct ethtool_ops enic_ethtool_ops = {
.get_settings = enic_get_settings,
.get_drvinfo = enic_get_drvinfo,
.get_msglevel = enic_get_msglevel,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/igb/igb_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,7 @@ static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
}
}

static struct ethtool_ops igb_ethtool_ops = {
static const struct ethtool_ops igb_ethtool_ops = {
.get_settings = igb_get_settings,
.set_settings = igb_set_settings,
.get_drvinfo = igb_get_drvinfo,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ipg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,7 @@ static int ipg_nway_reset(struct net_device *dev)
return rc;
}

static struct ethtool_ops ipg_ethtool_ops = {
static const struct ethtool_ops ipg_ethtool_ops = {
.get_settings = ipg_get_settings,
.set_settings = ipg_set_settings,
.nway_reset = ipg_nway_reset,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/korina.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ static u32 netdev_get_link(struct net_device *dev)
return mii_link_ok(&lp->mii_if);
}

static struct ethtool_ops netdev_ethtool_ops = {
static const struct ethtool_ops netdev_ethtool_ops = {
.get_drvinfo = netdev_get_drvinfo,
.get_settings = netdev_get_settings,
.set_settings = netdev_set_settings,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ks8842.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ static const struct net_device_ops ks8842_netdev_ops = {
.ndo_validate_addr = eth_validate_addr
};

static struct ethtool_ops ks8842_ethtool_ops = {
static const struct ethtool_ops ks8842_ethtool_ops = {
.get_link = ethtool_op_get_link,
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ static void macb_get_drvinfo(struct net_device *dev,
strcpy(info->bus_info, dev_name(&bp->pdev->dev));
}

static struct ethtool_ops macb_ethtool_ops = {
static const struct ethtool_ops macb_ethtool_ops = {
.get_settings = macb_get_settings,
.set_settings = macb_set_settings,
.get_drvinfo = macb_get_drvinfo,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/netxen/netxen_nic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1410,6 +1410,6 @@ extern void netxen_change_ringparam(struct netxen_adapter *adapter);
extern int netxen_rom_fast_read(struct netxen_adapter *adapter, int addr,
int *valp);

extern struct ethtool_ops netxen_nic_ethtool_ops;
extern const struct ethtool_ops netxen_nic_ethtool_ops;

#endif /* __NETXEN_NIC_H_ */
2 changes: 1 addition & 1 deletion drivers/net/netxen/netxen_nic_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ static int netxen_nic_set_flags(struct net_device *netdev, u32 data)
return 0;
}

struct ethtool_ops netxen_nic_ethtool_ops = {
const struct ethtool_ops netxen_nic_ethtool_ops = {
.get_settings = netxen_nic_get_settings,
.set_settings = netxen_nic_set_settings,
.get_drvinfo = netxen_nic_get_drvinfo,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ps3_gelic_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ static int gelic_net_set_wol(struct net_device *netdev,
return status;
}

static struct ethtool_ops gelic_ether_ethtool_ops = {
static const struct ethtool_ops gelic_ether_ethtool_ops = {
.get_drvinfo = gelic_net_get_drvinfo,
.get_settings = gelic_ether_get_settings,
.get_link = ethtool_op_get_link,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ps3_gelic_wireless.c
Original file line number Diff line number Diff line change
Expand Up @@ -2714,7 +2714,7 @@ static const struct net_device_ops gelic_wl_netdevice_ops = {
#endif
};

static struct ethtool_ops gelic_wl_ethtool_ops = {
static const struct ethtool_ops gelic_wl_ethtool_ops = {
.get_drvinfo = gelic_net_get_drvinfo,
.get_link = gelic_wl_get_link,
.get_tx_csum = ethtool_op_get_tx_csum,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/sfc/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ static void efx_ethtool_get_pauseparam(struct net_device *net_dev,
}


struct ethtool_ops efx_ethtool_ops = {
const struct ethtool_ops efx_ethtool_ops = {
.get_settings = efx_ethtool_get_settings,
.set_settings = efx_ethtool_set_settings,
.get_drvinfo = efx_ethtool_get_drvinfo,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/sfc/ethtool.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ extern int efx_ethtool_get_settings(struct net_device *net_dev,
extern int efx_ethtool_set_settings(struct net_device *net_dev,
struct ethtool_cmd *ecmd);

extern struct ethtool_ops efx_ethtool_ops;
extern const struct ethtool_ops efx_ethtool_ops;

#endif /* EFX_ETHTOOL_H */
2 changes: 1 addition & 1 deletion drivers/net/tehuti.c
Original file line number Diff line number Diff line change
Expand Up @@ -2428,7 +2428,7 @@ static void bdx_get_ethtool_stats(struct net_device *netdev,
*/
static void bdx_ethtool_ops(struct net_device *netdev)
{
static struct ethtool_ops bdx_ethtool_ops = {
static const struct ethtool_ops bdx_ethtool_ops = {
.get_settings = bdx_get_settings,
.get_drvinfo = bdx_get_drvinfo,
.get_link = ethtool_op_get_link,
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/usb/asix.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ static int asix_ioctl (struct net_device *net, struct ifreq *rq, int cmd)
/* We need to override some ethtool_ops so we require our
own structure so we don't interfere with other usbnet
devices that may be connected at the same time. */
static struct ethtool_ops ax88172_ethtool_ops = {
static const struct ethtool_ops ax88172_ethtool_ops = {
.get_drvinfo = asix_get_drvinfo,
.get_link = asix_get_link,
.get_msglevel = usbnet_get_msglevel,
Expand Down Expand Up @@ -873,7 +873,7 @@ static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
return ret;
}

static struct ethtool_ops ax88772_ethtool_ops = {
static const struct ethtool_ops ax88772_ethtool_ops = {
.get_drvinfo = asix_get_drvinfo,
.get_link = asix_get_link,
.get_msglevel = usbnet_get_msglevel,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/catc.c
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ static int catc_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
return 0;
}

static struct ethtool_ops ops = {
static const struct ethtool_ops ops = {
.get_drvinfo = catc_get_drvinfo,
.get_settings = catc_get_settings,
.get_link = ethtool_op_get_link
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/dm9601.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static int dm9601_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
}

static struct ethtool_ops dm9601_ethtool_ops = {
static const struct ethtool_ops dm9601_ethtool_ops = {
.get_drvinfo = dm9601_get_drvinfo,
.get_link = dm9601_get_link,
.get_msglevel = usbnet_get_msglevel,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/hso.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ static void hso_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info
usb_make_path(odev->parent->usb, info->bus_info, sizeof info->bus_info);
}

static struct ethtool_ops ops = {
static const struct ethtool_ops ops = {
.get_drvinfo = hso_get_drvinfo,
.get_link = ethtool_op_get_link
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/kaweth.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ static u32 kaweth_get_link(struct net_device *dev)
return kaweth->linkstate;
}

static struct ethtool_ops ops = {
static const struct ethtool_ops ops = {
.get_drvinfo = kaweth_get_drvinfo,
.get_link = kaweth_get_link
};
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/mcs7830.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ static void mcs7830_get_regs(struct net_device *net, struct ethtool_regs *regs,
mcs7830_get_reg(dev, 0, regs->len, data);
}

static struct ethtool_ops mcs7830_ethtool_ops = {
static const struct ethtool_ops mcs7830_ethtool_ops = {
.get_drvinfo = mcs7830_get_drvinfo,
.get_regs_len = mcs7830_get_regs_len,
.get_regs = mcs7830_get_regs,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/pegasus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ static void pegasus_set_msglevel(struct net_device *dev, u32 v)
pegasus->msg_enable = v;
}

static struct ethtool_ops ops = {
static const struct ethtool_ops ops = {
.get_drvinfo = pegasus_get_drvinfo,
.get_settings = pegasus_get_settings,
.set_settings = pegasus_set_settings,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/rtl8150.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ static int rtl8150_get_settings(struct net_device *netdev, struct ethtool_cmd *e
return 0;
}

static struct ethtool_ops ops = {
static const struct ethtool_ops ops = {
.get_drvinfo = rtl8150_get_drvinfo,
.get_settings = rtl8150_get_settings,
.get_link = ethtool_op_get_link
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/smsc95xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ static int smsc95xx_ethtool_set_tx_csum(struct net_device *netdev, u32 val)
return smsc95xx_set_csums(dev);
}

static struct ethtool_ops smsc95xx_ethtool_ops = {
static const struct ethtool_ops smsc95xx_ethtool_ops = {
.get_link = usbnet_get_link,
.nway_reset = usbnet_nway_reset,
.get_drvinfo = usbnet_get_drvinfo,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/usbnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ void usbnet_set_msglevel (struct net_device *net, u32 level)
EXPORT_SYMBOL_GPL(usbnet_set_msglevel);

/* drivers may override default ethtool_ops in their bind() routine */
static struct ethtool_ops usbnet_ethtool_ops = {
static const struct ethtool_ops usbnet_ethtool_ops = {
.get_settings = usbnet_get_settings,
.set_settings = usbnet_set_settings,
.get_link = usbnet_get_link,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/veth.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static int veth_set_tx_csum(struct net_device *dev, u32 data)
return 0;
}

static struct ethtool_ops veth_ethtool_ops = {
static const struct ethtool_ops veth_ethtool_ops = {
.get_settings = veth_get_settings,
.get_drvinfo = veth_get_drvinfo,
.get_link = ethtool_op_get_link,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ static void virtnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid)
dev_warn(&dev->dev, "Failed to kill VLAN ID %d.\n", vid);
}

static struct ethtool_ops virtnet_ethtool_ops = {
static const struct ethtool_ops virtnet_ethtool_ops = {
.set_tx_csum = virtnet_set_tx_csum,
.set_sg = ethtool_op_set_sg,
.set_tso = ethtool_op_set_tso,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/libertas/dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "defs.h"
#include "hostcmd.h"

extern struct ethtool_ops lbs_ethtool_ops;
extern const struct ethtool_ops lbs_ethtool_ops;

#define MAX_BSSID_PER_CHANNEL 16

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/libertas/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static int lbs_ethtool_set_wol(struct net_device *dev,
return lbs_host_sleep_cfg(priv, criteria, (struct wol_config *)NULL);
}

struct ethtool_ops lbs_ethtool_ops = {
const struct ethtool_ops lbs_ethtool_ops = {
.get_drvinfo = lbs_ethtool_get_drvinfo,
.get_eeprom = lbs_ethtool_get_eeprom,
.get_eeprom_len = lbs_ethtool_get_eeprom_len,
Expand Down
Loading

0 comments on commit 0fc0b73

Please sign in to comment.