HID: picoLCD: Replace check_fb in favor of struct fb_info.lcd_dev
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 6 Sep 2024 07:52:39 +0000 (09:52 +0200)
committerLee Jones <lee@kernel.org>
Mon, 30 Sep 2024 15:49:42 +0000 (16:49 +0100)
Store the lcd device in struct fb_info.lcd_dev. The lcd subsystem can
now detect the lcd's fbdev device from this field.

This makes the implementation of check_fb in picolcd_lcdops obsolete.
Remove it.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Acked-by: Jiri Kosina <jkosina@suse.com>
Link: https://lore.kernel.org/r/20240906075439.98476-26-tzimmermann@suse.de
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/hid/hid-picolcd_fb.c
drivers/hid/hid-picolcd_lcd.c

index 83e3409..22188ac 100644 (file)
@@ -497,6 +497,10 @@ int picolcd_init_framebuffer(struct picolcd_data *data)
 #endif
 #endif
 
+#ifdef CONFIG_HID_PICOLCD_LCD
+       info->lcd_dev = data->lcd;
+#endif
+
        fbdata = info->par;
        spin_lock_init(&fbdata->lock);
        fbdata->picolcd = data;
index 061a33b..318f19e 100644 (file)
@@ -41,15 +41,9 @@ static int picolcd_set_contrast(struct lcd_device *ldev, int contrast)
        return 0;
 }
 
-static int picolcd_check_lcd_fb(struct lcd_device *ldev, struct fb_info *fb)
-{
-       return fb && fb == picolcd_fbinfo((struct picolcd_data *)lcd_get_data(ldev));
-}
-
 static const struct lcd_ops picolcd_lcdops = {
        .get_contrast   = picolcd_get_contrast,
        .set_contrast   = picolcd_set_contrast,
-       .check_fb       = picolcd_check_lcd_fb,
 };
 
 int picolcd_init_lcd(struct picolcd_data *data, struct hid_report *report)