diff options
author | phk <phk@FreeBSD.org> | 2004-06-17 17:16:53 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-06-17 17:16:53 +0000 |
commit | 40dd98a3bd2049465e7644b361b60da41a46efa0 (patch) | |
tree | fe8b297144afd6d6f7db41275c72cb5eb663ec02 /sys/netgraph/bluetooth | |
parent | 9acfe1e733142ca875624a3acbf96c4ff27b36a4 (diff) | |
download | FreeBSD-src-40dd98a3bd2049465e7644b361b60da41a46efa0.zip FreeBSD-src-40dd98a3bd2049465e7644b361b60da41a46efa0.tar.gz |
Second half of the dev_t cleanup.
The big lines are:
NODEV -> NULL
NOUDEV -> NODEV
udev_t -> dev_t
udev2dev() -> findcdev()
Various minor adjustments including handling of userland access to kernel
space struct cdev etc.
Diffstat (limited to 'sys/netgraph/bluetooth')
-rw-r--r-- | sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c | 28 | ||||
-rw-r--r-- | sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c | 14 |
2 files changed, 21 insertions, 21 deletions
diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c index c28e772..1068dad 100644 --- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c +++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c @@ -408,7 +408,7 @@ USB_ATTACH(ubt) sc->sc_hook = NULL; /* Device part */ - sc->sc_ctrl_dev = sc->sc_intr_dev = sc->sc_bulk_dev = NODEV; + sc->sc_ctrl_dev = sc->sc_intr_dev = sc->sc_bulk_dev = NULL; sc->sc_refcnt = sc->sc_dying = 0; /* @@ -1903,8 +1903,8 @@ ng_ubt_newhook(node_p node, hook_p hook, char const *name) ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(node); /* Refuse to create new hook if device interface is active */ - if (sc->sc_ctrl_dev != NODEV || sc->sc_intr_dev != NODEV || - sc->sc_bulk_dev != NODEV) + if (sc->sc_ctrl_dev != NULL || sc->sc_intr_dev != NULL || + sc->sc_bulk_dev != NULL) return (EBUSY); if (strcmp(name, NG_UBT_HOOK) != 0) @@ -1929,8 +1929,8 @@ ng_ubt_connect(hook_p hook) usbd_status status; /* Refuse to connect hook if device interface is active */ - if (sc->sc_ctrl_dev != NODEV || sc->sc_intr_dev != NODEV || - sc->sc_bulk_dev != NODEV) + if (sc->sc_ctrl_dev != NULL || sc->sc_intr_dev != NULL || + sc->sc_bulk_dev != NULL) return (EBUSY); NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook)); @@ -2658,14 +2658,14 @@ ubt_create_device_nodes(ubt_softc_p sc) "%s: %s - hook != NULL!\n", __func__, USBDEVNAME(sc->sc_dev))); /* Control device */ - if (sc->sc_ctrl_dev == NODEV) + if (sc->sc_ctrl_dev == NULL) sc->sc_ctrl_dev = make_dev(&ubt_cdevsw, UBT_MINOR(USBDEVUNIT(sc->sc_dev), 0), UID_ROOT, GID_OPERATOR, 0644, "%s", USBDEVNAME(sc->sc_dev)); /* Interrupt device */ - if (sc->sc_intr_dev == NODEV && sc->sc_intr_ep != -1) { + if (sc->sc_intr_dev == NULL && sc->sc_intr_ep != -1) { ep = UE_GET_ADDR(sc->sc_intr_ep); sc->sc_intr_dev = make_dev(&ubt_cdevsw, UBT_MINOR(USBDEVUNIT(sc->sc_dev), ep), @@ -2679,7 +2679,7 @@ ubt_create_device_nodes(ubt_softc_p sc) * XXX note that address of the in and out endpoint should be the same */ - if (sc->sc_bulk_dev == NODEV && + if (sc->sc_bulk_dev == NULL && sc->sc_bulk_in_ep != -1 && sc->sc_bulk_out_ep != -1 && UE_GET_ADDR(sc->sc_bulk_in_ep) == UE_GET_ADDR(sc->sc_bulk_out_ep)) { ep = UE_GET_ADDR(sc->sc_bulk_in_ep); @@ -2712,19 +2712,19 @@ ubt_destroy_device_nodes(ubt_softc_p sc) sc->sc_refcnt = 0; /* Destroy device nodes */ - if (sc->sc_bulk_dev != NODEV) { + if (sc->sc_bulk_dev != NULL) { destroy_dev(sc->sc_bulk_dev); - sc->sc_bulk_dev = NODEV; + sc->sc_bulk_dev = NULL; } - if (sc->sc_intr_dev != NODEV) { + if (sc->sc_intr_dev != NULL) { destroy_dev(sc->sc_intr_dev); - sc->sc_intr_dev = NODEV; + sc->sc_intr_dev = NULL; } - if (sc->sc_ctrl_dev != NODEV) { + if (sc->sc_ctrl_dev != NULL) { destroy_dev(sc->sc_ctrl_dev); - sc->sc_ctrl_dev = NODEV; + sc->sc_ctrl_dev = NULL; } } /* ubt_destroy_device_nodes */ diff --git a/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c b/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c index f957cf5..53f367e 100644 --- a/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c +++ b/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c @@ -149,7 +149,7 @@ USB_ATTACH(ubtbcmfw) USB_ATTACH_SETUP; printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo); - sc->sc_ctrl_dev = sc->sc_intr_in_dev = sc->sc_bulk_out_dev = NODEV; + sc->sc_ctrl_dev = sc->sc_intr_in_dev = sc->sc_bulk_out_dev = NULL; sc->sc_intr_in_pipe = sc->sc_bulk_out_pipe = NULL; sc->sc_flags = sc->sc_refcnt = sc->sc_dying = 0; @@ -229,19 +229,19 @@ USB_DETACH(ubtbcmfw) } /* Destroy device nodes */ - if (sc->sc_bulk_out_dev != NODEV) { + if (sc->sc_bulk_out_dev != NULL) { destroy_dev(sc->sc_bulk_out_dev); - sc->sc_bulk_out_dev = NODEV; + sc->sc_bulk_out_dev = NULL; } - if (sc->sc_intr_in_dev != NODEV) { + if (sc->sc_intr_in_dev != NULL) { destroy_dev(sc->sc_intr_in_dev); - sc->sc_intr_in_dev = NODEV; + sc->sc_intr_in_dev = NULL; } - if (sc->sc_ctrl_dev != NODEV) { + if (sc->sc_ctrl_dev != NULL) { destroy_dev(sc->sc_ctrl_dev); - sc->sc_ctrl_dev = NODEV; + sc->sc_ctrl_dev = NULL; } /* Close pipes */ |