Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293795
b: refs/heads/master
c: ce880cb
h: refs/heads/master
i:
  293793: ea08838
  293791: abaad28
v: v3
  • Loading branch information
Kay Sievers authored and Dave Airlie committed Mar 15, 2012
1 parent 86d0bb6 commit fb08450
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8229c885fe361e521ac64de36b16011e54a30de0
refs/heads/master: ce880cb860f36694d2cdebfac9e6ae18176fe4c4
18 changes: 17 additions & 1 deletion trunk/drivers/video/fbmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1665,14 +1665,14 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)
if (ret)
return -EINVAL;

unlink_framebuffer(fb_info);
if (fb_info->pixmap.addr &&
(fb_info->pixmap.flags & FB_PIXMAP_DEFAULT))
kfree(fb_info->pixmap.addr);
fb_destroy_modelist(&fb_info->modelist);
registered_fb[i] = NULL;
num_registered_fb--;
fb_cleanup_device(fb_info);
device_destroy(fb_class, MKDEV(FB_MAJOR, i));
event.info = fb_info;
fb_notifier_call_chain(FB_EVENT_FB_UNREGISTERED, &event);

Expand All @@ -1681,6 +1681,22 @@ static int do_unregister_framebuffer(struct fb_info *fb_info)
return 0;
}

int unlink_framebuffer(struct fb_info *fb_info)
{
int i;

i = fb_info->node;
if (i < 0 || i >= FB_MAX || registered_fb[i] != fb_info)
return -EINVAL;

if (fb_info->dev) {
device_destroy(fb_class, MKDEV(FB_MAJOR, i));
fb_info->dev = NULL;
}
return 0;
}
EXPORT_SYMBOL(unlink_framebuffer);

void remove_conflicting_framebuffers(struct apertures_struct *a,
const char *name, bool primary)
{
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/video/udlfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ static void dlfb_usb_disconnect(struct usb_interface *interface)
for (i = 0; i < ARRAY_SIZE(fb_device_attrs); i++)
device_remove_file(info->dev, &fb_device_attrs[i]);
device_remove_bin_file(info->dev, &edid_attr);

unlink_framebuffer(info);
usb_set_intfdata(interface, NULL);

/* if clients still have us open, will be freed on last close */
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,7 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
/* drivers/video/fbmem.c */
extern int register_framebuffer(struct fb_info *fb_info);
extern int unregister_framebuffer(struct fb_info *fb_info);
extern int unlink_framebuffer(struct fb_info *fb_info);
extern void remove_conflicting_framebuffers(struct apertures_struct *a,
const char *name, bool primary);
extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
Expand Down

0 comments on commit fb08450

Please sign in to comment.