/* bus_add_attrs - Add default attributes for this bus. @bus: Bus that has just been registered.  */
static int bus_add_attrs(struct bus_type *bus)
/* bus_add_attrs - Add default attributes for this bus. @bus: Bus that has just been registered.  */
static int bus_add_attrs(struct bus_type *bus)
{
	int error = 0;
	int i;
	if (bus->bus_attrs) {
		for (i = 0; attr_name(bus->bus_attrs[i]); i++) {
			error = bus_create_file(bus, &bus->bus_attrs[i]);
			if (error)
				goto err;
		}
	}
done:
	return error;
err:
	while (--i >= 0)
		bus_remove_file(bus, &bus->bus_attrs[i]);
	goto done;
}