Linux-PWM Archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: lee@kernel.org, daniel.thompson@linaro.org, jingoohan1@gmail.com,
	deller@gmx.de, andy@kernel.org, robin@protonic.nl,
	javierm@redhat.com
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	linux-input@vger.kernel.org, linux-pwm@vger.kernel.org,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: [PATCH v2 06/10] backlight/pwm-backlight: Remove struct backlight_ops.check_fb
Date: Wed, 21 Feb 2024 10:41:33 +0100	[thread overview]
Message-ID: <20240221094324.27436-7-tzimmermann@suse.de> (raw)
In-Reply-To: <20240221094324.27436-1-tzimmermann@suse.de>

The internal check_fb callback from struct pwm_bl_data is never
implemented. The driver's implementation of check_fb always
returns true, which is the backlight core's default if no
implementation has been set. So remove the code from the driver.

v2:
	* reword commit message

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
---
 drivers/video/backlight/pwm_bl.c | 12 ------------
 include/linux/pwm_backlight.h    |  1 -
 2 files changed, 13 deletions(-)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index ffcebf6aa76a9..61d30bc98eea5 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -11,7 +11,6 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
-#include <linux/fb.h>
 #include <linux/backlight.h>
 #include <linux/err.h>
 #include <linux/pwm.h>
@@ -34,7 +33,6 @@ struct pwm_bl_data {
 					  int brightness);
 	void			(*notify_after)(struct device *,
 					int brightness);
-	int			(*check_fb)(struct device *, struct fb_info *);
 	void			(*exit)(struct device *);
 };
 
@@ -129,17 +127,8 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
 	return 0;
 }
 
-static int pwm_backlight_check_fb(struct backlight_device *bl,
-				  struct fb_info *info)
-{
-	struct pwm_bl_data *pb = bl_get_data(bl);
-
-	return !pb->check_fb || pb->check_fb(pb->dev, info);
-}
-
 static const struct backlight_ops pwm_backlight_ops = {
 	.update_status	= pwm_backlight_update_status,
-	.check_fb	= pwm_backlight_check_fb,
 };
 
 #ifdef CONFIG_OF
@@ -482,7 +471,6 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 
 	pb->notify = data->notify;
 	pb->notify_after = data->notify_after;
-	pb->check_fb = data->check_fb;
 	pb->exit = data->exit;
 	pb->dev = &pdev->dev;
 	pb->enabled = false;
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index cdd2ac366bc72..0bf80e98d5b40 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -19,7 +19,6 @@ struct platform_pwm_backlight_data {
 	int (*notify)(struct device *dev, int brightness);
 	void (*notify_after)(struct device *dev, int brightness);
 	void (*exit)(struct device *dev);
-	int (*check_fb)(struct device *dev, struct fb_info *info);
 };
 
 #endif
-- 
2.43.0


  parent reply	other threads:[~2024-02-21  9:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21  9:41 [PATCH v2 00/10] backlight: Replace struct fb_info in interfaces Thomas Zimmermann
2024-02-21  9:41 ` [PATCH v2 01/10] backlight: Match backlight device against struct fb_info.bl_dev Thomas Zimmermann
2024-02-21 14:34   ` Andy Shevchenko
2024-02-21 15:44     ` Thomas Zimmermann
2024-02-21 16:46       ` Andy Shevchenko
2024-02-23 10:53   ` Lee Jones
2024-02-21  9:41 ` [PATCH v2 02/10] auxdisplay/ht16k33: Remove struct backlight_ops.check_fb Thomas Zimmermann
2024-02-21 14:35   ` Andy Shevchenko
2024-02-21  9:41 ` [PATCH v2 03/10] hid/hid-picolcd: Fix initialization order Thomas Zimmermann
2024-02-21  9:41 ` [PATCH v2 04/10] hid/hid-picolcd: Remove struct backlight_ops.check_fb Thomas Zimmermann
2024-02-21  9:41 ` [PATCH v2 05/10] backlight/aat2870-backlight: Remove struct backlight.check_fb Thomas Zimmermann
2024-02-21  9:41 ` Thomas Zimmermann [this message]
2024-02-21  9:41 ` [PATCH v2 07/10] fbdev/sh_mobile_lcdc_fb: Remove struct backlight_ops.check_fb Thomas Zimmermann
2024-02-21  9:41 ` [PATCH v2 08/10] fbdev/ssd1307fb: Init backlight before registering framebuffer Thomas Zimmermann
2024-02-21  9:41 ` [PATCH v2 09/10] fbdev/ssd1307fb: Remove struct backlight_ops.check_fb Thomas Zimmermann
2024-02-21  9:41 ` [PATCH v2 10/10] backlight: Add controls_device callback to struct backlight_ops Thomas Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240221094324.27436-7-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=andy@kernel.org \
    --cc=daniel.thompson@linaro.org \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=jingoohan1@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=robin@protonic.nl \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).