Diff for /src/sys/dev/misc/kbd/kbd.c between versions 1.9 and 1.10

version 1.9, 2004/05/13 23:49:16 version 1.10, 2004/05/19 22:52:42
Line 447  kbd_attach(keyboard_t *kbd) Line 447  kbd_attach(keyboard_t *kbd)
         if (keyboard[kbd->kb_index] != kbd)          if (keyboard[kbd->kb_index] != kbd)
                 return EINVAL;                  return EINVAL;
   
           cdevsw_add(&kbd_cdevsw, -1, kbd->kb_index);
         dev = make_dev(&kbd_cdevsw, kbd->kb_index, UID_ROOT, GID_WHEEL, 0600,          dev = make_dev(&kbd_cdevsw, kbd->kb_index, UID_ROOT, GID_WHEEL, 0600,
                        "kbd%r", kbd->kb_index);                         "kbd%r", kbd->kb_index);
         if (dev->si_drv1 == NULL)          if (dev->si_drv1 == NULL)
Line 468  kbd_detach(keyboard_t *kbd) Line 469  kbd_detach(keyboard_t *kbd)
         if (keyboard[kbd->kb_index] != kbd)          if (keyboard[kbd->kb_index] != kbd)
                 return EINVAL;                  return EINVAL;
   
        dev = makedev(kbd_cdevsw.d_maj, kbd->kb_index);        /*
        if (dev->si_drv1)         * Deal with refs properly.  The KBD driver really ought to have
                free(dev->si_drv1, M_DEVBUF);         * recorded the dev_t separately.
        destroy_dev(dev);         */
         if ((dev = make_adhoc_dev(&kbd_cdevsw, kbd->kb_index)) != NODEV) {
                 if (dev->si_drv1) {
                         free(dev->si_drv1, M_DEVBUF);
                         dev->si_drv1 = NULL;
                 }
         }
         cdevsw_remove(&kbd_cdevsw, -1, kbd->kb_index);
         return 0;          return 0;
 }  }
   

Removed from v.1.9  
changed lines
  Added in v.1.10