diff options
author | eadler <eadler@FreeBSD.org> | 2012-10-02 03:33:41 +0000 |
---|---|---|
committer | eadler <eadler@FreeBSD.org> | 2012-10-02 03:33:41 +0000 |
commit | 833f88ba4533cfae0dc0e1d016ab79b0e68ef0cc (patch) | |
tree | 675fc54b651e477f71721fcc6b8e0e66b8d17c81 /sys | |
parent | a0bfe4edc64ac8e7cca69aaf01caad11bba39724 (diff) | |
download | FreeBSD-src-833f88ba4533cfae0dc0e1d016ab79b0e68ef0cc.zip FreeBSD-src-833f88ba4533cfae0dc0e1d016ab79b0e68ef0cc.tar.gz |
Provide a generic way to disable devices at boot time
PR: kern/119202
Requested by: peterj
Reviewed by: sbruno, jhb
Approved by: cperciva
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_bus.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index d71d0b9..c41fba0 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2762,6 +2762,13 @@ device_attach(device_t dev) { int error; + if (resource_disabled(dev->driver->name, dev->unit)) { + device_disable(dev); + if (bootverbose) + device_printf(dev, "disabled via hints entry\n"); + return (ENXIO); + } + device_sysctl_init(dev); if (!device_is_quiet(dev)) device_print_child(dev->parent, dev); |