Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/video: make fbdev/sunxvr1000.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

config FB_XVR1000
bool "Sun XVR-1000 support"

...meaning that it currently is not being built as a module by anyone.
Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

We don't replace module.h with init.h since the file already has that.
Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

authored by

Paul Gortmaker and committed by
Tomi Valkeinen
27844cb8 d61b0ef7

+7 -35
+7 -35
drivers/video/fbdev/sunxvr1000.c
··· 1 - /* sunxvr1000.c: Sun XVR-1000 driver for sparc64 systems 1 + /* sunxvr1000.c: Sun XVR-1000 fb driver for sparc64 systems 2 + * 3 + * License: GPL 2 4 * 3 5 * Copyright (C) 2010 David S. Miller (davem@davemloft.net) 4 6 */ 5 7 6 - #include <linux/module.h> 7 8 #include <linux/kernel.h> 8 9 #include <linux/fb.h> 9 10 #include <linux/init.h> ··· 174 173 return err; 175 174 } 176 175 177 - static int gfb_remove(struct platform_device *op) 178 - { 179 - struct fb_info *info = dev_get_drvdata(&op->dev); 180 - struct gfb_info *gp = info->par; 181 - 182 - unregister_framebuffer(info); 183 - 184 - iounmap(gp->fb_base); 185 - 186 - of_iounmap(&op->resource[6], gp->fb_base, gp->fb_size); 187 - 188 - framebuffer_release(info); 189 - 190 - return 0; 191 - } 192 - 193 176 static const struct of_device_id gfb_match[] = { 194 177 { 195 178 .name = "SUNW,gfb", 196 179 }, 197 180 {}, 198 181 }; 199 - MODULE_DEVICE_TABLE(of, ffb_match); 200 182 201 183 static struct platform_driver gfb_driver = { 202 184 .probe = gfb_probe, 203 - .remove = gfb_remove, 204 185 .driver = { 205 - .name = "gfb", 206 - .of_match_table = gfb_match, 186 + .name = "gfb", 187 + .of_match_table = gfb_match, 188 + .suppress_bind_attrs = true, 207 189 }, 208 190 }; 209 191 ··· 197 213 198 214 return platform_driver_register(&gfb_driver); 199 215 } 200 - 201 - static void __exit gfb_exit(void) 202 - { 203 - platform_driver_unregister(&gfb_driver); 204 - } 205 - 206 - module_init(gfb_init); 207 - module_exit(gfb_exit); 208 - 209 - MODULE_DESCRIPTION("framebuffer driver for Sun XVR-1000 graphics"); 210 - MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); 211 - MODULE_VERSION("1.0"); 212 - MODULE_LICENSE("GPL"); 216 + device_initcall(gfb_init);