aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/arkfb.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-10-03 13:28:46 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-03 13:28:46 -0400
commitf68ec0c24755e5cdb779be6240925f2175311d84 (patch)
treea7b7128e61a8456385d82bd1c7ca5f14eecbf2ca /drivers/video/arkfb.c
parent98920dc3d1113b883cbc73e3293446d3525c6042 (diff)
parent94aca1dac6f6d21f4b07e4864baf7768cabcc6e7 (diff)
Merge commit 'v2.6.27-rc8' into x86/setup
Diffstat (limited to 'drivers/video/arkfb.c')
-rw-r--r--drivers/video/arkfb.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/video/arkfb.c b/drivers/video/arkfb.c
index 5001bd4ef466..314d18694b6a 100644
--- a/drivers/video/arkfb.c
+++ b/drivers/video/arkfb.c
@@ -11,7 +11,6 @@
11 * Code is based on s3fb 11 * Code is based on s3fb
12 */ 12 */
13 13
14#include <linux/version.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/kernel.h> 15#include <linux/kernel.h>
17#include <linux/errno.h> 16#include <linux/errno.h>
@@ -958,20 +957,20 @@ static int __devinit ark_pci_probe(struct pci_dev *dev, const struct pci_device_
958 /* Prepare PCI device */ 957 /* Prepare PCI device */
959 rc = pci_enable_device(dev); 958 rc = pci_enable_device(dev);
960 if (rc < 0) { 959 if (rc < 0) {
961 dev_err(info->dev, "cannot enable PCI device\n"); 960 dev_err(info->device, "cannot enable PCI device\n");
962 goto err_enable_device; 961 goto err_enable_device;
963 } 962 }
964 963
965 rc = pci_request_regions(dev, "arkfb"); 964 rc = pci_request_regions(dev, "arkfb");
966 if (rc < 0) { 965 if (rc < 0) {
967 dev_err(info->dev, "cannot reserve framebuffer region\n"); 966 dev_err(info->device, "cannot reserve framebuffer region\n");
968 goto err_request_regions; 967 goto err_request_regions;
969 } 968 }
970 969
971 par->dac = ics5342_init(ark_dac_read_regs, ark_dac_write_regs, info); 970 par->dac = ics5342_init(ark_dac_read_regs, ark_dac_write_regs, info);
972 if (! par->dac) { 971 if (! par->dac) {
973 rc = -ENOMEM; 972 rc = -ENOMEM;
974 dev_err(info->dev, "RAMDAC initialization failed\n"); 973 dev_err(info->device, "RAMDAC initialization failed\n");
975 goto err_dac; 974 goto err_dac;
976 } 975 }
977 976
@@ -982,7 +981,7 @@ static int __devinit ark_pci_probe(struct pci_dev *dev, const struct pci_device_
982 info->screen_base = pci_iomap(dev, 0, 0); 981 info->screen_base = pci_iomap(dev, 0, 0);
983 if (! info->screen_base) { 982 if (! info->screen_base) {
984 rc = -ENOMEM; 983 rc = -ENOMEM;
985 dev_err(info->dev, "iomap for framebuffer failed\n"); 984 dev_err(info->device, "iomap for framebuffer failed\n");
986 goto err_iomap; 985 goto err_iomap;
987 } 986 }
988 987
@@ -1004,19 +1003,19 @@ static int __devinit ark_pci_probe(struct pci_dev *dev, const struct pci_device_
1004 rc = fb_find_mode(&(info->var), info, mode_option, NULL, 0, NULL, 8); 1003 rc = fb_find_mode(&(info->var), info, mode_option, NULL, 0, NULL, 8);
1005 if (! ((rc == 1) || (rc == 2))) { 1004 if (! ((rc == 1) || (rc == 2))) {
1006 rc = -EINVAL; 1005 rc = -EINVAL;
1007 dev_err(info->dev, "mode %s not found\n", mode_option); 1006 dev_err(info->device, "mode %s not found\n", mode_option);
1008 goto err_find_mode; 1007 goto err_find_mode;
1009 } 1008 }
1010 1009
1011 rc = fb_alloc_cmap(&info->cmap, 256, 0); 1010 rc = fb_alloc_cmap(&info->cmap, 256, 0);
1012 if (rc < 0) { 1011 if (rc < 0) {
1013 dev_err(info->dev, "cannot allocate colormap\n"); 1012 dev_err(info->device, "cannot allocate colormap\n");
1014 goto err_alloc_cmap; 1013 goto err_alloc_cmap;
1015 } 1014 }
1016 1015
1017 rc = register_framebuffer(info); 1016 rc = register_framebuffer(info);
1018 if (rc < 0) { 1017 if (rc < 0) {
1019 dev_err(info->dev, "cannot register framebugger\n"); 1018 dev_err(info->device, "cannot register framebugger\n");
1020 goto err_reg_fb; 1019 goto err_reg_fb;
1021 } 1020 }
1022 1021
@@ -1090,7 +1089,7 @@ static int ark_pci_suspend (struct pci_dev* dev, pm_message_t state)
1090 struct fb_info *info = pci_get_drvdata(dev); 1089 struct fb_info *info = pci_get_drvdata(dev);
1091 struct arkfb_info *par = info->par; 1090 struct arkfb_info *par = info->par;
1092 1091
1093 dev_info(info->dev, "suspend\n"); 1092 dev_info(info->device, "suspend\n");
1094 1093
1095 acquire_console_sem(); 1094 acquire_console_sem();
1096 mutex_lock(&(par->open_lock)); 1095 mutex_lock(&(par->open_lock));
@@ -1121,16 +1120,13 @@ static int ark_pci_resume (struct pci_dev* dev)
1121 struct fb_info *info = pci_get_drvdata(dev); 1120 struct fb_info *info = pci_get_drvdata(dev);
1122 struct arkfb_info *par = info->par; 1121 struct arkfb_info *par = info->par;
1123 1122
1124 dev_info(info->dev, "resume\n"); 1123 dev_info(info->device, "resume\n");
1125 1124
1126 acquire_console_sem(); 1125 acquire_console_sem();
1127 mutex_lock(&(par->open_lock)); 1126 mutex_lock(&(par->open_lock));
1128 1127
1129 if (par->ref_count == 0) { 1128 if (par->ref_count == 0)
1130 mutex_unlock(&(par->open_lock)); 1129 goto fail;
1131 release_console_sem();
1132 return 0;
1133 }
1134 1130
1135 pci_set_power_state(dev, PCI_D0); 1131 pci_set_power_state(dev, PCI_D0);
1136 pci_restore_state(dev); 1132 pci_restore_state(dev);
@@ -1143,8 +1139,8 @@ static int ark_pci_resume (struct pci_dev* dev)
1143 arkfb_set_par(info); 1139 arkfb_set_par(info);
1144 fb_set_suspend(info, 0); 1140 fb_set_suspend(info, 0);
1145 1141
1146 mutex_unlock(&(par->open_lock));
1147fail: 1142fail:
1143 mutex_unlock(&(par->open_lock));
1148 release_console_sem(); 1144 release_console_sem();
1149 return 0; 1145 return 0;
1150} 1146}