ttyFDC: Fix build problems due to use of module_{init,exit}
authorJames Hogan <james.hogan@imgtec.com>
Tue, 6 Oct 2015 14:12:06 +0000 (15:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Oct 2015 04:29:21 +0000 (21:29 -0700)
Commit 0fd972a7d91d (module: relocate module_init from init.h to
module.h) broke the build of ttyFDC driver due to that driver's (mis)use
of module_mips_cdmm_driver() without first including module.h, for
example:

In file included from ./arch/mips/include/asm/cdmm.h +11 :0,
                 from drivers/tty/mips_ejtag_fdc.c +34 :
include/linux/device.h +1295 :1: warning: data definition has no type or storage class
./arch/mips/include/asm/cdmm.h +84 :2: note: in expansion of macro ‘module_driver’
drivers/tty/mips_ejtag_fdc.c +1157 :1: note: in expansion of macro ‘module_mips_cdmm_driver’
include/linux/device.h +1295 :1: error: type defaults to ‘int’ in declaration of ‘module_init’ [-Werror=implicit-int]
./arch/mips/include/asm/cdmm.h +84 :2: note: in expansion of macro ‘module_driver’
drivers/tty/mips_ejtag_fdc.c +1157 :1: note: in expansion of macro ‘module_mips_cdmm_driver’
drivers/tty/mips_ejtag_fdc.c +1157 :1: warning: parameter names (without types) in function declaration

Instead of just adding the module.h include, switch to using the new
builtin_mips_cdmm_driver() helper macro and drop the remove callback,
since it isn't needed. If module support is added later, the code can
always be resurrected.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 4.2.x-
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/mips_ejtag_fdc.c

index 5a6d0b5cd18b839d43f8b2887adf8a852cbedbfb..a119176a18551a19c59a0ee1750d89c67818ce05 100644 (file)
@@ -1048,38 +1048,6 @@ err_destroy_ports:
        return ret;
 }
 
-static int mips_ejtag_fdc_tty_remove(struct mips_cdmm_device *dev)
-{
-       struct mips_ejtag_fdc_tty *priv = mips_cdmm_get_drvdata(dev);
-       struct mips_ejtag_fdc_tty_port *dport;
-       int nport;
-       unsigned int cfg;
-
-       if (priv->irq >= 0) {
-               raw_spin_lock_irq(&priv->lock);
-               cfg = mips_ejtag_fdc_read(priv, REG_FDCFG);
-               /* Disable interrupts */
-               cfg &= ~(REG_FDCFG_TXINTTHRES | REG_FDCFG_RXINTTHRES);
-               cfg |= REG_FDCFG_TXINTTHRES_DISABLED;
-               cfg |= REG_FDCFG_RXINTTHRES_DISABLED;
-               mips_ejtag_fdc_write(priv, REG_FDCFG, cfg);
-               raw_spin_unlock_irq(&priv->lock);
-       } else {
-               priv->removing = true;
-               del_timer_sync(&priv->poll_timer);
-       }
-       kthread_stop(priv->thread);
-       if (dev->cpu == 0)
-               mips_ejtag_fdc_con.tty_drv = NULL;
-       tty_unregister_driver(priv->driver);
-       for (nport = 0; nport < NUM_TTY_CHANNELS; nport++) {
-               dport = &priv->ports[nport];
-               tty_port_destroy(&dport->port);
-       }
-       put_tty_driver(priv->driver);
-       return 0;
-}
-
 static int mips_ejtag_fdc_tty_cpu_down(struct mips_cdmm_device *dev)
 {
        struct mips_ejtag_fdc_tty *priv = mips_cdmm_get_drvdata(dev);
@@ -1152,12 +1120,11 @@ static struct mips_cdmm_driver mips_ejtag_fdc_tty_driver = {
                .name   = "mips_ejtag_fdc",
        },
        .probe          = mips_ejtag_fdc_tty_probe,
-       .remove         = mips_ejtag_fdc_tty_remove,
        .cpu_down       = mips_ejtag_fdc_tty_cpu_down,
        .cpu_up         = mips_ejtag_fdc_tty_cpu_up,
        .id_table       = mips_ejtag_fdc_tty_ids,
 };
-module_mips_cdmm_driver(mips_ejtag_fdc_tty_driver);
+builtin_mips_cdmm_driver(mips_ejtag_fdc_tty_driver);
 
 static int __init mips_ejtag_fdc_init_console(void)
 {