mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-28 12:25:31 +00:00
afdce75f1e
This adds a single file, "bind", to the sysfs directory of every driver registered with the driver core. To bind a device to a driver, write the bus id of the device you wish to bind to that specific driver to the "bind" file (remember to not add a trailing \n). If that bus id matches a device on that bus, and it does not currently have a driver bound to it, the probe sequence will be initiated with that driver and device. Note, this requires that the driver itself be willing and able to accept that device (usually through a device id type table). This patch does not make it possible to override the driver's id table. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
22 lines
625 B
C
22 lines
625 B
C
extern int bus_add_device(struct device * dev);
|
|
extern void bus_remove_device(struct device * dev);
|
|
|
|
extern int bus_add_driver(struct device_driver *);
|
|
extern void bus_remove_driver(struct device_driver *);
|
|
|
|
extern void driver_detach(struct device_driver * drv);
|
|
extern int driver_probe_device(struct device_driver *, struct device *);
|
|
|
|
static inline struct class_device *to_class_dev(struct kobject *obj)
|
|
{
|
|
return container_of(obj, struct class_device, kobj);
|
|
}
|
|
|
|
static inline
|
|
struct class_device_attribute *to_class_dev_attr(struct attribute *_attr)
|
|
{
|
|
return container_of(_attr, struct class_device_attribute, attr);
|
|
}
|
|
|
|
|