Skip to content

Commit 447794e

Browse files
Gonzalosilvaldehdeller
authored andcommitted
fbdev: sstfb: Make CONFIG_FB_DEVICE optional
The sstfb driver currently depends on CONFIG_FB_DEVICE to create sysfs entries and access info->dev. This patch wraps the relevant code blocks with #ifdef CONFIG_FB_DEVICE, allowing the driver to be built and used even if CONFIG_FB_DEVICE is not selected. The sysfs setting only controls the VGA pass-through state and is not required for the display to work correctly. (See: http://vogonswiki.com/index.php/VGA_passthrough_cable for more information.) Added some fixes from Thomas Zimmermann. Signed-off-by: Gonzalo Silvalde Blanco <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 8e929cb commit 447794e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

drivers/video/fbdev/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,6 @@ config FB_3DFX_I2C
12361236
config FB_VOODOO1
12371237
tristate "3Dfx Voodoo Graphics (sst1) support"
12381238
depends on FB && PCI
1239-
depends on FB_DEVICE
12401239
select FB_IOMEM_HELPERS
12411240
help
12421241
Say Y here if you have a 3Dfx Voodoo Graphics (Voodoo1/sst1) or

drivers/video/fbdev/sstfb.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,7 @@ static void sstfb_setvgapass( struct fb_info *info, int enable )
716716
pci_write_config_dword(sst_dev, PCI_INIT_ENABLE, tmp);
717717
}
718718

719+
#ifdef CONFIG_FB_DEVICE
719720
static ssize_t store_vgapass(struct device *device, struct device_attribute *attr,
720721
const char *buf, size_t count)
721722
{
@@ -739,7 +740,8 @@ static ssize_t show_vgapass(struct device *device, struct device_attribute *attr
739740

740741
static struct device_attribute device_attrs[] = {
741742
__ATTR(vgapass, S_IRUGO|S_IWUSR, show_vgapass, store_vgapass)
742-
};
743+
};
744+
#endif
743745

744746
static int sstfb_ioctl(struct fb_info *info, unsigned int cmd,
745747
unsigned long arg)
@@ -1436,9 +1438,10 @@ static int sstfb_probe(struct pci_dev *pdev, const struct pci_device_id *id)
14361438

14371439
sstfb_clear_screen(info);
14381440

1441+
#ifdef CONFIG_FB_DEVICE
14391442
if (device_create_file(info->dev, &device_attrs[0]))
14401443
printk(KERN_WARNING "sstfb: can't create sysfs entry.\n");
1441-
1444+
#endif
14421445

14431446
fb_info(info, "%s frame buffer device at 0x%p\n",
14441447
fix->id, info->screen_base);
@@ -1468,7 +1471,9 @@ static void sstfb_remove(struct pci_dev *pdev)
14681471
info = pci_get_drvdata(pdev);
14691472
par = info->par;
14701473

1474+
#ifdef CONFIG_FB_DEVICE
14711475
device_remove_file(info->dev, &device_attrs[0]);
1476+
#endif
14721477
sst_shutdown(info);
14731478
iounmap(info->screen_base);
14741479
iounmap(par->mmio_vbase);

0 commit comments

Comments
 (0)