Skip to content

Commit 5461f3f

Browse files
Dr. David Alan Gilbertlag-linaro
authored andcommitted
backlight: Remove notifier
backlight_register_notifier and backlight_unregister_notifier have been unused since commit 6cb634d ("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>
1 parent 1a2dc9b commit 5461f3f

File tree

2 files changed

+0
-62
lines changed

2 files changed

+0
-62
lines changed

drivers/video/backlight/backlight.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565

6666
static struct list_head backlight_dev_list;
6767
static struct mutex backlight_dev_list_mutex;
68-
static struct blocking_notifier_head backlight_notifier;
6968

7069
static const char *const backlight_types[] = {
7170
[BACKLIGHT_RAW] = "raw",
@@ -467,9 +466,6 @@ struct backlight_device *backlight_device_register(const char *name,
467466
list_add(&new_bd->entry, &backlight_dev_list);
468467
mutex_unlock(&backlight_dev_list_mutex);
469468

470-
blocking_notifier_call_chain(&backlight_notifier,
471-
BACKLIGHT_REGISTERED, new_bd);
472-
473469
return new_bd;
474470
}
475471
EXPORT_SYMBOL(backlight_device_register);
@@ -539,9 +535,6 @@ void backlight_device_unregister(struct backlight_device *bd)
539535
mutex_unlock(&pmac_backlight_mutex);
540536
#endif
541537

542-
blocking_notifier_call_chain(&backlight_notifier,
543-
BACKLIGHT_UNREGISTERED, bd);
544-
545538
mutex_lock(&bd->ops_lock);
546539
bd->ops = NULL;
547540
mutex_unlock(&bd->ops_lock);
@@ -566,40 +559,6 @@ static int devm_backlight_device_match(struct device *dev, void *res,
566559
return *r == data;
567560
}
568561

569-
/**
570-
* backlight_register_notifier - get notified of backlight (un)registration
571-
* @nb: notifier block with the notifier to call on backlight (un)registration
572-
*
573-
* Register a notifier to get notified when backlight devices get registered
574-
* or unregistered.
575-
*
576-
* RETURNS:
577-
*
578-
* 0 on success, otherwise a negative error code
579-
*/
580-
int backlight_register_notifier(struct notifier_block *nb)
581-
{
582-
return blocking_notifier_chain_register(&backlight_notifier, nb);
583-
}
584-
EXPORT_SYMBOL(backlight_register_notifier);
585-
586-
/**
587-
* backlight_unregister_notifier - unregister a backlight notifier
588-
* @nb: notifier block to unregister
589-
*
590-
* Register a notifier to get notified when backlight devices get registered
591-
* or unregistered.
592-
*
593-
* RETURNS:
594-
*
595-
* 0 on success, otherwise a negative error code
596-
*/
597-
int backlight_unregister_notifier(struct notifier_block *nb)
598-
{
599-
return blocking_notifier_chain_unregister(&backlight_notifier, nb);
600-
}
601-
EXPORT_SYMBOL(backlight_unregister_notifier);
602-
603562
/**
604563
* devm_backlight_device_register - register a new backlight device
605564
* @dev: the device to register
@@ -767,7 +726,6 @@ static int __init backlight_class_init(void)
767726

768727
INIT_LIST_HEAD(&backlight_dev_list);
769728
mutex_init(&backlight_dev_list_mutex);
770-
BLOCKING_INIT_NOTIFIER_HEAD(&backlight_notifier);
771729

772730
return 0;
773731
}

include/linux/backlight.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,6 @@ enum backlight_type {
6666
BACKLIGHT_TYPE_MAX,
6767
};
6868

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-
8769
/** enum backlight_scale - the type of scale used for brightness values
8870
*
8971
* The type of scale used for brightness values.
@@ -421,8 +403,6 @@ void devm_backlight_device_unregister(struct device *dev,
421403
struct backlight_device *bd);
422404
void backlight_force_update(struct backlight_device *bd,
423405
enum backlight_update_reason reason);
424-
int backlight_register_notifier(struct notifier_block *nb);
425-
int backlight_unregister_notifier(struct notifier_block *nb);
426406
struct backlight_device *backlight_device_get_by_name(const char *name);
427407
struct backlight_device *backlight_device_get_by_type(enum backlight_type type);
428408
int backlight_device_set_brightness(struct backlight_device *bd,

0 commit comments

Comments
 (0)