diff options
Diffstat (limited to 'drivers/video/vt8623fb.c')
-rw-r--r-- | drivers/video/vt8623fb.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/video/vt8623fb.c b/drivers/video/vt8623fb.c index 536ab11623f0..3df17dc8c3d7 100644 --- a/drivers/video/vt8623fb.c +++ b/drivers/video/vt8623fb.c | |||
@@ -12,7 +12,6 @@ | |||
12 | * (http://davesdomain.org.uk/viafb/) | 12 | * (http://davesdomain.org.uk/viafb/) |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/version.h> | ||
16 | #include <linux/module.h> | 15 | #include <linux/module.h> |
17 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
18 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
@@ -677,13 +676,13 @@ static int __devinit vt8623_pci_probe(struct pci_dev *dev, const struct pci_devi | |||
677 | 676 | ||
678 | rc = pci_enable_device(dev); | 677 | rc = pci_enable_device(dev); |
679 | if (rc < 0) { | 678 | if (rc < 0) { |
680 | dev_err(info->dev, "cannot enable PCI device\n"); | 679 | dev_err(info->device, "cannot enable PCI device\n"); |
681 | goto err_enable_device; | 680 | goto err_enable_device; |
682 | } | 681 | } |
683 | 682 | ||
684 | rc = pci_request_regions(dev, "vt8623fb"); | 683 | rc = pci_request_regions(dev, "vt8623fb"); |
685 | if (rc < 0) { | 684 | if (rc < 0) { |
686 | dev_err(info->dev, "cannot reserve framebuffer region\n"); | 685 | dev_err(info->device, "cannot reserve framebuffer region\n"); |
687 | goto err_request_regions; | 686 | goto err_request_regions; |
688 | } | 687 | } |
689 | 688 | ||
@@ -696,14 +695,14 @@ static int __devinit vt8623_pci_probe(struct pci_dev *dev, const struct pci_devi | |||
696 | info->screen_base = pci_iomap(dev, 0, 0); | 695 | info->screen_base = pci_iomap(dev, 0, 0); |
697 | if (! info->screen_base) { | 696 | if (! info->screen_base) { |
698 | rc = -ENOMEM; | 697 | rc = -ENOMEM; |
699 | dev_err(info->dev, "iomap for framebuffer failed\n"); | 698 | dev_err(info->device, "iomap for framebuffer failed\n"); |
700 | goto err_iomap_1; | 699 | goto err_iomap_1; |
701 | } | 700 | } |
702 | 701 | ||
703 | par->mmio_base = pci_iomap(dev, 1, 0); | 702 | par->mmio_base = pci_iomap(dev, 1, 0); |
704 | if (! par->mmio_base) { | 703 | if (! par->mmio_base) { |
705 | rc = -ENOMEM; | 704 | rc = -ENOMEM; |
706 | dev_err(info->dev, "iomap for MMIO failed\n"); | 705 | dev_err(info->device, "iomap for MMIO failed\n"); |
707 | goto err_iomap_2; | 706 | goto err_iomap_2; |
708 | } | 707 | } |
709 | 708 | ||
@@ -714,7 +713,7 @@ static int __devinit vt8623_pci_probe(struct pci_dev *dev, const struct pci_devi | |||
714 | if ((16 <= memsize1) && (memsize1 <= 64) && (memsize1 == memsize2)) | 713 | if ((16 <= memsize1) && (memsize1 <= 64) && (memsize1 == memsize2)) |
715 | info->screen_size = memsize1 << 20; | 714 | info->screen_size = memsize1 << 20; |
716 | else { | 715 | else { |
717 | dev_err(info->dev, "memory size detection failed (%x %x), suppose 16 MB\n", memsize1, memsize2); | 716 | dev_err(info->device, "memory size detection failed (%x %x), suppose 16 MB\n", memsize1, memsize2); |
718 | info->screen_size = 16 << 20; | 717 | info->screen_size = 16 << 20; |
719 | } | 718 | } |
720 | 719 | ||
@@ -731,19 +730,19 @@ static int __devinit vt8623_pci_probe(struct pci_dev *dev, const struct pci_devi | |||
731 | rc = fb_find_mode(&(info->var), info, mode_option, NULL, 0, NULL, 8); | 730 | rc = fb_find_mode(&(info->var), info, mode_option, NULL, 0, NULL, 8); |
732 | if (! ((rc == 1) || (rc == 2))) { | 731 | if (! ((rc == 1) || (rc == 2))) { |
733 | rc = -EINVAL; | 732 | rc = -EINVAL; |
734 | dev_err(info->dev, "mode %s not found\n", mode_option); | 733 | dev_err(info->device, "mode %s not found\n", mode_option); |
735 | goto err_find_mode; | 734 | goto err_find_mode; |
736 | } | 735 | } |
737 | 736 | ||
738 | rc = fb_alloc_cmap(&info->cmap, 256, 0); | 737 | rc = fb_alloc_cmap(&info->cmap, 256, 0); |
739 | if (rc < 0) { | 738 | if (rc < 0) { |
740 | dev_err(info->dev, "cannot allocate colormap\n"); | 739 | dev_err(info->device, "cannot allocate colormap\n"); |
741 | goto err_alloc_cmap; | 740 | goto err_alloc_cmap; |
742 | } | 741 | } |
743 | 742 | ||
744 | rc = register_framebuffer(info); | 743 | rc = register_framebuffer(info); |
745 | if (rc < 0) { | 744 | if (rc < 0) { |
746 | dev_err(info->dev, "cannot register framebugger\n"); | 745 | dev_err(info->device, "cannot register framebugger\n"); |
747 | goto err_reg_fb; | 746 | goto err_reg_fb; |
748 | } | 747 | } |
749 | 748 | ||
@@ -817,7 +816,7 @@ static int vt8623_pci_suspend(struct pci_dev* dev, pm_message_t state) | |||
817 | struct fb_info *info = pci_get_drvdata(dev); | 816 | struct fb_info *info = pci_get_drvdata(dev); |
818 | struct vt8623fb_info *par = info->par; | 817 | struct vt8623fb_info *par = info->par; |
819 | 818 | ||
820 | dev_info(info->dev, "suspend\n"); | 819 | dev_info(info->device, "suspend\n"); |
821 | 820 | ||
822 | acquire_console_sem(); | 821 | acquire_console_sem(); |
823 | mutex_lock(&(par->open_lock)); | 822 | mutex_lock(&(par->open_lock)); |
@@ -848,16 +847,13 @@ static int vt8623_pci_resume(struct pci_dev* dev) | |||
848 | struct fb_info *info = pci_get_drvdata(dev); | 847 | struct fb_info *info = pci_get_drvdata(dev); |
849 | struct vt8623fb_info *par = info->par; | 848 | struct vt8623fb_info *par = info->par; |
850 | 849 | ||
851 | dev_info(info->dev, "resume\n"); | 850 | dev_info(info->device, "resume\n"); |
852 | 851 | ||
853 | acquire_console_sem(); | 852 | acquire_console_sem(); |
854 | mutex_lock(&(par->open_lock)); | 853 | mutex_lock(&(par->open_lock)); |
855 | 854 | ||
856 | if (par->ref_count == 0) { | 855 | if (par->ref_count == 0) |
857 | mutex_unlock(&(par->open_lock)); | 856 | goto fail; |
858 | release_console_sem(); | ||
859 | return 0; | ||
860 | } | ||
861 | 857 | ||
862 | pci_set_power_state(dev, PCI_D0); | 858 | pci_set_power_state(dev, PCI_D0); |
863 | pci_restore_state(dev); | 859 | pci_restore_state(dev); |
@@ -870,8 +866,8 @@ static int vt8623_pci_resume(struct pci_dev* dev) | |||
870 | vt8623fb_set_par(info); | 866 | vt8623fb_set_par(info); |
871 | fb_set_suspend(info, 0); | 867 | fb_set_suspend(info, 0); |
872 | 868 | ||
873 | mutex_unlock(&(par->open_lock)); | ||
874 | fail: | 869 | fail: |
870 | mutex_unlock(&(par->open_lock)); | ||
875 | release_console_sem(); | 871 | release_console_sem(); |
876 | 872 | ||
877 | return 0; | 873 | return 0; |