led.c (2616144e4345e4cdab56fd7c673fbb69074a9ce2) led.c (d3ce8327194c0bcf742f2e03b5b0dc8f8cfe7f6b)
1/*-
2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
8 *

--- 243 unchanged lines hidden (view full) ---

252 struct ledsc *sc;
253
254 sc = malloc(sizeof *sc, M_LED, M_WAITOK | M_ZERO);
255
256 sx_xlock(&led_sx);
257 sc->unit = alloc_unr(led_unit);
258 sc->private = priv;
259 sc->func = func;
1/*-
2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
5 * can do whatever you want with this stuff. If we meet some day, and you think
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ----------------------------------------------------------------------------
8 *

--- 243 unchanged lines hidden (view full) ---

252 struct ledsc *sc;
253
254 sc = malloc(sizeof *sc, M_LED, M_WAITOK | M_ZERO);
255
256 sx_xlock(&led_sx);
257 sc->unit = alloc_unr(led_unit);
258 sc->private = priv;
259 sc->func = func;
260 sc->dev = make_dev(&led_cdevsw, unit2minor(sc->unit),
260 sc->dev = make_dev(&led_cdevsw, sc->unit,
261 UID_ROOT, GID_WHEEL, 0600, "led/%s", name);
262 sx_xunlock(&led_sx);
263
264 mtx_lock(&led_mtx);
265 sc->dev->si_drv1 = sc;
266 if (LIST_EMPTY(&led_list))
267 callout_reset(&led_ch, hz / 10, led_timeout, NULL);
268 LIST_INSERT_HEAD(&led_list, sc, list);

--- 40 unchanged lines hidden ---
261 UID_ROOT, GID_WHEEL, 0600, "led/%s", name);
262 sx_xunlock(&led_sx);
263
264 mtx_lock(&led_mtx);
265 sc->dev->si_drv1 = sc;
266 if (LIST_EMPTY(&led_list))
267 callout_reset(&led_ch, hz / 10, led_timeout, NULL);
268 LIST_INSERT_HEAD(&led_list, sc, list);

--- 40 unchanged lines hidden ---