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

gpio: timberdale: make it explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/gpio/Kconfig:config GPIO_TIMBERDALE
drivers/gpio/Kconfig: bool "Support for timberdale GPIO IP"

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

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

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: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.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
52ad9053 3b52bb96

+5 -30
+5 -30
drivers/gpio/gpio-timberdale.c
··· 1 1 /* 2 2 * Timberdale FPGA GPIO driver 3 + * Author: Mocean Laboratories 3 4 * Copyright (c) 2009 Intel Corporation 4 5 * 5 6 * This program is free software; you can redistribute it and/or modify ··· 21 20 * Timberdale FPGA GPIO 22 21 */ 23 22 24 - #include <linux/module.h> 23 + #include <linux/init.h> 25 24 #include <linux/gpio.h> 26 25 #include <linux/platform_device.h> 27 26 #include <linux/irq.h> ··· 291 290 return 0; 292 291 } 293 292 294 - static int timbgpio_remove(struct platform_device *pdev) 295 - { 296 - struct timbgpio_platform_data *pdata = dev_get_platdata(&pdev->dev); 297 - struct timbgpio *tgpio = platform_get_drvdata(pdev); 298 - int irq = platform_get_irq(pdev, 0); 299 - 300 - if (irq >= 0 && tgpio->irq_base > 0) { 301 - int i; 302 - for (i = 0; i < pdata->nr_pins; i++) { 303 - irq_set_chip(tgpio->irq_base + i, NULL); 304 - irq_set_chip_data(tgpio->irq_base + i, NULL); 305 - } 306 - 307 - irq_set_handler(irq, NULL); 308 - irq_set_handler_data(irq, NULL); 309 - } 310 - 311 - return 0; 312 - } 313 - 314 293 static struct platform_driver timbgpio_platform_driver = { 315 294 .driver = { 316 - .name = DRIVER_NAME, 295 + .name = DRIVER_NAME, 296 + .suppress_bind_attrs = true, 317 297 }, 318 298 .probe = timbgpio_probe, 319 - .remove = timbgpio_remove, 320 299 }; 321 300 322 301 /*--------------------------------------------------------------------------*/ 323 302 324 - module_platform_driver(timbgpio_platform_driver); 325 - 326 - MODULE_DESCRIPTION("Timberdale GPIO driver"); 327 - MODULE_LICENSE("GPL v2"); 328 - MODULE_AUTHOR("Mocean Laboratories"); 329 - MODULE_ALIAS("platform:"DRIVER_NAME); 330 - 303 + builtin_platform_driver(timbgpio_platform_driver);