Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8380770c authored by Kay Sievers's avatar Kay Sievers Committed by Greg Kroah-Hartman
Browse files

Driver core: make sysfs uevent-attributes static



Attributes do not have an owner(module) anymore, so there is no need
to carry the attributes in every single bus instance.

Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
Acked-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3b6662f1
Loading
Loading
Loading
Loading
+9 −12
Original line number Original line Diff line number Diff line
@@ -568,32 +568,29 @@ static void remove_bind_files(struct device_driver *drv)
	driver_remove_file(drv, &driver_attr_unbind);
	driver_remove_file(drv, &driver_attr_unbind);
}
}


static BUS_ATTR(drivers_probe, S_IWUSR, NULL, store_drivers_probe);
static BUS_ATTR(drivers_autoprobe, S_IWUSR | S_IRUGO,
		show_drivers_autoprobe, store_drivers_autoprobe);

static int add_probe_files(struct bus_type *bus)
static int add_probe_files(struct bus_type *bus)
{
{
	int retval;
	int retval;


	bus->drivers_probe_attr.attr.name = "drivers_probe";
	retval = bus_create_file(bus, &bus_attr_drivers_probe);
	bus->drivers_probe_attr.attr.mode = S_IWUSR;
	bus->drivers_probe_attr.store = store_drivers_probe;
	retval = bus_create_file(bus, &bus->drivers_probe_attr);
	if (retval)
	if (retval)
		goto out;
		goto out;


	bus->drivers_autoprobe_attr.attr.name = "drivers_autoprobe";
	retval = bus_create_file(bus, &bus_attr_drivers_autoprobe);
	bus->drivers_autoprobe_attr.attr.mode = S_IWUSR | S_IRUGO;
	bus->drivers_autoprobe_attr.show = show_drivers_autoprobe;
	bus->drivers_autoprobe_attr.store = store_drivers_autoprobe;
	retval = bus_create_file(bus, &bus->drivers_autoprobe_attr);
	if (retval)
	if (retval)
		bus_remove_file(bus, &bus->drivers_probe_attr);
		bus_remove_file(bus, &bus_attr_drivers_probe);
out:
out:
	return retval;
	return retval;
}
}


static void remove_probe_files(struct bus_type *bus)
static void remove_probe_files(struct bus_type *bus)
{
{
	bus_remove_file(bus, &bus->drivers_autoprobe_attr);
	bus_remove_file(bus, &bus_attr_drivers_autoprobe);
	bus_remove_file(bus, &bus->drivers_probe_attr);
	bus_remove_file(bus, &bus_attr_drivers_probe);
}
}
#else
#else
static inline int add_bind_files(struct device_driver *drv) { return 0; }
static inline int add_bind_files(struct device_driver *drv) { return 0; }
+0 −2
Original line number Original line Diff line number Diff line
@@ -64,8 +64,6 @@ struct bus_type {
	struct bus_attribute	* bus_attrs;
	struct bus_attribute	* bus_attrs;
	struct device_attribute	* dev_attrs;
	struct device_attribute	* dev_attrs;
	struct driver_attribute	* drv_attrs;
	struct driver_attribute	* drv_attrs;
	struct bus_attribute drivers_autoprobe_attr;
	struct bus_attribute drivers_probe_attr;


	int		(*match)(struct device * dev, struct device_driver * drv);
	int		(*match)(struct device * dev, struct device_driver * drv);
	int		(*uevent)(struct device *dev, char **envp,
	int		(*uevent)(struct device *dev, char **envp,