summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/sunxvr500.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbdev/sunxvr500.c')
-rw-r--r--drivers/video/fbdev/sunxvr500.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/video/fbdev/sunxvr500.c b/drivers/video/fbdev/sunxvr500.c
index dc0d886e4e7e..fef008b728dd 100644
--- a/drivers/video/fbdev/sunxvr500.c
+++ b/drivers/video/fbdev/sunxvr500.c
@@ -5,11 +5,12 @@
* Copyright (C) 2007 David S. Miller (davem@davemloft.net)
*/
+#include <linux/aperture.h>
#include <linux/kernel.h>
#include <linux/fb.h>
#include <linux/pci.h>
#include <linux/init.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <asm/io.h>
@@ -186,12 +187,14 @@ static void e3d_copyarea(struct fb_info *info, const struct fb_copyarea *area)
spin_unlock_irqrestore(&ep->lock, flags);
}
-static struct fb_ops e3d_ops = {
+static const struct fb_ops e3d_ops = {
.owner = THIS_MODULE,
+ __FB_DEFAULT_IOMEM_OPS_RDWR,
.fb_setcolreg = e3d_setcolreg,
.fb_fillrect = e3d_fillrect,
.fb_copyarea = e3d_copyarea,
.fb_imageblit = e3d_imageblit,
+ __FB_DEFAULT_IOMEM_OPS_MMAP,
};
static int e3d_set_fbinfo(struct e3d_info *ep)
@@ -199,7 +202,6 @@ static int e3d_set_fbinfo(struct e3d_info *ep)
struct fb_info *info = ep->info;
struct fb_var_screeninfo *var = &info->var;
- info->flags = FBINFO_DEFAULT;
info->fbops = &e3d_ops;
info->screen_base = ep->fb_base;
info->screen_size = ep->fb_size;
@@ -207,7 +209,7 @@ static int e3d_set_fbinfo(struct e3d_info *ep)
info->pseudo_palette = ep->pseudo_palette;
/* Fill fix common fields */
- strlcpy(info->fix.id, "e3d", sizeof(info->fix.id));
+ strscpy(info->fix.id, "e3d", sizeof(info->fix.id));
info->fix.smem_start = ep->fb_base_phys;
info->fix.smem_len = ep->fb_size;
info->fix.type = FB_TYPE_PACKED_PIXELS;
@@ -249,6 +251,10 @@ static int e3d_pci_register(struct pci_dev *pdev,
unsigned int line_length;
int err;
+ err = aperture_remove_conflicting_pci_devices(pdev, "e3dfb");
+ if (err)
+ return err;
+
of_node = pci_device_to_OF_node(pdev);
if (!of_node) {
printk(KERN_ERR "e3d: Cannot find OF node of %s\n",
@@ -272,7 +278,6 @@ static int e3d_pci_register(struct pci_dev *pdev,
info = framebuffer_alloc(sizeof(struct e3d_info), &pdev->dev);
if (!info) {
- printk(KERN_ERR "e3d: Cannot allocate fb_info\n");
err = -ENOMEM;
goto err_disable;
}
@@ -393,7 +398,7 @@ err_out:
return err;
}
-static struct pci_device_id e3d_pci_table[] = {
+static const struct pci_device_id e3d_pci_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a0), },
{ PCI_DEVICE(0x1091, 0x7a0), },
{ PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a2), },
@@ -426,6 +431,9 @@ static struct pci_driver e3d_driver = {
static int __init e3d_init(void)
{
+ if (fb_modesetting_disabled("e3d"))
+ return -ENODEV;
+
if (fb_get_options("e3d", NULL))
return -ENODEV;