usbport_data 40 drivers/usb/core/ledtrig-usbport.c static bool usbport_trig_usb_dev_observed(struct usbport_trig_data *usbport_data, usbport_data 48 drivers/usb/core/ledtrig-usbport.c list_for_each_entry(port, &usbport_data->ports, list) { usbport_data 59 drivers/usb/core/ledtrig-usbport.c struct usbport_trig_data *usbport_data = data; usbport_data 61 drivers/usb/core/ledtrig-usbport.c if (usbport_trig_usb_dev_observed(usbport_data, usb_dev)) usbport_data 62 drivers/usb/core/ledtrig-usbport.c usbport_data->count++; usbport_data 70 drivers/usb/core/ledtrig-usbport.c static void usbport_trig_update_count(struct usbport_trig_data *usbport_data) usbport_data 72 drivers/usb/core/ledtrig-usbport.c struct led_classdev *led_cdev = usbport_data->led_cdev; usbport_data 74 drivers/usb/core/ledtrig-usbport.c usbport_data->count = 0; usbport_data 75 drivers/usb/core/ledtrig-usbport.c usb_for_each_dev(usbport_data, usbport_trig_usb_dev_check); usbport_data 76 drivers/usb/core/ledtrig-usbport.c led_set_brightness(led_cdev, usbport_data->count ? LED_FULL : LED_OFF); usbport_data 129 drivers/usb/core/ledtrig-usbport.c static bool usbport_trig_port_observed(struct usbport_trig_data *usbport_data, usbport_data 132 drivers/usb/core/ledtrig-usbport.c struct device *dev = usbport_data->led_cdev->dev; usbport_data 183 drivers/usb/core/ledtrig-usbport.c static int usbport_trig_add_port(struct usbport_trig_data *usbport_data, usbport_data 187 drivers/usb/core/ledtrig-usbport.c struct led_classdev *led_cdev = usbport_data->led_cdev; usbport_data 198 drivers/usb/core/ledtrig-usbport.c port->data = usbport_data; usbport_data 201 drivers/usb/core/ledtrig-usbport.c port->observed = usbport_trig_port_observed(usbport_data, usb_dev, usbport_data 223 drivers/usb/core/ledtrig-usbport.c list_add_tail(&port->list, &usbport_data->ports); usbport_data 238 drivers/usb/core/ledtrig-usbport.c struct usbport_trig_data *usbport_data = data; usbport_data 242 drivers/usb/core/ledtrig-usbport.c usbport_trig_add_port(usbport_data, usb_dev, usbport_data 248 drivers/usb/core/ledtrig-usbport.c static void usbport_trig_remove_port(struct usbport_trig_data *usbport_data, usbport_data 251 drivers/usb/core/ledtrig-usbport.c struct led_classdev *led_cdev = usbport_data->led_cdev; usbport_data 260 drivers/usb/core/ledtrig-usbport.c static void usbport_trig_remove_usb_dev_ports(struct usbport_trig_data *usbport_data, usbport_data 265 drivers/usb/core/ledtrig-usbport.c list_for_each_entry_safe(port, tmp, &usbport_data->ports, list) { usbport_data 267 drivers/usb/core/ledtrig-usbport.c usbport_trig_remove_port(usbport_data, port); usbport_data 278 drivers/usb/core/ledtrig-usbport.c struct usbport_trig_data *usbport_data = usbport_data 280 drivers/usb/core/ledtrig-usbport.c struct led_classdev *led_cdev = usbport_data->led_cdev; usbport_data 284 drivers/usb/core/ledtrig-usbport.c observed = usbport_trig_usb_dev_observed(usbport_data, usb_dev); usbport_data 288 drivers/usb/core/ledtrig-usbport.c usbport_trig_add_usb_dev_ports(usb_dev, usbport_data); usbport_data 289 drivers/usb/core/ledtrig-usbport.c if (observed && usbport_data->count++ == 0) usbport_data 293 drivers/usb/core/ledtrig-usbport.c usbport_trig_remove_usb_dev_ports(usbport_data, usb_dev); usbport_data 294 drivers/usb/core/ledtrig-usbport.c if (observed && --usbport_data->count == 0) usbport_data 304 drivers/usb/core/ledtrig-usbport.c struct usbport_trig_data *usbport_data; usbport_data 307 drivers/usb/core/ledtrig-usbport.c usbport_data = kzalloc(sizeof(*usbport_data), GFP_KERNEL); usbport_data 308 drivers/usb/core/ledtrig-usbport.c if (!usbport_data) usbport_data 310 drivers/usb/core/ledtrig-usbport.c usbport_data->led_cdev = led_cdev; usbport_data 313 drivers/usb/core/ledtrig-usbport.c INIT_LIST_HEAD(&usbport_data->ports); usbport_data 317 drivers/usb/core/ledtrig-usbport.c usb_for_each_dev(usbport_data, usbport_trig_add_usb_dev_ports); usbport_data 318 drivers/usb/core/ledtrig-usbport.c usbport_trig_update_count(usbport_data); usbport_data 321 drivers/usb/core/ledtrig-usbport.c usbport_data->nb.notifier_call = usbport_trig_notify; usbport_data 322 drivers/usb/core/ledtrig-usbport.c led_set_trigger_data(led_cdev, usbport_data); usbport_data 323 drivers/usb/core/ledtrig-usbport.c usb_register_notify(&usbport_data->nb); usbport_data 327 drivers/usb/core/ledtrig-usbport.c kfree(usbport_data); usbport_data 333 drivers/usb/core/ledtrig-usbport.c struct usbport_trig_data *usbport_data = led_get_trigger_data(led_cdev); usbport_data 336 drivers/usb/core/ledtrig-usbport.c list_for_each_entry_safe(port, tmp, &usbport_data->ports, list) { usbport_data 337 drivers/usb/core/ledtrig-usbport.c usbport_trig_remove_port(usbport_data, port); usbport_data 342 drivers/usb/core/ledtrig-usbport.c usb_unregister_notify(&usbport_data->nb); usbport_data 344 drivers/usb/core/ledtrig-usbport.c kfree(usbport_data);