diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2023-06-13 14:07:05 +0300 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2023-06-27 10:58:50 +0300 |
commit | f5c6291f12090c4a0cdf0832da513c5a3e41d186 (patch) | |
tree | 5f068c44754bd48b018a37c5c4dafc43bf74a0e4 /drivers | |
parent | 1d4423d3f0058793f4c6dbc9cdade1742d105a6b (diff) | |
download | linux-f5c6291f12090c4a0cdf0832da513c5a3e41d186.tar.xz |
fbdev/smscufx: Detect registered fb_info from refcount
Detect registered instances of fb_info by reading the reference
counter from struct fb_info.read. Avoids looking at the dev field
and prepares fbdev for making struct fb_info.dev optional.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Steve Glendinning <steve.glendinning@shawell.net>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230613110953.24176-31-tzimmermann@suse.de
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/fbdev/smscufx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/fbdev/smscufx.c b/drivers/video/fbdev/smscufx.c index 17cec62cc65d..adb2b1fe8383 100644 --- a/drivers/video/fbdev/smscufx.c +++ b/drivers/video/fbdev/smscufx.c @@ -1496,7 +1496,7 @@ static int ufx_setup_modes(struct ufx_data *dev, struct fb_info *info, u8 *edid; int i, result = 0, tries = 3; - if (info->dev) /* only use mutex if info has been registered */ + if (refcount_read(&info->count)) /* only use mutex if info has been registered */ mutex_lock(&info->lock); edid = kmalloc(EDID_LENGTH, GFP_KERNEL); @@ -1610,7 +1610,7 @@ error: if (edid && (dev->edid != edid)) kfree(edid); - if (info->dev) + if (refcount_read(&info->count)) mutex_unlock(&info->lock); return result; |