Warn about drivers which take over other drivers cdevsw entries, but still

grant them squatters right.
This commit is contained in:
Poul-Henning Kamp 1999-07-03 08:22:30 +00:00
parent f17162e2da
commit c31558b215
1 changed files with 12 additions and 2 deletions

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: kern_conf.c,v 1.44 1999/06/25 07:49:00 grog Exp $
* $Id: kern_conf.c,v 1.45 1999/06/26 11:39:27 dfr Exp $
*/
#include <sys/param.h>
@ -112,10 +112,20 @@ cdevsw_add(struct cdevsw *newentry)
return EINVAL;
}
if (cdevsw[newentry->d_maj]) {
printf("WARNING: \"%s\" is usurping \"%s\"'s cdevsw[]\n",
newentry->d_name, cdevsw[newentry->d_maj]->d_name);
}
cdevsw[newentry->d_maj] = newentry;
if (newentry->d_bmaj >= 0 && newentry->d_bmaj < NUMCDEVSW)
if (newentry->d_bmaj >= 0 && newentry->d_bmaj < NUMCDEVSW) {
if (bmaj2cmaj[newentry->d_bmaj] != 254) {
printf("WARNING: \"%s\" is usurping \"%s\"'s bmaj\n",
newentry->d_name,
cdevsw[bmaj2cmaj[newentry->d_bmaj]]->d_name);
}
bmaj2cmaj[newentry->d_bmaj] = newentry->d_maj;
}
return 0;
}