Skip to content

Commit c34b107

Browse files
Thomas Zimmermannlag-linaro
authored andcommitted
hid: hid-picolcd: Remove struct backlight_ops.check_fb
Update the driver to initialize struct fb_info.bl_dev to its backlight device, if any. Thus rely on the backlight core code to match backlight and framebuffer devices, and remove the extra check_fb function from struct backlight_ops. v2: * protect against CONFIG_FB_BACKLIGHT (Javier, kernel test robot) * reword commit message (Daniel) Signed-off-by: Thomas Zimmermann <[email protected]> Cc: Bruno Prémont <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent e755554 commit c34b107

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

drivers/hid/hid-picolcd_backlight.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#include <linux/hid.h>
1111

12-
#include <linux/fb.h>
1312
#include <linux/backlight.h>
1413

1514
#include "hid-picolcd.h"
@@ -39,15 +38,9 @@ static int picolcd_set_brightness(struct backlight_device *bdev)
3938
return 0;
4039
}
4140

42-
static int picolcd_check_bl_fb(struct backlight_device *bdev, struct fb_info *fb)
43-
{
44-
return fb && fb == picolcd_fbinfo((struct picolcd_data *)bl_get_data(bdev));
45-
}
46-
4741
static const struct backlight_ops picolcd_blops = {
4842
.update_status = picolcd_set_brightness,
4943
.get_brightness = picolcd_get_brightness,
50-
.check_fb = picolcd_check_bl_fb,
5144
};
5245

5346
int picolcd_init_backlight(struct picolcd_data *data, struct hid_report *report)

drivers/hid/hid-picolcd_fb.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,12 @@ int picolcd_init_framebuffer(struct picolcd_data *data)
493493
info->fix = picolcdfb_fix;
494494
info->fix.smem_len = PICOLCDFB_SIZE*8;
495495

496+
#ifdef CONFIG_FB_BACKLIGHT
497+
#ifdef CONFIG_HID_PICOLCD_BACKLIGHT
498+
info->bl_dev = data->backlight;
499+
#endif
500+
#endif
501+
496502
fbdata = info->par;
497503
spin_lock_init(&fbdata->lock);
498504
fbdata->picolcd = data;

0 commit comments

Comments
 (0)