• Home
  • Raw
  • Download

Lines Matching refs:handler

321 	struct sys_off_handler *handler;  in sys_off_notify()  local
324 handler = container_of(nb, struct sys_off_handler, nb); in sys_off_notify()
325 data.cb_data = handler->cb_data; in sys_off_notify()
329 return handler->sys_off_cb(&data); in sys_off_notify()
336 struct sys_off_handler *handler; in alloc_sys_off_handler() local
344 handler = &platform_sys_off_handler; in alloc_sys_off_handler()
345 if (handler->cb_data) in alloc_sys_off_handler()
353 handler = kzalloc(sizeof(*handler), flags); in alloc_sys_off_handler()
354 if (!handler) in alloc_sys_off_handler()
358 return handler; in alloc_sys_off_handler()
361 static void free_sys_off_handler(struct sys_off_handler *handler) in free_sys_off_handler() argument
363 if (handler == &platform_sys_off_handler) in free_sys_off_handler()
364 memset(handler, 0, sizeof(*handler)); in free_sys_off_handler()
366 kfree(handler); in free_sys_off_handler()
396 struct sys_off_handler *handler; in register_sys_off_handler() local
399 handler = alloc_sys_off_handler(priority); in register_sys_off_handler()
400 if (IS_ERR(handler)) in register_sys_off_handler()
401 return handler; in register_sys_off_handler()
405 handler->list = &power_off_prep_handler_list; in register_sys_off_handler()
406 handler->blocking = true; in register_sys_off_handler()
410 handler->list = &power_off_handler_list; in register_sys_off_handler()
414 handler->list = &restart_prep_handler_list; in register_sys_off_handler()
415 handler->blocking = true; in register_sys_off_handler()
419 handler->list = &restart_handler_list; in register_sys_off_handler()
423 free_sys_off_handler(handler); in register_sys_off_handler()
427 handler->nb.notifier_call = sys_off_notify; in register_sys_off_handler()
428 handler->nb.priority = priority; in register_sys_off_handler()
429 handler->sys_off_cb = callback; in register_sys_off_handler()
430 handler->cb_data = cb_data; in register_sys_off_handler()
431 handler->mode = mode; in register_sys_off_handler()
433 if (handler->blocking) { in register_sys_off_handler()
435 err = blocking_notifier_chain_register(handler->list, in register_sys_off_handler()
436 &handler->nb); in register_sys_off_handler()
438 err = blocking_notifier_chain_register_unique_prio(handler->list, in register_sys_off_handler()
439 &handler->nb); in register_sys_off_handler()
442 err = atomic_notifier_chain_register(handler->list, in register_sys_off_handler()
443 &handler->nb); in register_sys_off_handler()
445 err = atomic_notifier_chain_register_unique_prio(handler->list, in register_sys_off_handler()
446 &handler->nb); in register_sys_off_handler()
450 free_sys_off_handler(handler); in register_sys_off_handler()
454 return handler; in register_sys_off_handler()
464 void unregister_sys_off_handler(struct sys_off_handler *handler) in unregister_sys_off_handler() argument
468 if (IS_ERR_OR_NULL(handler)) in unregister_sys_off_handler()
471 if (handler->blocking) in unregister_sys_off_handler()
472 err = blocking_notifier_chain_unregister(handler->list, in unregister_sys_off_handler()
473 &handler->nb); in unregister_sys_off_handler()
475 err = atomic_notifier_chain_unregister(handler->list, in unregister_sys_off_handler()
476 &handler->nb); in unregister_sys_off_handler()
481 free_sys_off_handler(handler); in unregister_sys_off_handler()
487 struct sys_off_handler *handler = data; in devm_unregister_sys_off_handler() local
489 unregister_sys_off_handler(handler); in devm_unregister_sys_off_handler()
510 struct sys_off_handler *handler; in devm_register_sys_off_handler() local
512 handler = register_sys_off_handler(mode, priority, callback, cb_data); in devm_register_sys_off_handler()
513 if (IS_ERR(handler)) in devm_register_sys_off_handler()
514 return PTR_ERR(handler); in devm_register_sys_off_handler()
517 handler); in devm_register_sys_off_handler()
589 struct sys_off_handler *handler; in register_platform_power_off() local
591 handler = register_sys_off_handler(SYS_OFF_MODE_POWER_OFF, in register_platform_power_off()
595 if (IS_ERR(handler)) in register_platform_power_off()
596 return PTR_ERR(handler); in register_platform_power_off()
598 platform_power_off_handler = handler; in register_platform_power_off()