mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-02-06 11:19:56 +00:00
leds: syscon: Make the driver explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/leds/Kconfig:config LEDS_SYSCON drivers/leds/Kconfig: bool "LED support for LEDs on system controllers" ...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. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. Cc: Richard Purdie <rpurdie@rpsys.net> Cc: linux-leds@vger.kernel.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
This commit is contained in:
parent
067a8f3cad
commit
f7d98a65d0
@ -20,7 +20,7 @@
|
|||||||
* MA 02111-1307 USA
|
* MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/module.h>
|
#include <linux/init.h>
|
||||||
#include <linux/of_device.h>
|
#include <linux/of_device.h>
|
||||||
#include <linux/of_address.h>
|
#include <linux/of_address.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
@ -139,29 +139,17 @@ static int syscon_led_probe(struct platform_device *pdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int syscon_led_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct syscon_led *sled = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
led_classdev_unregister(&sled->cdev);
|
|
||||||
/* Turn it off */
|
|
||||||
regmap_update_bits(sled->map, sled->offset, sled->mask, 0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct of_device_id of_syscon_leds_match[] = {
|
static const struct of_device_id of_syscon_leds_match[] = {
|
||||||
{ .compatible = "register-bit-led", },
|
{ .compatible = "register-bit-led", },
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
|
|
||||||
MODULE_DEVICE_TABLE(of, of_syscon_leds_match);
|
|
||||||
|
|
||||||
static struct platform_driver syscon_led_driver = {
|
static struct platform_driver syscon_led_driver = {
|
||||||
.probe = syscon_led_probe,
|
.probe = syscon_led_probe,
|
||||||
.remove = syscon_led_remove,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "leds-syscon",
|
.name = "leds-syscon",
|
||||||
.of_match_table = of_syscon_leds_match,
|
.of_match_table = of_syscon_leds_match,
|
||||||
|
.suppress_bind_attrs = true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
module_platform_driver(syscon_led_driver);
|
builtin_platform_driver(syscon_led_driver);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user