* [PATCH] backlight: Remove notifier
@ 2024-09-19 23:27 linux
2024-09-24 11:21 ` Simona Vetter
2024-10-09 14:43 ` (subset) " Lee Jones
0 siblings, 2 replies; 5+ messages in thread
From: linux @ 2024-09-19 23:27 UTC (permalink / raw)
To: lee, daniel.thompson, jingoohan1, hdegoede
Cc: dri-devel, linux-fbdev, linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
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>
---
drivers/video/backlight/backlight.c | 42 -----------------------------
include/linux/backlight.h | 20 --------------
2 files changed, 62 deletions(-)
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index a82934694d05..f699e5827ccb 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -65,7 +65,6 @@
static struct list_head backlight_dev_list;
static struct mutex backlight_dev_list_mutex;
-static struct blocking_notifier_head backlight_notifier;
static const char *const backlight_types[] = {
[BACKLIGHT_RAW] = "raw",
@@ -467,9 +466,6 @@ struct backlight_device *backlight_device_register(const char *name,
list_add(&new_bd->entry, &backlight_dev_list);
mutex_unlock(&backlight_dev_list_mutex);
- blocking_notifier_call_chain(&backlight_notifier,
- BACKLIGHT_REGISTERED, new_bd);
-
return new_bd;
}
EXPORT_SYMBOL(backlight_device_register);
@@ -539,9 +535,6 @@ void backlight_device_unregister(struct backlight_device *bd)
mutex_unlock(&pmac_backlight_mutex);
#endif
- blocking_notifier_call_chain(&backlight_notifier,
- BACKLIGHT_UNREGISTERED, bd);
-
mutex_lock(&bd->ops_lock);
bd->ops = NULL;
mutex_unlock(&bd->ops_lock);
@@ -566,40 +559,6 @@ static int devm_backlight_device_match(struct device *dev, void *res,
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
* @dev: the device to register
@@ -767,7 +726,6 @@ static int __init backlight_class_init(void)
INIT_LIST_HEAD(&backlight_dev_list);
mutex_init(&backlight_dev_list_mutex);
- BLOCKING_INIT_NOTIFIER_HEAD(&backlight_notifier);
return 0;
}
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index ea9c1bc8148e..f5652e5a9060 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -66,24 +66,6 @@ enum backlight_type {
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
*
* The type of scale used for brightness values.
@@ -421,8 +403,6 @@ void devm_backlight_device_unregister(struct device *dev,
struct backlight_device *bd);
void backlight_force_update(struct backlight_device *bd,
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_type(enum backlight_type type);
int backlight_device_set_brightness(struct backlight_device *bd,
--
2.46.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] backlight: Remove notifier
2024-09-19 23:27 [PATCH] backlight: Remove notifier linux
@ 2024-09-24 11:21 ` Simona Vetter
2024-10-09 10:22 ` Lee Jones
2024-10-09 14:43 ` (subset) " Lee Jones
1 sibling, 1 reply; 5+ messages in thread
From: Simona Vetter @ 2024-09-24 11:21 UTC (permalink / raw)
To: linux
Cc: lee, daniel.thompson, jingoohan1, hdegoede, dri-devel,
linux-fbdev, linux-kernel
On Fri, Sep 20, 2024 at 12:27:58AM +0100, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> 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: Simona Vetter <simona.vetter@ffwll.ch>
I think Lee Jones or Daniel Thompson will pick this up.
-Sima
> ---
> drivers/video/backlight/backlight.c | 42 -----------------------------
> include/linux/backlight.h | 20 --------------
> 2 files changed, 62 deletions(-)
>
> diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
> index a82934694d05..f699e5827ccb 100644
> --- a/drivers/video/backlight/backlight.c
> +++ b/drivers/video/backlight/backlight.c
> @@ -65,7 +65,6 @@
>
> static struct list_head backlight_dev_list;
> static struct mutex backlight_dev_list_mutex;
> -static struct blocking_notifier_head backlight_notifier;
>
> static const char *const backlight_types[] = {
> [BACKLIGHT_RAW] = "raw",
> @@ -467,9 +466,6 @@ struct backlight_device *backlight_device_register(const char *name,
> list_add(&new_bd->entry, &backlight_dev_list);
> mutex_unlock(&backlight_dev_list_mutex);
>
> - blocking_notifier_call_chain(&backlight_notifier,
> - BACKLIGHT_REGISTERED, new_bd);
> -
> return new_bd;
> }
> EXPORT_SYMBOL(backlight_device_register);
> @@ -539,9 +535,6 @@ void backlight_device_unregister(struct backlight_device *bd)
> mutex_unlock(&pmac_backlight_mutex);
> #endif
>
> - blocking_notifier_call_chain(&backlight_notifier,
> - BACKLIGHT_UNREGISTERED, bd);
> -
> mutex_lock(&bd->ops_lock);
> bd->ops = NULL;
> mutex_unlock(&bd->ops_lock);
> @@ -566,40 +559,6 @@ static int devm_backlight_device_match(struct device *dev, void *res,
> 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
> * @dev: the device to register
> @@ -767,7 +726,6 @@ static int __init backlight_class_init(void)
>
> INIT_LIST_HEAD(&backlight_dev_list);
> mutex_init(&backlight_dev_list_mutex);
> - BLOCKING_INIT_NOTIFIER_HEAD(&backlight_notifier);
>
> return 0;
> }
> diff --git a/include/linux/backlight.h b/include/linux/backlight.h
> index ea9c1bc8148e..f5652e5a9060 100644
> --- a/include/linux/backlight.h
> +++ b/include/linux/backlight.h
> @@ -66,24 +66,6 @@ enum backlight_type {
> 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
> *
> * The type of scale used for brightness values.
> @@ -421,8 +403,6 @@ void devm_backlight_device_unregister(struct device *dev,
> struct backlight_device *bd);
> void backlight_force_update(struct backlight_device *bd,
> 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_type(enum backlight_type type);
> int backlight_device_set_brightness(struct backlight_device *bd,
> --
> 2.46.1
>
--
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] backlight: Remove notifier
2024-09-24 11:21 ` Simona Vetter
@ 2024-10-09 10:22 ` Lee Jones
2024-10-09 13:47 ` Daniel Thompson
0 siblings, 1 reply; 5+ messages in thread
From: Lee Jones @ 2024-10-09 10:22 UTC (permalink / raw)
To: linux, daniel.thompson, jingoohan1, hdegoede, dri-devel,
linux-fbdev, linux-kernel
On Tue, 24 Sep 2024, Simona Vetter wrote:
> On Fri, Sep 20, 2024 at 12:27:58AM +0100, linux@treblig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >
> > 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: Simona Vetter <simona.vetter@ffwll.ch>
>
> I think Lee Jones or Daniel Thompson will pick this up.
I will pick this up with Daniel's review.
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] backlight: Remove notifier
2024-10-09 10:22 ` Lee Jones
@ 2024-10-09 13:47 ` Daniel Thompson
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Thompson @ 2024-10-09 13:47 UTC (permalink / raw)
To: Lee Jones
Cc: linux, jingoohan1, hdegoede, dri-devel, linux-fbdev, linux-kernel
On Wed, Oct 09, 2024 at 11:22:30AM +0100, Lee Jones wrote:
> On Tue, 24 Sep 2024, Simona Vetter wrote:
>
> > On Fri, Sep 20, 2024 at 12:27:58AM +0100, linux@treblig.org wrote:
> > > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> > >
> > > 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: Simona Vetter <simona.vetter@ffwll.ch>
> >
> > I think Lee Jones or Daniel Thompson will pick this up.
>
> I will pick this up with Daniel's review.
Thanks for the patch... sorry for the delay. I just bumped this up my
TODO list a little ;-)
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Daniel.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: (subset) [PATCH] backlight: Remove notifier
2024-09-19 23:27 [PATCH] backlight: Remove notifier linux
2024-09-24 11:21 ` Simona Vetter
@ 2024-10-09 14:43 ` Lee Jones
1 sibling, 0 replies; 5+ messages in thread
From: Lee Jones @ 2024-10-09 14:43 UTC (permalink / raw)
To: lee, daniel.thompson, jingoohan1, hdegoede, linux
Cc: dri-devel, linux-fbdev, linux-kernel
On Fri, 20 Sep 2024 00:27:58 +0100, linux@treblig.org wrote:
> 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.
>
> [...]
Applied, thanks!
[1/1] backlight: Remove notifier
commit: 5461f3fd74a89757f95f351eb0bc26aafc2a2e91
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-10-09 14:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-19 23:27 [PATCH] backlight: Remove notifier linux
2024-09-24 11:21 ` Simona Vetter
2024-10-09 10:22 ` Lee Jones
2024-10-09 13:47 ` Daniel Thompson
2024-10-09 14:43 ` (subset) " Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).