Skip to content

Commit

Permalink
fbdev: sysfs files can't disappear before the device is gone
Browse files Browse the repository at this point in the history
Which means lock_fb_info can never fail. Remove the error handling.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Rob Clark <robdclark@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190528090304.9388-14-daniel.vetter@ffwll.ch
  • Loading branch information
danvet committed Jun 12, 2019
1 parent 1e16eae commit 34f31f1
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/video/fbdev/core/fbsysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,7 @@ static ssize_t store_modes(struct device *device,
return -EINVAL;

console_lock();
if (!lock_fb_info(fb_info)) {
console_unlock();
return -ENODEV;
}
lock_fb_info(fb_info);

list_splice(&fb_info->modelist, &old_list);
fb_videomode_to_modelist((const struct fb_videomode *)buf, i,
Expand Down Expand Up @@ -405,10 +402,7 @@ static ssize_t store_fbstate(struct device *device,
state = simple_strtoul(buf, &last, 0);

console_lock();
if (!lock_fb_info(fb_info)) {
console_unlock();
return -ENODEV;
}
lock_fb_info(fb_info);

fb_set_suspend(fb_info, (int)state);

Expand Down

0 comments on commit 34f31f1

Please sign in to comment.