diff options
Diffstat (limited to 'drivers/video/fbdev/sunxvr2500.c')
| -rw-r--r-- | drivers/video/fbdev/sunxvr2500.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/video/fbdev/sunxvr2500.c b/drivers/video/fbdev/sunxvr2500.c index 544465ba1dc0..42426d09b935 100644 --- a/drivers/video/fbdev/sunxvr2500.c +++ b/drivers/video/fbdev/sunxvr2500.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> @@ -63,12 +64,10 @@ static int s3d_setcolreg(unsigned regno, return 0; } -static struct fb_ops s3d_ops = { +static const struct fb_ops s3d_ops = { .owner = THIS_MODULE, + FB_DEFAULT_IOMEM_OPS, .fb_setcolreg = s3d_setcolreg, - .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, }; static int s3d_set_fbinfo(struct s3d_info *sp) @@ -76,7 +75,6 @@ static int s3d_set_fbinfo(struct s3d_info *sp) struct fb_info *info = sp->info; struct fb_var_screeninfo *var = &info->var; - info->flags = FBINFO_DEFAULT; info->fbops = &s3d_ops; info->screen_base = sp->fb_base; info->screen_size = sp->fb_size; @@ -84,7 +82,7 @@ static int s3d_set_fbinfo(struct s3d_info *sp) info->pseudo_palette = sp->pseudo_palette; /* Fill fix common fields */ - strlcpy(info->fix.id, "s3d", sizeof(info->fix.id)); + strscpy(info->fix.id, "s3d", sizeof(info->fix.id)); info->fix.smem_start = sp->fb_base_phys; info->fix.smem_len = sp->fb_size; info->fix.type = FB_TYPE_PACKED_PIXELS; @@ -123,6 +121,10 @@ static int s3d_pci_register(struct pci_dev *pdev, struct s3d_info *sp; int err; + err = aperture_remove_conflicting_pci_devices(pdev, "s3dfb"); + if (err) + return err; + err = pci_enable_device(pdev); if (err < 0) { printk(KERN_ERR "s3d: Cannot enable PCI device %s\n", @@ -132,7 +134,6 @@ static int s3d_pci_register(struct pci_dev *pdev, info = framebuffer_alloc(sizeof(struct s3d_info), &pdev->dev); if (!info) { - printk(KERN_ERR "s3d: Cannot allocate fb_info\n"); err = -ENOMEM; goto err_disable; } @@ -243,6 +244,9 @@ static struct pci_driver s3d_driver = { static int __init s3d_init(void) { + if (fb_modesetting_disabled("s3d")) + return -ENODEV; + if (fb_get_options("s3d", NULL)) return -ENODEV; |
