aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-22 13:25:34 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-22 13:25:34 -0400
commit3e1026b3fa2f61d33ce6a9e42a22398cc4ab8e58 (patch)
treefda2502a6ecde59413a91be4a3f2df6e779bd5af /drivers/base
parent09239ed4aa99b2d2fd9b1a51b264661a4a6d469e (diff)
sysfs.h: remove attr_name() macro
Gotta love a macro that doesn't reduce the typing you have to do. Also, only the driver core, and one network driver uses this. The driver core functions will be going away soon, and I'll convert the network driver soon to not need this as well, so delete it for now before anyone else gets some bright ideas and wants to use it. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/bus.c12
-rw-r--r--drivers/base/class.c4
-rw-r--r--drivers/base/core.c8
3 files changed, 12 insertions, 12 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index f099af0b41af..235e2b06ac05 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -460,7 +460,7 @@ static int device_add_attrs(struct bus_type *bus, struct device *dev)
460 if (!bus->dev_attrs) 460 if (!bus->dev_attrs)
461 return 0; 461 return 0;
462 462
463 for (i = 0; attr_name(bus->dev_attrs[i]); i++) { 463 for (i = 0; bus->dev_attrs[i].attr.name; i++) {
464 error = device_create_file(dev, &bus->dev_attrs[i]); 464 error = device_create_file(dev, &bus->dev_attrs[i]);
465 if (error) { 465 if (error) {
466 while (--i >= 0) 466 while (--i >= 0)
@@ -476,7 +476,7 @@ static void device_remove_attrs(struct bus_type *bus, struct device *dev)
476 int i; 476 int i;
477 477
478 if (bus->dev_attrs) { 478 if (bus->dev_attrs) {
479 for (i = 0; attr_name(bus->dev_attrs[i]); i++) 479 for (i = 0; bus->dev_attrs[i].attr.name; i++)
480 device_remove_file(dev, &bus->dev_attrs[i]); 480 device_remove_file(dev, &bus->dev_attrs[i]);
481 } 481 }
482} 482}
@@ -596,7 +596,7 @@ static int driver_add_attrs(struct bus_type *bus, struct device_driver *drv)
596 int i; 596 int i;
597 597
598 if (bus->drv_attrs) { 598 if (bus->drv_attrs) {
599 for (i = 0; attr_name(bus->drv_attrs[i]); i++) { 599 for (i = 0; bus->drv_attrs[i].attr.name; i++) {
600 error = driver_create_file(drv, &bus->drv_attrs[i]); 600 error = driver_create_file(drv, &bus->drv_attrs[i]);
601 if (error) 601 if (error)
602 goto err; 602 goto err;
@@ -616,7 +616,7 @@ static void driver_remove_attrs(struct bus_type *bus,
616 int i; 616 int i;
617 617
618 if (bus->drv_attrs) { 618 if (bus->drv_attrs) {
619 for (i = 0; attr_name(bus->drv_attrs[i]); i++) 619 for (i = 0; bus->drv_attrs[i].attr.name; i++)
620 driver_remove_file(drv, &bus->drv_attrs[i]); 620 driver_remove_file(drv, &bus->drv_attrs[i]);
621 } 621 }
622} 622}
@@ -857,7 +857,7 @@ static int bus_add_attrs(struct bus_type *bus)
857 int i; 857 int i;
858 858
859 if (bus->bus_attrs) { 859 if (bus->bus_attrs) {
860 for (i = 0; attr_name(bus->bus_attrs[i]); i++) { 860 for (i = 0; bus->bus_attrs[i].attr.name; i++) {
861 error = bus_create_file(bus, &bus->bus_attrs[i]); 861 error = bus_create_file(bus, &bus->bus_attrs[i]);
862 if (error) 862 if (error)
863 goto err; 863 goto err;
@@ -876,7 +876,7 @@ static void bus_remove_attrs(struct bus_type *bus)
876 int i; 876 int i;
877 877
878 if (bus->bus_attrs) { 878 if (bus->bus_attrs) {
879 for (i = 0; attr_name(bus->bus_attrs[i]); i++) 879 for (i = 0; bus->bus_attrs[i].attr.name; i++)
880 bus_remove_file(bus, &bus->bus_attrs[i]); 880 bus_remove_file(bus, &bus->bus_attrs[i]);
881 } 881 }
882} 882}
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 3ce845471327..8b7818b80056 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -135,7 +135,7 @@ static int add_class_attrs(struct class *cls)
135 int error = 0; 135 int error = 0;
136 136
137 if (cls->class_attrs) { 137 if (cls->class_attrs) {
138 for (i = 0; attr_name(cls->class_attrs[i]); i++) { 138 for (i = 0; cls->class_attrs[i].attr.name; i++) {
139 error = class_create_file(cls, &cls->class_attrs[i]); 139 error = class_create_file(cls, &cls->class_attrs[i]);
140 if (error) 140 if (error)
141 goto error; 141 goto error;
@@ -154,7 +154,7 @@ static void remove_class_attrs(struct class *cls)
154 int i; 154 int i;
155 155
156 if (cls->class_attrs) { 156 if (cls->class_attrs) {
157 for (i = 0; attr_name(cls->class_attrs[i]); i++) 157 for (i = 0; cls->class_attrs[i].attr.name; i++)
158 class_remove_file(cls, &cls->class_attrs[i]); 158 class_remove_file(cls, &cls->class_attrs[i]);
159 } 159 }
160} 160}
diff --git a/drivers/base/core.c b/drivers/base/core.c
index d743dcee1e77..ae1acdf21bd3 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -440,7 +440,7 @@ static int device_add_attributes(struct device *dev,
440 int i; 440 int i;
441 441
442 if (attrs) { 442 if (attrs) {
443 for (i = 0; attr_name(attrs[i]); i++) { 443 for (i = 0; attrs[i].attr.name; i++) {
444 error = device_create_file(dev, &attrs[i]); 444 error = device_create_file(dev, &attrs[i]);
445 if (error) 445 if (error)
446 break; 446 break;
@@ -458,7 +458,7 @@ static void device_remove_attributes(struct device *dev,
458 int i; 458 int i;
459 459
460 if (attrs) 460 if (attrs)
461 for (i = 0; attr_name(attrs[i]); i++) 461 for (i = 0; attrs[i].attr.name; i++)
462 device_remove_file(dev, &attrs[i]); 462 device_remove_file(dev, &attrs[i]);
463} 463}
464 464
@@ -469,7 +469,7 @@ static int device_add_bin_attributes(struct device *dev,
469 int i; 469 int i;
470 470
471 if (attrs) { 471 if (attrs) {
472 for (i = 0; attr_name(attrs[i]); i++) { 472 for (i = 0; attrs[i].attr.name; i++) {
473 error = device_create_bin_file(dev, &attrs[i]); 473 error = device_create_bin_file(dev, &attrs[i]);
474 if (error) 474 if (error)
475 break; 475 break;
@@ -487,7 +487,7 @@ static void device_remove_bin_attributes(struct device *dev,
487 int i; 487 int i;
488 488
489 if (attrs) 489 if (attrs)
490 for (i = 0; attr_name(attrs[i]); i++) 490 for (i = 0; attrs[i].attr.name; i++)
491 device_remove_bin_file(dev, &attrs[i]); 491 device_remove_bin_file(dev, &attrs[i]);
492} 492}
493 493