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

gpio: stmpe: make it explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_STMPE
drivers/gpio/Kconfig: bool "STMPE GPIOs"

...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.

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.

Curiously, this driver was using subsys_initcall since day one, so
we don't have the "normal" module_init replacement in this change
like we've done in other similar driver updates.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Rabin Vincent <rabin.vincent@stericsson.com>
Cc: linux-gpio@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Paul Gortmaker and committed by
Linus Walleij
3b52bb96 6a5ead91

+5 -26
+5 -26
drivers/gpio/gpio-stmpe.c
··· 5 5 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson 6 6 */ 7 7 8 - #include <linux/module.h> 9 8 #include <linux/init.h> 10 9 #include <linux/platform_device.h> 11 10 #include <linux/slab.h> ··· 412 413 return ret; 413 414 } 414 415 415 - static int stmpe_gpio_remove(struct platform_device *pdev) 416 - { 417 - struct stmpe_gpio *stmpe_gpio = platform_get_drvdata(pdev); 418 - struct stmpe *stmpe = stmpe_gpio->stmpe; 419 - 420 - gpiochip_remove(&stmpe_gpio->chip); 421 - stmpe_disable(stmpe, STMPE_BLOCK_GPIO); 422 - kfree(stmpe_gpio); 423 - 424 - return 0; 425 - } 426 - 427 416 static struct platform_driver stmpe_gpio_driver = { 428 - .driver.name = "stmpe-gpio", 429 - .driver.owner = THIS_MODULE, 417 + .driver = { 418 + .suppress_bind_attrs = true, 419 + .name = "stmpe-gpio", 420 + .owner = THIS_MODULE, 421 + }, 430 422 .probe = stmpe_gpio_probe, 431 - .remove = stmpe_gpio_remove, 432 423 }; 433 424 434 425 static int __init stmpe_gpio_init(void) ··· 426 437 return platform_driver_register(&stmpe_gpio_driver); 427 438 } 428 439 subsys_initcall(stmpe_gpio_init); 429 - 430 - static void __exit stmpe_gpio_exit(void) 431 - { 432 - platform_driver_unregister(&stmpe_gpio_driver); 433 - } 434 - module_exit(stmpe_gpio_exit); 435 - 436 - MODULE_LICENSE("GPL v2"); 437 - MODULE_DESCRIPTION("STMPExxxx GPIO driver"); 438 - MODULE_AUTHOR("Rabin Vincent <rabin.vincent@stericsson.com>");