aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macb.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2002-04-09 15:14:34 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-07 13:37:11 -0500
commit43cb76d91ee85f579a69d42bc8efc08bac560278 (patch)
treef5c4766a6639fee3685dbbfc9110bb334af9e6dd /drivers/net/macb.c
parent2943ecf2ed32632473c06f1975db47a7aa98c10f (diff)
Network: convert network devices to use struct device instead of class_device
This lets the network core have the ability to handle suspend/resume issues, if it wants to. Thanks to Frederik Deweerdt <frederik.deweerdt@gmail.com> for the arm driver fixes. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r--drivers/net/macb.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 25b559b5d5e..2af20459814 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -27,8 +27,6 @@
27 27
28#include "macb.h" 28#include "macb.h"
29 29
30#define to_net_dev(class) container_of(class, struct net_device, class_dev)
31
32#define RX_BUFFER_SIZE 128 30#define RX_BUFFER_SIZE 128
33#define RX_RING_SIZE 512 31#define RX_RING_SIZE 512
34#define RX_RING_BYTES (sizeof(struct dma_desc) * RX_RING_SIZE) 32#define RX_RING_BYTES (sizeof(struct dma_desc) * RX_RING_SIZE)
@@ -945,10 +943,10 @@ static int macb_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
945 return ret; 943 return ret;
946} 944}
947 945
948static ssize_t macb_mii_show(const struct class_device *cd, char *buf, 946static ssize_t macb_mii_show(const struct device *_dev, char *buf,
949 unsigned long addr) 947 unsigned long addr)
950{ 948{
951 struct net_device *dev = to_net_dev(cd); 949 struct net_device *dev = to_net_dev(_dev);
952 struct macb *bp = netdev_priv(dev); 950 struct macb *bp = netdev_priv(dev);
953 ssize_t ret = -EINVAL; 951 ssize_t ret = -EINVAL;
954 952
@@ -962,11 +960,13 @@ static ssize_t macb_mii_show(const struct class_device *cd, char *buf,
962} 960}
963 961
964#define MII_ENTRY(name, addr) \ 962#define MII_ENTRY(name, addr) \
965static ssize_t show_##name(struct class_device *cd, char *buf) \ 963static ssize_t show_##name(struct device *_dev, \
964 struct device_attribute *attr, \
965 char *buf) \
966{ \ 966{ \
967 return macb_mii_show(cd, buf, addr); \ 967 return macb_mii_show(_dev, buf, addr); \
968} \ 968} \
969static CLASS_DEVICE_ATTR(name, S_IRUGO, show_##name, NULL) 969static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)
970 970
971MII_ENTRY(bmcr, MII_BMCR); 971MII_ENTRY(bmcr, MII_BMCR);
972MII_ENTRY(bmsr, MII_BMSR); 972MII_ENTRY(bmsr, MII_BMSR);
@@ -977,13 +977,13 @@ MII_ENTRY(lpa, MII_LPA);
977MII_ENTRY(expansion, MII_EXPANSION); 977MII_ENTRY(expansion, MII_EXPANSION);
978 978
979static struct attribute *macb_mii_attrs[] = { 979static struct attribute *macb_mii_attrs[] = {
980 &class_device_attr_bmcr.attr, 980 &dev_attr_bmcr.attr,
981 &class_device_attr_bmsr.attr, 981 &dev_attr_bmsr.attr,
982 &class_device_attr_physid1.attr, 982 &dev_attr_physid1.attr,
983 &class_device_attr_physid2.attr, 983 &dev_attr_physid2.attr,
984 &class_device_attr_advertise.attr, 984 &dev_attr_advertise.attr,
985 &class_device_attr_lpa.attr, 985 &dev_attr_lpa.attr,
986 &class_device_attr_expansion.attr, 986 &dev_attr_expansion.attr,
987 NULL, 987 NULL,
988}; 988};
989 989
@@ -994,17 +994,17 @@ static struct attribute_group macb_mii_group = {
994 994
995static void macb_unregister_sysfs(struct net_device *net) 995static void macb_unregister_sysfs(struct net_device *net)
996{ 996{
997 struct class_device *class_dev = &net->class_dev; 997 struct device *_dev = &net->dev;
998 998
999 sysfs_remove_group(&class_dev->kobj, &macb_mii_group); 999 sysfs_remove_group(&_dev->kobj, &macb_mii_group);
1000} 1000}
1001 1001
1002static int macb_register_sysfs(struct net_device *net) 1002static int macb_register_sysfs(struct net_device *net)
1003{ 1003{
1004 struct class_device *class_dev = &net->class_dev; 1004 struct device *_dev = &net->dev;
1005 int ret; 1005 int ret;
1006 1006
1007 ret = sysfs_create_group(&class_dev->kobj, &macb_mii_group); 1007 ret = sysfs_create_group(&_dev->kobj, &macb_mii_group);
1008 if (ret) 1008 if (ret)
1009 printk(KERN_WARNING 1009 printk(KERN_WARNING
1010 "%s: sysfs mii attribute registration failed: %d\n", 1010 "%s: sysfs mii attribute registration failed: %d\n",