Avoid a '"fd" is usurping ...' message.

PR:		20348
Submitted by:	Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
This commit is contained in:
Nick Hibma 2000-08-09 12:45:04 +00:00
parent 0eb10a0963
commit 02211bae3b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=64453
2 changed files with 10 additions and 2 deletions

View file

@ -1101,10 +1101,14 @@ fd_attach(device_t dev)
int typemynor;
int typesize;
#endif
static int cdevsw_add_done = 0;
fd = device_get_softc(dev);
cdevsw_add(&fd_cdevsw); /* XXX */
if (!cdevsw_add_done) {
cdevsw_add(&fd_cdevsw); /* XXX */
cdevsw_add_done++;
}
make_dev(&fd_cdevsw, (fd->fdu << 6),
UID_ROOT, GID_OPERATOR, 0640, "rfd%d", fd->fdu);

View file

@ -1101,10 +1101,14 @@ fd_attach(device_t dev)
int typemynor;
int typesize;
#endif
static int cdevsw_add_done = 0;
fd = device_get_softc(dev);
cdevsw_add(&fd_cdevsw); /* XXX */
if (!cdevsw_add_done) {
cdevsw_add(&fd_cdevsw); /* XXX */
cdevsw_add_done++;
}
make_dev(&fd_cdevsw, (fd->fdu << 6),
UID_ROOT, GID_OPERATOR, 0640, "rfd%d", fd->fdu);