Lines Matching defs:sub_driver

48 	int (*init)(struct generic_sub_driver *sub_driver);
49 void (*notify)(struct generic_sub_driver *sub_driver, u32 event);
150 struct generic_sub_driver *sub_driver = data;
152 if (!sub_driver || !sub_driver->notify)
154 sub_driver->notify(sub_driver, event);
157 static int __init setup_acpi_notify(struct generic_sub_driver *sub_driver)
161 if (!*sub_driver->handle)
164 sub_driver->device = acpi_fetch_acpi_dev(*sub_driver->handle);
165 if (!sub_driver->device) {
166 pr_err("acpi_fetch_acpi_dev(%s) failed\n", sub_driver->name);
170 sub_driver->device->driver_data = sub_driver;
171 sprintf(acpi_device_class(sub_driver->device), "%s/%s",
172 ACPI_LAPTOP_ACPI_EVENT_PREFIX, sub_driver->name);
174 status = acpi_install_notify_handler(*sub_driver->handle,
175 sub_driver->type, dispatch_acpi_notify, sub_driver);
179 "handling %s events\n", sub_driver->name);
182 sub_driver->name, acpi_format_exception(status));
186 sub_driver->acpi_notify_installed = 1;
437 static int __init event_init(struct generic_sub_driver *sub_driver)
470 static void event_notify(struct generic_sub_driver *sub_driver, u32 event)
493 static void generic_subdriver_exit(struct generic_sub_driver *sub_driver);
495 static int __init generic_subdriver_init(struct generic_sub_driver *sub_driver)
499 if (!sub_driver || !sub_driver->driver)
502 ret = platform_driver_register(sub_driver->driver);
506 if (sub_driver->init) {
507 ret = sub_driver->init(sub_driver);
512 if (sub_driver->notify) {
513 ret = setup_acpi_notify(sub_driver);
525 generic_subdriver_exit(sub_driver);
529 static void generic_subdriver_exit(struct generic_sub_driver *sub_driver)
532 if (sub_driver->acpi_notify_installed) {
533 acpi_remove_notify_handler(*sub_driver->handle,
534 sub_driver->type, dispatch_acpi_notify);
535 sub_driver->acpi_notify_installed = 0;
537 platform_driver_unregister(sub_driver->driver);