Skip to content

Commit 36462ac

Browse files
Thomas Zimmermannlag-linaro
authored andcommitted
fbdev: clps711x-fb: 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 clps711x_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 e5dfbbd commit 36462ac

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

drivers/video/fbdev/clps711x-fb.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,6 @@ static const struct fb_ops clps711x_fb_ops = {
162162
.fb_blank = clps711x_fb_blank,
163163
};
164164

165-
static int clps711x_lcd_check_fb(struct lcd_device *lcddev, struct fb_info *fi)
166-
{
167-
struct clps711x_fb_info *cfb = dev_get_drvdata(&lcddev->dev);
168-
169-
return (!fi || fi->par == cfb) ? 1 : 0;
170-
}
171-
172165
static int clps711x_lcd_get_power(struct lcd_device *lcddev)
173166
{
174167
struct clps711x_fb_info *cfb = dev_get_drvdata(&lcddev->dev);
@@ -198,7 +191,6 @@ static int clps711x_lcd_set_power(struct lcd_device *lcddev, int blank)
198191
}
199192

200193
static const struct lcd_ops clps711x_lcd_ops = {
201-
.check_fb = clps711x_lcd_check_fb,
202194
.get_power = clps711x_lcd_get_power,
203195
.set_power = clps711x_lcd_set_power,
204196
};
@@ -325,16 +317,21 @@ static int clps711x_fb_probe(struct platform_device *pdev)
325317
if (ret)
326318
goto out_fb_dealloc_cmap;
327319

320+
lcd = devm_lcd_device_register(dev, "clps711x-lcd", dev, cfb,
321+
&clps711x_lcd_ops);
322+
if (IS_ERR(lcd)) {
323+
ret = PTR_ERR(lcd);
324+
goto out_fb_dealloc_cmap;
325+
}
326+
327+
info->lcd_dev = lcd;
328+
328329
ret = register_framebuffer(info);
329330
if (ret)
330331
goto out_fb_dealloc_cmap;
331332

332-
lcd = devm_lcd_device_register(dev, "clps711x-lcd", dev, cfb,
333-
&clps711x_lcd_ops);
334-
if (!IS_ERR(lcd))
335-
return 0;
333+
return 0;
336334

337-
ret = PTR_ERR(lcd);
338335
unregister_framebuffer(info);
339336

340337
out_fb_dealloc_cmap:

0 commit comments

Comments
 (0)