Skip to content

Commit 488d807

Browse files
Thomas Zimmermannlag-linaro
authored andcommitted
fbdev: imxfb: Replace check_fb in favor of struct fb_info.lcd_dev
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 imxfb_lcd_ops obsolete. Remove it. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent c11de82 commit 488d807

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

drivers/video/fbdev/imxfb.c

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -782,16 +782,6 @@ static int imxfb_of_read_mode(struct device *dev, struct device_node *np,
782782
return 0;
783783
}
784784

785-
static int imxfb_lcd_check_fb(struct lcd_device *lcddev, struct fb_info *fi)
786-
{
787-
struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev);
788-
789-
if (!fi || fi->par == fbi)
790-
return 1;
791-
792-
return 0;
793-
}
794-
795785
static int imxfb_lcd_get_contrast(struct lcd_device *lcddev)
796786
{
797787
struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev);
@@ -858,7 +848,6 @@ static int imxfb_lcd_set_power(struct lcd_device *lcddev, int power)
858848
}
859849

860850
static const struct lcd_ops imxfb_lcd_ops = {
861-
.check_fb = imxfb_lcd_check_fb,
862851
.get_contrast = imxfb_lcd_get_contrast,
863852
.set_contrast = imxfb_lcd_set_contrast,
864853
.get_power = imxfb_lcd_get_power,
@@ -1025,11 +1014,6 @@ static int imxfb_probe(struct platform_device *pdev)
10251014
goto failed_cmap;
10261015

10271016
imxfb_set_par(info);
1028-
ret = register_framebuffer(info);
1029-
if (ret < 0) {
1030-
dev_err(&pdev->dev, "failed to register framebuffer\n");
1031-
goto failed_register;
1032-
}
10331017

10341018
fbi->lcd_pwr = devm_regulator_get(&pdev->dev, "lcd");
10351019
if (PTR_ERR(fbi->lcd_pwr) == -EPROBE_DEFER) {
@@ -1046,13 +1030,19 @@ static int imxfb_probe(struct platform_device *pdev)
10461030

10471031
lcd->props.max_contrast = 0xff;
10481032

1033+
info->lcd_dev = lcd;
1034+
1035+
ret = register_framebuffer(info);
1036+
if (ret < 0) {
1037+
dev_err(&pdev->dev, "failed to register framebuffer\n");
1038+
goto failed_lcd;
1039+
}
1040+
10491041
imxfb_enable_controller(fbi);
10501042

10511043
return 0;
10521044

10531045
failed_lcd:
1054-
unregister_framebuffer(info);
1055-
failed_register:
10561046
fb_dealloc_cmap(&info->cmap);
10571047
failed_cmap:
10581048
dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer,

0 commit comments

Comments
 (0)