diff options
Diffstat (limited to 'drivers/video/fbdev/gxt4500.c')
| -rw-r--r-- | drivers/video/fbdev/gxt4500.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/video/fbdev/gxt4500.c b/drivers/video/fbdev/gxt4500.c index 13ded3a10708..1ee0a1efa18e 100644 --- a/drivers/video/fbdev/gxt4500.c +++ b/drivers/video/fbdev/gxt4500.c @@ -6,6 +6,7 @@ * Copyright (C) 2006 Paul Mackerras, IBM Corp. <paulus@samba.org> */ +#include <linux/aperture.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/fb.h> @@ -534,7 +535,7 @@ static int gxt4500_setcolreg(unsigned int reg, unsigned int red, break; case DFA_PIX_32BIT: val |= (reg << 24); - /* fall through */ + fallthrough; case DFA_PIX_24BIT: val |= (reg << 16) | (reg << 8); break; @@ -601,14 +602,12 @@ static const struct fb_fix_screeninfo gxt4500_fix = { static const struct fb_ops gxt4500_ops = { .owner = THIS_MODULE, + FB_DEFAULT_IOMEM_OPS, .fb_check_var = gxt4500_check_var, .fb_set_par = gxt4500_set_par, .fb_setcolreg = gxt4500_setcolreg, .fb_pan_display = gxt4500_pan_display, .fb_blank = gxt4500_blank, - .fb_fillrect = cfb_fillrect, - .fb_copyarea = cfb_copyarea, - .fb_imageblit = cfb_imageblit, }; /* PCI functions */ @@ -621,6 +620,10 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct fb_var_screeninfo var; enum gxt_cards cardtype; + err = aperture_remove_conflicting_pci_devices(pdev, "gxt4500fb"); + if (err) + return err; + err = pci_enable_device(pdev); if (err) { dev_err(&pdev->dev, "gxt4500: cannot enable PCI device: %d\n", @@ -650,7 +653,7 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent) cardtype = ent->driver_data; par->refclk_ps = cardinfo[cardtype].refclk_ps; info->fix = gxt4500_fix; - strlcpy(info->fix.id, cardinfo[cardtype].cardname, + strscpy(info->fix.id, cardinfo[cardtype].cardname, sizeof(info->fix.id)); info->pseudo_palette = par->pseudo_palette; @@ -685,8 +688,7 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent) #endif info->fbops = &gxt4500_ops; - info->flags = FBINFO_FLAG_DEFAULT | FBINFO_HWACCEL_XPAN | - FBINFO_HWACCEL_YPAN; + info->flags = FBINFO_HWACCEL_XPAN | FBINFO_HWACCEL_YPAN; err = fb_alloc_cmap(&info->cmap, 256, 0); if (err) { @@ -702,7 +704,7 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } info->var = var; if (gxt4500_set_par(info)) { - printk(KERN_ERR "gxt4500: cannot set video mode\n"); + dev_err(&pdev->dev, "cannot set video mode\n"); goto err_free_cmap; } @@ -774,6 +776,9 @@ static struct pci_driver gxt4500_driver = { static int gxt4500_init(void) { + if (fb_modesetting_disabled("gxt4500")) + return -ENODEV; + #ifndef MODULE if (fb_get_options("gxt4500", &mode_option)) return -ENODEV; |
