gpio: dwapb: Append MODULE_ALIAS for platform driver
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 15 Apr 2020 14:15:21 +0000 (17:15 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:50:21 +0000 (17:50 +0200)
[ Upstream commit c58220cba2e03618659fa7d5dfae31f5ad4ae9d0 ]

The commit 3d2613c4289f
  ("GPIO: gpio-dwapb: Enable platform driver binding to MFD driver")
introduced a use of the platform driver but missed to add the following line
to it:
  MODULE_ALIAS("platform:gpio-dwapb");

Add this to get driver loaded automatically if platform device is registered.

Fixes: 3d2613c4289f ("GPIO: gpio-dwapb: Enable platform driver binding to MFD driver")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Serge Semin <fancer.lancer@gmail.com>
Link: https://lore.kernel.org/r/20200415141534.31240-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpio/gpio-dwapb.c

index 02cf4c4..ed6061b 100644 (file)
@@ -49,7 +49,9 @@
 #define GPIO_EXT_PORTC         0x58
 #define GPIO_EXT_PORTD         0x5c
 
+#define DWAPB_DRIVER_NAME      "gpio-dwapb"
 #define DWAPB_MAX_PORTS                4
+
 #define GPIO_EXT_PORT_STRIDE   0x04 /* register stride 32 bits */
 #define GPIO_SWPORT_DR_STRIDE  0x0c /* register stride 3*32 bits */
 #define GPIO_SWPORT_DDR_STRIDE 0x0c /* register stride 3*32 bits */
@@ -398,7 +400,7 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio,
                return;
 
        err = irq_alloc_domain_generic_chips(gpio->domain, ngpio, 2,
-                                            "gpio-dwapb", handle_level_irq,
+                                            DWAPB_DRIVER_NAME, handle_level_irq,
                                             IRQ_NOREQUEST, 0,
                                             IRQ_GC_INIT_NESTED_LOCK);
        if (err) {
@@ -455,7 +457,7 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio,
                 */
                err = devm_request_irq(gpio->dev, pp->irq[0],
                                       dwapb_irq_handler_mfd,
-                                      IRQF_SHARED, "gpio-dwapb-mfd", gpio);
+                                      IRQF_SHARED, DWAPB_DRIVER_NAME, gpio);
                if (err) {
                        dev_err(gpio->dev, "error requesting IRQ\n");
                        irq_domain_remove(gpio->domain);
@@ -843,7 +845,7 @@ static SIMPLE_DEV_PM_OPS(dwapb_gpio_pm_ops, dwapb_gpio_suspend,
 
 static struct platform_driver dwapb_gpio_driver = {
        .driver         = {
-               .name   = "gpio-dwapb",
+               .name   = DWAPB_DRIVER_NAME,
                .pm     = &dwapb_gpio_pm_ops,
                .of_match_table = of_match_ptr(dwapb_of_match),
                .acpi_match_table = ACPI_PTR(dwapb_acpi_match),
@@ -857,3 +859,4 @@ module_platform_driver(dwapb_gpio_driver);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Jamie Iles");
 MODULE_DESCRIPTION("Synopsys DesignWare APB GPIO driver");
+MODULE_ALIAS("platform:" DWAPB_DRIVER_NAME);