Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

backlight: Remove notifier

backlight_register_notifier and backlight_unregister_notifier have
been unused since commit 6cb634d0dc85 ("ACPI: video: Remove code to
unregister acpi_video backlight when a native backlight registers")

With those not being called, it means that the backlight_notifier
list is always empty.

Remove the functions, the list itself and the enum used in the
notifications.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch>
Link: https://lore.kernel.org/r/20240919232758.639925-1-linux@treblig.org
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Dr. David Alan Gilbert and committed by
Lee Jones
5461f3fd 1a2dc9bf

-62
-42
drivers/video/backlight/backlight.c
··· 65 65 66 66 static struct list_head backlight_dev_list; 67 67 static struct mutex backlight_dev_list_mutex; 68 - static struct blocking_notifier_head backlight_notifier; 69 68 70 69 static const char *const backlight_types[] = { 71 70 [BACKLIGHT_RAW] = "raw", ··· 466 467 list_add(&new_bd->entry, &backlight_dev_list); 467 468 mutex_unlock(&backlight_dev_list_mutex); 468 469 469 - blocking_notifier_call_chain(&backlight_notifier, 470 - BACKLIGHT_REGISTERED, new_bd); 471 - 472 470 return new_bd; 473 471 } 474 472 EXPORT_SYMBOL(backlight_device_register); ··· 535 539 mutex_unlock(&pmac_backlight_mutex); 536 540 #endif 537 541 538 - blocking_notifier_call_chain(&backlight_notifier, 539 - BACKLIGHT_UNREGISTERED, bd); 540 - 541 542 mutex_lock(&bd->ops_lock); 542 543 bd->ops = NULL; 543 544 mutex_unlock(&bd->ops_lock); ··· 558 565 559 566 return *r == data; 560 567 } 561 - 562 - /** 563 - * backlight_register_notifier - get notified of backlight (un)registration 564 - * @nb: notifier block with the notifier to call on backlight (un)registration 565 - * 566 - * Register a notifier to get notified when backlight devices get registered 567 - * or unregistered. 568 - * 569 - * RETURNS: 570 - * 571 - * 0 on success, otherwise a negative error code 572 - */ 573 - int backlight_register_notifier(struct notifier_block *nb) 574 - { 575 - return blocking_notifier_chain_register(&backlight_notifier, nb); 576 - } 577 - EXPORT_SYMBOL(backlight_register_notifier); 578 - 579 - /** 580 - * backlight_unregister_notifier - unregister a backlight notifier 581 - * @nb: notifier block to unregister 582 - * 583 - * Register a notifier to get notified when backlight devices get registered 584 - * or unregistered. 585 - * 586 - * RETURNS: 587 - * 588 - * 0 on success, otherwise a negative error code 589 - */ 590 - int backlight_unregister_notifier(struct notifier_block *nb) 591 - { 592 - return blocking_notifier_chain_unregister(&backlight_notifier, nb); 593 - } 594 - EXPORT_SYMBOL(backlight_unregister_notifier); 595 568 596 569 /** 597 570 * devm_backlight_device_register - register a new backlight device ··· 726 767 727 768 INIT_LIST_HEAD(&backlight_dev_list); 728 769 mutex_init(&backlight_dev_list_mutex); 729 - BLOCKING_INIT_NOTIFIER_HEAD(&backlight_notifier); 730 770 731 771 return 0; 732 772 }
-20
include/linux/backlight.h
··· 66 66 BACKLIGHT_TYPE_MAX, 67 67 }; 68 68 69 - /** 70 - * enum backlight_notification - the type of notification 71 - * 72 - * The notifications that is used for notification sent to the receiver 73 - * that registered notifications using backlight_register_notifier(). 74 - */ 75 - enum backlight_notification { 76 - /** 77 - * @BACKLIGHT_REGISTERED: The backlight device is registered. 78 - */ 79 - BACKLIGHT_REGISTERED, 80 - 81 - /** 82 - * @BACKLIGHT_UNREGISTERED: The backlight revice is unregistered. 83 - */ 84 - BACKLIGHT_UNREGISTERED, 85 - }; 86 - 87 69 /** enum backlight_scale - the type of scale used for brightness values 88 70 * 89 71 * The type of scale used for brightness values. ··· 403 421 struct backlight_device *bd); 404 422 void backlight_force_update(struct backlight_device *bd, 405 423 enum backlight_update_reason reason); 406 - int backlight_register_notifier(struct notifier_block *nb); 407 - int backlight_unregister_notifier(struct notifier_block *nb); 408 424 struct backlight_device *backlight_device_get_by_name(const char *name); 409 425 struct backlight_device *backlight_device_get_by_type(enum backlight_type type); 410 426 int backlight_device_set_brightness(struct backlight_device *bd,