summaryrefslogtreecommitdiffstats
path: root/drivers/video/via
diff options
context:
space:
mode:
authorFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2009-09-22 16:47:15 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 07:39:51 -0700
commitbc6932bb4a25ced97c4f201874573e6097237b78 (patch)
treef7bc89b68a935d1951c086aa692fd62319b420b8 /drivers/video/via
parent09cf11806e4b4be92af76253ff9834c48b416129 (diff)
downloadop-kernel-dev-bc6932bb4a25ced97c4f201874573e6097237b78.zip
op-kernel-dev-bc6932bb4a25ced97c4f201874573e6097237b78.tar.gz
viafb: fix ioremap_nocache error handling
Correct the returned error code for remapping the video framebuffer. Introduce error handling for remapping MMIO register address space to avoid a NULL pointer dereference. Disable hardware acceleration if remapping MMIO register address space failed as those registers are only used for hardware acceleration. Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Scott Fang <ScottFang@viatech.com.cn> Cc: Joseph Chan <JosephChan@via.com.tw> Cc: Harald Welte <laforge@gnumonks.org> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/via')
-rw-r--r--drivers/video/via/viafbdev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c
index 743eed4..72759b6 100644
--- a/drivers/video/via/viafbdev.c
+++ b/drivers/video/via/viafbdev.c
@@ -2134,12 +2134,16 @@ static int __devinit via_pci_probe(void)
if (!viaparinfo->fbmem_virt) {
printk(KERN_INFO "ioremap failed\n");
- return -1;
+ return -ENOMEM;
}
viafb_get_mmio_info(&viaparinfo->mmio_base, &viaparinfo->mmio_len);
viaparinfo->io_virt = ioremap_nocache(viaparinfo->mmio_base,
viaparinfo->mmio_len);
+ if (!viaparinfo->io_virt) {
+ printk(KERN_WARNING "ioremap failed: hardware acceleration disabled\n");
+ viafb_accel = 0;
+ }
viafbinfo->node = 0;
viafbinfo->fbops = &viafb_ops;
OpenPOWER on IntegriCloud