Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

backlight: pwm-backlight: Remove struct backlight_ops.check_fb

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>
Link: https://lore.kernel.org/r/20240305162425.23845-7-tzimmermann@suse.de
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Thomas Zimmermann and committed by
Lee Jones
397b7493 0133952a

-13
-12
drivers/video/backlight/pwm_bl.c
··· 11 11 #include <linux/kernel.h> 12 12 #include <linux/init.h> 13 13 #include <linux/platform_device.h> 14 - #include <linux/fb.h> 15 14 #include <linux/backlight.h> 16 15 #include <linux/err.h> 17 16 #include <linux/pwm.h> ··· 33 34 int brightness); 34 35 void (*notify_after)(struct device *, 35 36 int brightness); 36 - int (*check_fb)(struct device *, struct fb_info *); 37 37 void (*exit)(struct device *); 38 38 }; 39 39 ··· 127 129 return 0; 128 130 } 129 131 130 - static int pwm_backlight_check_fb(struct backlight_device *bl, 131 - struct fb_info *info) 132 - { 133 - struct pwm_bl_data *pb = bl_get_data(bl); 134 - 135 - return !pb->check_fb || pb->check_fb(pb->dev, info); 136 - } 137 - 138 132 static const struct backlight_ops pwm_backlight_ops = { 139 133 .update_status = pwm_backlight_update_status, 140 - .check_fb = pwm_backlight_check_fb, 141 134 }; 142 135 143 136 #ifdef CONFIG_OF ··· 471 482 472 483 pb->notify = data->notify; 473 484 pb->notify_after = data->notify_after; 474 - pb->check_fb = data->check_fb; 475 485 pb->exit = data->exit; 476 486 pb->dev = &pdev->dev; 477 487 pb->enabled = false;
-1
include/linux/pwm_backlight.h
··· 19 19 int (*notify)(struct device *dev, int brightness); 20 20 void (*notify_after)(struct device *dev, int brightness); 21 21 void (*exit)(struct device *dev); 22 - int (*check_fb)(struct device *dev, struct fb_info *info); 23 22 }; 24 23 25 24 #endif