[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20130801152148.c98a281ec6e076646edeb7cb@canb.auug.org.au>
Date: Thu, 1 Aug 2013 15:21:48 +1000
From: Stephen Rothwell <sfr@...b.auug.org.au>
To: Greg KH <greg@...ah.com>
Cc: linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
Jiri Pirko <jiri@...nulli.us>,
David Miller <davem@...emloft.net>, <netdev@...r.kernel.org>
Subject: linux-next: manual merge of the driver-core tree with the net-next
tree
Hi Greg,
Today's linux-next merge of the driver-core tree got a conflict in
net/core/net-sysfs.c between commit ff80e519ab1b ("net: export physical
port id via sysfs") from the net-next tree and commit 6be8aeef348a ("net:
core: convert class code to use dev_groups") from the driver-core tree.
I fixed it up (see below) and can carry the fix as necessary (no action
is required).
--
Cheers,
Stephen Rothwell sfr@...b.auug.org.au
diff --cc net/core/net-sysfs.c
index 8826b0d,707c313..0000000
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@@ -237,9 -250,9 +250,31 @@@ static ssize_t operstate_show(struct de
return sprintf(buf, "%s\n", operstates[operstate]);
}
+ static DEVICE_ATTR_RO(operstate);
+
++static ssize_t phys_port_id_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ struct net_device *netdev = to_net_dev(dev);
++ ssize_t ret = -EINVAL;
++
++ if (!rtnl_trylock())
++ return restart_syscall();
++
++ if (dev_isalive(netdev)) {
++ struct netdev_phys_port_id ppid;
++
++ ret = dev_get_phys_port_id(netdev, &ppid);
++ if (!ret)
++ ret = sprintf(buf, "%*phN\n", ppid.id_len, ppid.id);
++ }
++ rtnl_unlock();
++
++ return ret;
++}
++static DEVICE_ATTR_RO(phys_port_id);
+
/* read-write attributes */
- NETDEVICE_SHOW(mtu, fmt_dec);
static int change_mtu(struct net_device *net, unsigned long new_mtu)
{
@@@ -333,52 -344,32 +366,33 @@@ static ssize_t group_store(struct devic
{
return netdev_store(dev, attr, buf, len, change_group);
}
-
- static ssize_t show_phys_port_id(struct device *dev,
- struct device_attribute *attr, char *buf)
- {
- struct net_device *netdev = to_net_dev(dev);
- ssize_t ret = -EINVAL;
-
- if (!rtnl_trylock())
- return restart_syscall();
-
- if (dev_isalive(netdev)) {
- struct netdev_phys_port_id ppid;
-
- ret = dev_get_phys_port_id(netdev, &ppid);
- if (!ret)
- ret = sprintf(buf, "%*phN\n", ppid.id_len, ppid.id);
- }
- rtnl_unlock();
-
- return ret;
- }
-
- static struct device_attribute net_class_attributes[] = {
- __ATTR(addr_assign_type, S_IRUGO, show_addr_assign_type, NULL),
- __ATTR(addr_len, S_IRUGO, show_addr_len, NULL),
- __ATTR(dev_id, S_IRUGO, show_dev_id, NULL),
- __ATTR(ifalias, S_IRUGO | S_IWUSR, show_ifalias, store_ifalias),
- __ATTR(iflink, S_IRUGO, show_iflink, NULL),
- __ATTR(ifindex, S_IRUGO, show_ifindex, NULL),
- __ATTR(type, S_IRUGO, show_type, NULL),
- __ATTR(link_mode, S_IRUGO, show_link_mode, NULL),
- __ATTR(address, S_IRUGO, show_address, NULL),
- __ATTR(broadcast, S_IRUGO, show_broadcast, NULL),
- __ATTR(carrier, S_IRUGO | S_IWUSR, show_carrier, store_carrier),
- __ATTR(speed, S_IRUGO, show_speed, NULL),
- __ATTR(duplex, S_IRUGO, show_duplex, NULL),
- __ATTR(dormant, S_IRUGO, show_dormant, NULL),
- __ATTR(operstate, S_IRUGO, show_operstate, NULL),
- __ATTR(mtu, S_IRUGO | S_IWUSR, show_mtu, store_mtu),
- __ATTR(flags, S_IRUGO | S_IWUSR, show_flags, store_flags),
- __ATTR(tx_queue_len, S_IRUGO | S_IWUSR, show_tx_queue_len,
- store_tx_queue_len),
- __ATTR(netdev_group, S_IRUGO | S_IWUSR, show_group, store_group),
- __ATTR(phys_port_id, S_IRUGO, show_phys_port_id, NULL),
- {}
+ NETDEVICE_SHOW(group, fmt_dec);
+ static DEVICE_ATTR(netdev_group, S_IRUGO | S_IWUSR, group_show, group_store);
+
+ static struct attribute *net_class_attrs[] = {
+ &dev_attr_netdev_group.attr,
+ &dev_attr_type.attr,
+ &dev_attr_dev_id.attr,
+ &dev_attr_iflink.attr,
+ &dev_attr_ifindex.attr,
+ &dev_attr_addr_assign_type.attr,
+ &dev_attr_addr_len.attr,
+ &dev_attr_link_mode.attr,
+ &dev_attr_address.attr,
+ &dev_attr_broadcast.attr,
+ &dev_attr_speed.attr,
+ &dev_attr_duplex.attr,
+ &dev_attr_dormant.attr,
+ &dev_attr_operstate.attr,
++ &dev_attr_phys_port_id.attr,
+ &dev_attr_ifalias.attr,
+ &dev_attr_carrier.attr,
+ &dev_attr_mtu.attr,
+ &dev_attr_flags.attr,
+ &dev_attr_tx_queue_len.attr,
+ NULL,
};
+ ATTRIBUTE_GROUPS(net_class);
/* Show a given an attribute in the statistics group */
static ssize_t netstat_show(const struct device *d,
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists