Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48774
b: refs/heads/master
c: 4aca67e
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Morton authored and Greg Kroah-Hartman committed Feb 16, 2007
1 parent 975d7cf commit d27e719
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 873760fbf4d1c8c477a50386438303b6b89b6566
refs/heads/master: 4aca67e5f54bf6ee439b5bdbc77007a547ad5b43
22 changes: 10 additions & 12 deletions trunk/drivers/base/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,27 +324,25 @@ int bus_for_each_drv(struct bus_type * bus, struct device_driver * start,
return error;
}

static int device_add_attrs(struct bus_type * bus, struct device * dev)
static int device_add_attrs(struct bus_type *bus, struct device *dev)
{
int error = 0;
int i;

if (bus->dev_attrs) {
for (i = 0; attr_name(bus->dev_attrs[i]); i++) {
error = device_create_file(dev,&bus->dev_attrs[i]);
if (error)
goto Err;
if (!bus->dev_attrs)
return 0;

for (i = 0; attr_name(bus->dev_attrs[i]); i++) {
error = device_create_file(dev,&bus->dev_attrs[i]);
if (error) {
while (--i >= 0)
device_remove_file(dev, &bus->dev_attrs[i]);
break;
}
}
Done:
return error;
Err:
while (--i >= 0)
device_remove_file(dev,&bus->dev_attrs[i]);
goto Done;
}


static void device_remove_attrs(struct bus_type * bus, struct device * dev)
{
int i;
Expand Down

0 comments on commit d27e719

Please sign in to comment.