mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-16 12:10:38 -04:00
backlight: Remove notifier
backlight_register_notifier and backlight_unregister_notifier have
been unused since commit 6cb634d0dc ("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>
This commit is contained in:
committed by
Lee Jones
parent
1a2dc9bf3b
commit
5461f3fd74
@@ -65,7 +65,6 @@
|
|||||||
|
|
||||||
static struct list_head backlight_dev_list;
|
static struct list_head backlight_dev_list;
|
||||||
static struct mutex backlight_dev_list_mutex;
|
static struct mutex backlight_dev_list_mutex;
|
||||||
static struct blocking_notifier_head backlight_notifier;
|
|
||||||
|
|
||||||
static const char *const backlight_types[] = {
|
static const char *const backlight_types[] = {
|
||||||
[BACKLIGHT_RAW] = "raw",
|
[BACKLIGHT_RAW] = "raw",
|
||||||
@@ -467,9 +466,6 @@ struct backlight_device *backlight_device_register(const char *name,
|
|||||||
list_add(&new_bd->entry, &backlight_dev_list);
|
list_add(&new_bd->entry, &backlight_dev_list);
|
||||||
mutex_unlock(&backlight_dev_list_mutex);
|
mutex_unlock(&backlight_dev_list_mutex);
|
||||||
|
|
||||||
blocking_notifier_call_chain(&backlight_notifier,
|
|
||||||
BACKLIGHT_REGISTERED, new_bd);
|
|
||||||
|
|
||||||
return new_bd;
|
return new_bd;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(backlight_device_register);
|
EXPORT_SYMBOL(backlight_device_register);
|
||||||
@@ -539,9 +535,6 @@ void backlight_device_unregister(struct backlight_device *bd)
|
|||||||
mutex_unlock(&pmac_backlight_mutex);
|
mutex_unlock(&pmac_backlight_mutex);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
blocking_notifier_call_chain(&backlight_notifier,
|
|
||||||
BACKLIGHT_UNREGISTERED, bd);
|
|
||||||
|
|
||||||
mutex_lock(&bd->ops_lock);
|
mutex_lock(&bd->ops_lock);
|
||||||
bd->ops = NULL;
|
bd->ops = NULL;
|
||||||
mutex_unlock(&bd->ops_lock);
|
mutex_unlock(&bd->ops_lock);
|
||||||
@@ -566,40 +559,6 @@ static int devm_backlight_device_match(struct device *dev, void *res,
|
|||||||
return *r == data;
|
return *r == data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* backlight_register_notifier - get notified of backlight (un)registration
|
|
||||||
* @nb: notifier block with the notifier to call on backlight (un)registration
|
|
||||||
*
|
|
||||||
* Register a notifier to get notified when backlight devices get registered
|
|
||||||
* or unregistered.
|
|
||||||
*
|
|
||||||
* RETURNS:
|
|
||||||
*
|
|
||||||
* 0 on success, otherwise a negative error code
|
|
||||||
*/
|
|
||||||
int backlight_register_notifier(struct notifier_block *nb)
|
|
||||||
{
|
|
||||||
return blocking_notifier_chain_register(&backlight_notifier, nb);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(backlight_register_notifier);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* backlight_unregister_notifier - unregister a backlight notifier
|
|
||||||
* @nb: notifier block to unregister
|
|
||||||
*
|
|
||||||
* Register a notifier to get notified when backlight devices get registered
|
|
||||||
* or unregistered.
|
|
||||||
*
|
|
||||||
* RETURNS:
|
|
||||||
*
|
|
||||||
* 0 on success, otherwise a negative error code
|
|
||||||
*/
|
|
||||||
int backlight_unregister_notifier(struct notifier_block *nb)
|
|
||||||
{
|
|
||||||
return blocking_notifier_chain_unregister(&backlight_notifier, nb);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(backlight_unregister_notifier);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* devm_backlight_device_register - register a new backlight device
|
* devm_backlight_device_register - register a new backlight device
|
||||||
* @dev: the device to register
|
* @dev: the device to register
|
||||||
@@ -767,7 +726,6 @@ static int __init backlight_class_init(void)
|
|||||||
|
|
||||||
INIT_LIST_HEAD(&backlight_dev_list);
|
INIT_LIST_HEAD(&backlight_dev_list);
|
||||||
mutex_init(&backlight_dev_list_mutex);
|
mutex_init(&backlight_dev_list_mutex);
|
||||||
BLOCKING_INIT_NOTIFIER_HEAD(&backlight_notifier);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,24 +66,6 @@ enum backlight_type {
|
|||||||
BACKLIGHT_TYPE_MAX,
|
BACKLIGHT_TYPE_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* enum backlight_notification - the type of notification
|
|
||||||
*
|
|
||||||
* The notifications that is used for notification sent to the receiver
|
|
||||||
* that registered notifications using backlight_register_notifier().
|
|
||||||
*/
|
|
||||||
enum backlight_notification {
|
|
||||||
/**
|
|
||||||
* @BACKLIGHT_REGISTERED: The backlight device is registered.
|
|
||||||
*/
|
|
||||||
BACKLIGHT_REGISTERED,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @BACKLIGHT_UNREGISTERED: The backlight revice is unregistered.
|
|
||||||
*/
|
|
||||||
BACKLIGHT_UNREGISTERED,
|
|
||||||
};
|
|
||||||
|
|
||||||
/** enum backlight_scale - the type of scale used for brightness values
|
/** enum backlight_scale - the type of scale used for brightness values
|
||||||
*
|
*
|
||||||
* The type of scale used for brightness values.
|
* The type of scale used for brightness values.
|
||||||
@@ -421,8 +403,6 @@ void devm_backlight_device_unregister(struct device *dev,
|
|||||||
struct backlight_device *bd);
|
struct backlight_device *bd);
|
||||||
void backlight_force_update(struct backlight_device *bd,
|
void backlight_force_update(struct backlight_device *bd,
|
||||||
enum backlight_update_reason reason);
|
enum backlight_update_reason reason);
|
||||||
int backlight_register_notifier(struct notifier_block *nb);
|
|
||||||
int backlight_unregister_notifier(struct notifier_block *nb);
|
|
||||||
struct backlight_device *backlight_device_get_by_name(const char *name);
|
struct backlight_device *backlight_device_get_by_name(const char *name);
|
||||||
struct backlight_device *backlight_device_get_by_type(enum backlight_type type);
|
struct backlight_device *backlight_device_get_by_type(enum backlight_type type);
|
||||||
int backlight_device_set_brightness(struct backlight_device *bd,
|
int backlight_device_set_brightness(struct backlight_device *bd,
|
||||||
|
|||||||
Reference in New Issue
Block a user