Driver core: allow certain drivers prohibit bind/unbind via sysfs

Platform drivers registered via platform_driver_probe() can be bound
to devices only once, upon registration, because discard their probe()
routines to save memory. Unbinding the driver through sysfs 'unbind'
leaves the device stranded and confuses users so let's not create
bind and unbind attributes for such drivers.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Cc: Éric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Dmitry Torokhov
2009-10-12 20:17:41 -07:00
committed by Greg Kroah-Hartman
parent 39acbc12af
commit 1a6f2a7512
3 changed files with 19 additions and 8 deletions

View File

@ -124,7 +124,9 @@ struct device_driver {
struct bus_type *bus;
struct module *owner;
const char *mod_name; /* used for built-in modules */
const char *mod_name; /* used for built-in modules */
bool suppress_bind_attrs; /* disables bind/unbind via sysfs */
int (*probe) (struct device *dev);
int (*remove) (struct device *dev);