Lines Matching refs:led

68 	struct led_device *led;  in led_lookup()  local
72 TAILQ_FOREACH(led, &led_devices, devices) in led_lookup()
73 if (strcmp(led->name, name) == 0) in led_lookup()
74 return led; in led_lookup()
90 led_free(struct led_device *led) in led_free() argument
94 kmem_free(led->name, strlen(led->name) + 1); in led_free()
95 kmem_free(led, sizeof(*led)); in led_free()
102 struct led_device *led; in led_sysctl_handler() local
109 led = node.sysctl_data; in led_sysctl_handler()
110 state = led->getstate(led->priv); in led_sysctl_handler()
118 led->setstate(led->priv, state); in led_sysctl_handler()
130 struct led_device *led; in led_attach() local
137 led = kmem_zalloc(sizeof(*led), KM_SLEEP); in led_attach()
138 led->name = kmem_asprintf("%s", name); in led_attach()
139 led->getstate = getstate; in led_attach()
140 led->setstate = setstate; in led_attach()
141 led->priv = priv; in led_attach()
144 led_normalize_name(led->name); in led_attach()
148 led_free(led); in led_attach()
149 led = NULL; in led_attach()
151 error = sysctl_createv(&led->slog, 0, NULL, &node, in led_attach()
156 error = sysctl_createv(&led->slog, 0, &node, NULL, in led_attach()
157 CTLFLAG_READWRITE, CTLTYPE_BOOL, led->name, NULL, in led_attach()
159 (void *)led, 0, in led_attach()
164 led->name, error); in led_attach()
165 led_free(led); in led_attach()
166 led = NULL; in led_attach()
169 if (led != NULL) in led_attach()
170 TAILQ_INSERT_TAIL(&led_devices, led, devices); in led_attach()
173 return led; in led_attach()
179 struct led_device *led = handle; in led_detach() local
183 TAILQ_REMOVE(&led_devices, led, devices); in led_detach()
184 sysctl_teardown(&led->slog); in led_detach()
185 led_free(led); in led_detach()