aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/macb.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-07 22:22:26 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-07 22:22:26 -0500
commitf2aca47dc3c2d0c2d5dbd972558557e74232bbce (patch)
treeeae58f599a25a1f3ab41bf616a2b7c4b3c6e2277 /drivers/net/macb.c
parent7677ced48e2bbbb8d847d34f37e5d96d2b0e41e4 (diff)
parentb592fcfe7f06c15ec11774b5be7ce0de3aa86e73 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (28 commits) sysfs: Shadow directory support Driver Core: Increase the default timeout value of the firmware subsystem Driver core: allow to delay the uevent at device creation time Driver core: add device_type to struct device Driver core: add uevent vars for devices of a class SYSFS: Fix missing include of list.h in sysfs.h HOWTO: Add a reference to Harbison and Steele sysfs: error handling in sysfs, fill_read_buffer() kobject: kobject_put cleanup sysfs: kobject_put cleanup sysfs: suppress lockdep warnings Driver core: fix race in sysfs between sysfs_remove_file() and read()/write() driver core: Change function call order in device_bind_driver(). driver core: Don't stop probing on ->probe errors. driver core fixes: device_register() retval check in platform.c driver core fixes: make_class_name() retval checks /sys/modules/*/holders USB: add the sysfs driver name to all modules SERIO: add the sysfs driver name to all modules PCI: add the sysfs driver name to all modules ...
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 5eb7a3536f29..e67361e2bf5d 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",