RE: [PATCH 02/30] backlight/gpio_backlight: Compare against struct fb_info.device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>-----Original Message-----
>From: dri-devel <dri-devel-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of
>Thomas Zimmermann
>Sent: Monday, June 5, 2023 10:48 AM
>To: daniel@xxxxxxxx; javierm@xxxxxxxxxx; sam@xxxxxxxxxxxx;
>deller@xxxxxx; geert+renesas@xxxxxxxxx; lee@xxxxxxxxxx;
>daniel.thompson@xxxxxxxxxx; jingoohan1@xxxxxxxxx
>Cc: linux-fbdev@xxxxxxxxxxxxxxx; Rich Felker <dalias@xxxxxxxx>; linux-
>sh@xxxxxxxxxxxxxxx; linux-staging@xxxxxxxxxxxxxxx; dri-
>devel@xxxxxxxxxxxxxxxxxxxxx; Thomas Zimmermann
><tzimmermann@xxxxxxx>; John Paul Adrian Glaubitz <glaubitz@xxxxxxxxx-
>berlin.de>; linux-omap@xxxxxxxxxxxxxxx
>Subject: [PATCH 02/30] backlight/gpio_backlight: Compare against struct
>fb_info.device
>
>Struct gpio_backlight_platform_data refers to a platform device within
>the Linux device hierarchy. The test in gpio_backlight_check_fb()
>compares it against the fbdev device in struct fb_info.dev, which
>is different. Fix the test by comparing to struct fb_info.device.
>
>Fixes a bug in the backlight driver and prepares fbdev for making
>struct fb_info.dev optional.

I only see a rename from fbdev  to dev...

Is there missing code?

Would  a fixes: be useful?

M

>Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx>
>Cc: Rich Felker <dalias@xxxxxxxx>
>Cc: John Paul Adrian Glaubitz <glaubitz@xxxxxxxxxxxxxxxxxxx>
>Cc: Lee Jones <lee@xxxxxxxxxx>
>Cc: Daniel Thompson <daniel.thompson@xxxxxxxxxx>
>Cc: Jingoo Han <jingoohan1@xxxxxxxxx>
>Cc: linux-sh@xxxxxxxxxxxxxxx
>---
> arch/sh/boards/mach-ecovec24/setup.c         | 2 +-
> drivers/video/backlight/gpio_backlight.c     | 6 +++---
> include/linux/platform_data/gpio_backlight.h | 2 +-
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
>diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-
>ecovec24/setup.c
>index 674da7ebd8b7..310513646c9b 100644
>--- a/arch/sh/boards/mach-ecovec24/setup.c
>+++ b/arch/sh/boards/mach-ecovec24/setup.c
>@@ -386,7 +386,7 @@ static struct property_entry gpio_backlight_props[] = {
> };
>
> static struct gpio_backlight_platform_data gpio_backlight_data = {
>-	.fbdev = &lcdc_device.dev,
>+	.dev = &lcdc_device.dev,
> };
>
> static const struct platform_device_info gpio_backlight_device_info = {
>diff --git a/drivers/video/backlight/gpio_backlight.c
>b/drivers/video/backlight/gpio_backlight.c
>index 6f78d928f054..d3bea42407f1 100644
>--- a/drivers/video/backlight/gpio_backlight.c
>+++ b/drivers/video/backlight/gpio_backlight.c
>@@ -17,7 +17,7 @@
> #include <linux/slab.h>
>
> struct gpio_backlight {
>-	struct device *fbdev;
>+	struct device *dev;
> 	struct gpio_desc *gpiod;
> };
>
>@@ -35,7 +35,7 @@ static int gpio_backlight_check_fb(struct
>backlight_device *bl,
> {
> 	struct gpio_backlight *gbl = bl_get_data(bl);
>
>-	return gbl->fbdev == NULL || gbl->fbdev == info->dev;
>+	return !gbl->dev || gbl->dev == info->device;
> }
>
> static const struct backlight_ops gpio_backlight_ops = {
>@@ -59,7 +59,7 @@ static int gpio_backlight_probe(struct platform_device
>*pdev)
> 		return -ENOMEM;
>
> 	if (pdata)
>-		gbl->fbdev = pdata->fbdev;
>+		gbl->dev = pdata->dev;
>
> 	def_value = device_property_read_bool(dev, "default-on");
>
>diff --git a/include/linux/platform_data/gpio_backlight.h
>b/include/linux/platform_data/gpio_backlight.h
>index 1a8b5b1946fe..323fbf5f7613 100644
>--- a/include/linux/platform_data/gpio_backlight.h
>+++ b/include/linux/platform_data/gpio_backlight.h
>@@ -8,7 +8,7 @@
> struct device;
>
> struct gpio_backlight_platform_data {
>-	struct device *fbdev;
>+	struct device *dev;
> };
>
> #endif
>--
>2.40.1






[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux