aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-picolcd.c
diff options
context:
space:
mode:
authorBruno Prémont <bonbons@linux-vserver.org>2010-06-30 16:36:31 -0400
committerJiri Kosina <jkosina@suse.cz>2010-07-11 16:57:17 -0400
commita7c9a0aa175aee8a66301264bff2a5ff014ca0e7 (patch)
tree45ead753fcbbd064b64f7f09e291ffb230d5e033 /drivers/hid/hid-picolcd.c
parent6dc398acf944e768a62aa5eed925633e0a3dad0e (diff)
HID: picolcd: fix deferred_io init/cleanup to fb ordering
Adjust ordering if framebuffer (un)registration and defio init/cleanup to match the correct order (init defio, register FB ... unregister FB, cleanup defio) Acked-by: Jaya Kumar <jayakumar.lkml@gmail.com> Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-picolcd.c')
-rw-r--r--drivers/hid/hid-picolcd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c
index 7aabf65c48ef..839a5ac0ad82 100644
--- a/drivers/hid/hid-picolcd.c
+++ b/drivers/hid/hid-picolcd.c
@@ -707,18 +707,19 @@ static int picolcd_init_framebuffer(struct picolcd_data *data)
707 dev_err(dev, "failed to create sysfs attributes\n"); 707 dev_err(dev, "failed to create sysfs attributes\n");
708 goto err_cleanup; 708 goto err_cleanup;
709 } 709 }
710 fb_deferred_io_init(info);
710 data->fb_info = info; 711 data->fb_info = info;
711 error = register_framebuffer(info); 712 error = register_framebuffer(info);
712 if (error) { 713 if (error) {
713 dev_err(dev, "failed to register framebuffer\n"); 714 dev_err(dev, "failed to register framebuffer\n");
714 goto err_sysfs; 715 goto err_sysfs;
715 } 716 }
716 fb_deferred_io_init(info);
717 /* schedule first output of framebuffer */ 717 /* schedule first output of framebuffer */
718 schedule_delayed_work(&info->deferred_work, 0); 718 schedule_delayed_work(&info->deferred_work, 0);
719 return 0; 719 return 0;
720 720
721err_sysfs: 721err_sysfs:
722 fb_deferred_io_cleanup(info);
722 device_remove_file(dev, &dev_attr_fb_update_rate); 723 device_remove_file(dev, &dev_attr_fb_update_rate);
723err_cleanup: 724err_cleanup:
724 data->fb_vbitmap = NULL; 725 data->fb_vbitmap = NULL;
@@ -747,7 +748,6 @@ static void picolcd_exit_framebuffer(struct picolcd_data *data)
747 data->fb_bpp = 0; 748 data->fb_bpp = 0;
748 data->fb_info = NULL; 749 data->fb_info = NULL;
749 device_remove_file(&data->hdev->dev, &dev_attr_fb_update_rate); 750 device_remove_file(&data->hdev->dev, &dev_attr_fb_update_rate);
750 fb_deferred_io_cleanup(info);
751 unregister_framebuffer(info); 751 unregister_framebuffer(info);
752 vfree(fb_bitmap); 752 vfree(fb_bitmap);
753 kfree(fb_vbitmap); 753 kfree(fb_vbitmap);