aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-06 20:03:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-06 21:42:15 -0500
commit0324e74534241f3f00910ec04ef67de1fe1542f4 (patch)
tree88f0b2a40a47dc0a22c0ce5e9b75a58470a56204 /drivers/net
parent1071ec7bc2dabd0a9d12a1ae5570f4fd3ba944ca (diff)
parent0cae60f91494e34a0c5391f1455f825d5849b05f (diff)
Merge tag 'driver-core-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core / sysfs patches from Greg KH: "Here's the big driver core / sysfs update for 3.13-rc1. There's lots of dev_groups updates for different subsystems, as they all get slowly migrated over to the safe versions of the attribute groups (removing userspace races with the creation of the sysfs files.) Also in here are some kobject updates, devres expansions, and the first round of Tejun's sysfs reworking to enable it to be used by other subsystems as a backend for an in-kernel filesystem. All of these have been in linux-next for a while with no reported issues" * tag 'driver-core-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (83 commits) sysfs: rename sysfs_assoc_lock and explain what it's about sysfs: use generic_file_llseek() for sysfs_file_operations sysfs: return correct error code on unimplemented mmap() mdio_bus: convert bus code to use dev_groups device: Make dev_WARN/dev_WARN_ONCE print device as well as driver name sysfs: separate out dup filename warning into a separate function sysfs: move sysfs_hash_and_remove() to fs/sysfs/dir.c sysfs: remove unused sysfs_get_dentry() prototype sysfs: honor bin_attr.attr.ignore_lockdep sysfs: merge sysfs_elem_bin_attr into sysfs_elem_attr devres: restore zeroing behavior of devres_alloc() sysfs: fix sysfs_write_file for bin file input: gameport: convert bus code to use dev_groups input: serio: remove bus usage of dev_attrs input: serio: use DEVICE_ATTR_RO() i2o: convert bus code to use dev_groups memstick: convert bus code to use dev_groups tifm: convert bus code to use dev_groups virtio: convert bus code to use dev_groups ipack: convert bus code to use dev_groups ...
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bond_sysfs.c14
-rw-r--r--drivers/net/phy/mdio_bus.c10
2 files changed, 9 insertions, 15 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index c29b836749b6..ec9b6460a38d 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -149,14 +149,6 @@ err_no_cmd:
149 return -EPERM; 149 return -EPERM;
150} 150}
151 151
152static const void *bonding_namespace(struct class *cls,
153 const struct class_attribute *attr)
154{
155 const struct bond_net *bn =
156 container_of(attr, struct bond_net, class_attr_bonding_masters);
157 return bn->net;
158}
159
160/* class attribute for bond_masters file. This ends up in /sys/class/net */ 152/* class attribute for bond_masters file. This ends up in /sys/class/net */
161static const struct class_attribute class_attr_bonding_masters = { 153static const struct class_attribute class_attr_bonding_masters = {
162 .attr = { 154 .attr = {
@@ -165,7 +157,6 @@ static const struct class_attribute class_attr_bonding_masters = {
165 }, 157 },
166 .show = bonding_show_bonds, 158 .show = bonding_show_bonds,
167 .store = bonding_store_bonds, 159 .store = bonding_store_bonds,
168 .namespace = bonding_namespace,
169}; 160};
170 161
171int bond_create_slave_symlinks(struct net_device *master, 162int bond_create_slave_symlinks(struct net_device *master,
@@ -1787,7 +1778,8 @@ int bond_create_sysfs(struct bond_net *bn)
1787 bn->class_attr_bonding_masters = class_attr_bonding_masters; 1778 bn->class_attr_bonding_masters = class_attr_bonding_masters;
1788 sysfs_attr_init(&bn->class_attr_bonding_masters.attr); 1779 sysfs_attr_init(&bn->class_attr_bonding_masters.attr);
1789 1780
1790 ret = netdev_class_create_file(&bn->class_attr_bonding_masters); 1781 ret = netdev_class_create_file_ns(&bn->class_attr_bonding_masters,
1782 bn->net);
1791 /* 1783 /*
1792 * Permit multiple loads of the module by ignoring failures to 1784 * Permit multiple loads of the module by ignoring failures to
1793 * create the bonding_masters sysfs file. Bonding devices 1785 * create the bonding_masters sysfs file. Bonding devices
@@ -1817,7 +1809,7 @@ int bond_create_sysfs(struct bond_net *bn)
1817 */ 1809 */
1818void bond_destroy_sysfs(struct bond_net *bn) 1810void bond_destroy_sysfs(struct bond_net *bn)
1819{ 1811{
1820 netdev_class_remove_file(&bn->class_attr_bonding_masters); 1812 netdev_class_remove_file_ns(&bn->class_attr_bonding_masters, bn->net);
1821} 1813}
1822 1814
1823/* 1815/*
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index dc920974204e..56178761ce93 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -438,17 +438,19 @@ phy_id_show(struct device *dev, struct device_attribute *attr, char *buf)
438 438
439 return sprintf(buf, "0x%.8lx\n", (unsigned long)phydev->phy_id); 439 return sprintf(buf, "0x%.8lx\n", (unsigned long)phydev->phy_id);
440} 440}
441static DEVICE_ATTR_RO(phy_id);
441 442
442static struct device_attribute mdio_dev_attrs[] = { 443static struct attribute *mdio_dev_attrs[] = {
443 __ATTR_RO(phy_id), 444 &dev_attr_phy_id.attr,
444 __ATTR_NULL 445 NULL,
445}; 446};
447ATTRIBUTE_GROUPS(mdio_dev);
446 448
447struct bus_type mdio_bus_type = { 449struct bus_type mdio_bus_type = {
448 .name = "mdio_bus", 450 .name = "mdio_bus",
449 .match = mdio_bus_match, 451 .match = mdio_bus_match,
450 .pm = MDIO_BUS_PM_OPS, 452 .pm = MDIO_BUS_PM_OPS,
451 .dev_attrs = mdio_dev_attrs, 453 .dev_groups = mdio_dev_groups,
452}; 454};
453EXPORT_SYMBOL(mdio_bus_type); 455EXPORT_SYMBOL(mdio_bus_type);
454 456