]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mfd: ipaq-micro: Convert to built-in platform driver
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 22 Jul 2015 07:55:43 +0000 (09:55 +0200)
committerLee Jones <lee.jones@linaro.org>
Tue, 11 Aug 2015 14:09:00 +0000 (15:09 +0100)
Signal that this is a built-in driver and call its probe function
immediately on init. Suppress binding attributes and delete the
.remove() function since it is never unloaded. Tag probe() and
functions only called from probe() with __init. Delete all module
macros since this is a pure built-in.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/ipaq-micro.c

index 9bfe2462c5c53753b7abe0b578259d2521eaaefe..a41859c55bda5cbc79c48aaae4ead5a0eba4d323 100644 (file)
@@ -242,7 +242,7 @@ static u16 ipaq_micro_to_u16(u8 *data)
        return data[1] << 8 | data[0];
 }
 
-static void ipaq_micro_eeprom_dump(struct ipaq_micro *micro)
+static void __init ipaq_micro_eeprom_dump(struct ipaq_micro *micro)
 {
        u8 dump[256];
        char *str;
@@ -386,7 +386,7 @@ static int micro_resume(struct device *dev)
        return 0;
 }
 
-static int micro_probe(struct platform_device *pdev)
+static int __init micro_probe(struct platform_device *pdev)
 {
        struct ipaq_micro *micro;
        struct resource *res;
@@ -448,21 +448,6 @@ static int micro_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int micro_remove(struct platform_device *pdev)
-{
-       struct ipaq_micro *micro = platform_get_drvdata(pdev);
-       u32 val;
-
-       mfd_remove_devices(&pdev->dev);
-
-       val = readl(micro->base + UTCR3);
-       val &= ~(UTCR3_RXE | UTCR3_RIE); /* disable receive interrupt */
-       val &= ~(UTCR3_TXE | UTCR3_TIE); /* disable transmit interrupt */
-       writel(val, micro->base + UTCR3);
-
-       return 0;
-}
-
 static const struct dev_pm_ops micro_dev_pm_ops = {
        SET_SYSTEM_SLEEP_PM_OPS(NULL, micro_resume)
 };
@@ -471,11 +456,7 @@ static struct platform_driver micro_device_driver = {
        .driver   = {
                .name   = "ipaq-h3xxx-micro",
                .pm     = &micro_dev_pm_ops,
+               .suppress_bind_attrs = true,
        },
-       .probe    = micro_probe,
-       .remove   = micro_remove,
 };
-module_platform_driver(micro_device_driver);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("driver for iPAQ Atmel micro core and backlight");
+builtin_platform_driver_probe(micro_device_driver, micro_probe);