ieee802154: remove deprecated sysfs entries
authorAlexander Aring <alex.aring@gmail.com>
Mon, 2 Mar 2015 14:10:05 +0000 (15:10 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 14 Mar 2015 16:11:30 +0000 (17:11 +0100)
It's only necessary to offer the name and index, others value are
available over netlink.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/ieee802154/sysfs.c

index dff55c2d87f34fb8304f7b19d321bc3a08813ee7..133b4280660cfc2f9b651a56a95502991e21840b 100644 (file)
@@ -48,49 +48,6 @@ static ssize_t name_show(struct device *dev,
 }
 static DEVICE_ATTR_RO(name);
 
-#define MASTER_SHOW_COMPLEX(name, format_string, args...)              \
-static ssize_t name ## _show(struct device *dev,                       \
-                           struct device_attribute *attr, char *buf)   \
-{                                                                      \
-       struct wpan_phy *phy = container_of(dev, struct wpan_phy, dev); \
-       int ret;                                                        \
-                                                                       \
-       mutex_lock(&phy->pib_lock);                                     \
-       ret = snprintf(buf, PAGE_SIZE, format_string "\n", args);       \
-       mutex_unlock(&phy->pib_lock);                                   \
-       return ret;                                                     \
-}                                                                      \
-static DEVICE_ATTR_RO(name)
-
-#define MASTER_SHOW(field, format_string)                              \
-       MASTER_SHOW_COMPLEX(field, format_string, phy->field)
-
-MASTER_SHOW(current_channel, "%d");
-MASTER_SHOW(current_page, "%d");
-MASTER_SHOW(transmit_power, "%d +- 1 dB");
-MASTER_SHOW_COMPLEX(cca_mode, "%d", phy->cca.mode);
-
-static ssize_t channels_supported_show(struct device *dev,
-                                      struct device_attribute *attr,
-                                      char *buf)
-{
-       struct wpan_phy *phy = container_of(dev, struct wpan_phy, dev);
-       int ret;
-       int i, len = 0;
-
-       mutex_lock(&phy->pib_lock);
-       for (i = 0; i < 32; i++) {
-               ret = snprintf(buf + len, PAGE_SIZE - len,
-                              "%#09x\n", phy->channels_supported[i]);
-               if (ret < 0)
-                       break;
-               len += ret;
-       }
-       mutex_unlock(&phy->pib_lock);
-       return len;
-}
-static DEVICE_ATTR_RO(channels_supported);
-
 static void wpan_phy_release(struct device *dev)
 {
        struct cfg802154_registered_device *rdev = dev_to_rdev(dev);
@@ -101,12 +58,6 @@ static void wpan_phy_release(struct device *dev)
 static struct attribute *pmib_attrs[] = {
        &dev_attr_index.attr,
        &dev_attr_name.attr,
-       /* below will be removed soon */
-       &dev_attr_current_channel.attr,
-       &dev_attr_current_page.attr,
-       &dev_attr_channels_supported.attr,
-       &dev_attr_transmit_power.attr,
-       &dev_attr_cca_mode.attr,
        NULL,
 };
 ATTRIBUTE_GROUPS(pmib);