]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
HSI: omap_ssi: built omap_ssi and omap_ssi_port into one module
authorSebastian Reichel <sre@kernel.org>
Sat, 30 Apr 2016 01:24:09 +0000 (03:24 +0200)
committerSebastian Reichel <sre@kernel.org>
Mon, 2 May 2016 19:56:21 +0000 (21:56 +0200)
Merge omap_ssi and omap_ssi_port into one module. This
fixes problems with module cycle dependencies introduced
by future patches.

Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/hsi/controllers/Kconfig
drivers/hsi/controllers/Makefile
drivers/hsi/controllers/omap_ssi.h
drivers/hsi/controllers/omap_ssi_core.c [moved from drivers/hsi/controllers/omap_ssi.c with 97% similarity]
drivers/hsi/controllers/omap_ssi_port.c

index 6aba2780817227bdcff05132f10bd8d8eeabceb7..084ec97eec64e192ba5236a3ffc4bd94ff0e75e0 100644 (file)
@@ -12,8 +12,3 @@ config OMAP_SSI
          If you say Y here, you will enable the OMAP SSI hardware driver.
 
          If unsure, say N.
-
-config OMAP_SSI_PORT
-       tristate
-       default m if OMAP_SSI=m
-       default y if OMAP_SSI=y
index d2665cf9c5450e4a951d129a6de253df79972525..7aba9c7f71bb23c4ac922cea4d2efb8ed73b571d 100644 (file)
@@ -2,5 +2,5 @@
 # Makefile for HSI controllers drivers
 #
 
-obj-$(CONFIG_OMAP_SSI)         += omap_ssi.o
-obj-$(CONFIG_OMAP_SSI_PORT)    += omap_ssi_port.o
+omap_ssi-objs          += omap_ssi_core.o omap_ssi_port.o
+obj-$(CONFIG_OMAP_SSI) += omap_ssi.o
index 1fa028078a3cf0b2c523fdd7b755354bb1243ee5..e493321cb0c3798b560a698e75b9c8a6ed4318b9 100644 (file)
@@ -164,4 +164,6 @@ struct omap_ssi_controller {
 #endif
 };
 
+extern struct platform_driver ssi_port_pdriver;
+
 #endif /* __LINUX_HSI_OMAP_SSI_H__ */
similarity index 97%
rename from drivers/hsi/controllers/omap_ssi.c
rename to drivers/hsi/controllers/omap_ssi_core.c
index 68dfdaa19938bb6ada1e524d8166f6773305b391..535c76038288121a4aeb7c8cc9d93b5f62e35102 100644 (file)
@@ -605,7 +605,22 @@ static struct platform_driver ssi_pdriver = {
        },
 };
 
-module_platform_driver(ssi_pdriver);
+static int __init ssi_init(void) {
+       int ret;
+
+       ret = platform_driver_register(&ssi_pdriver);
+       if (ret)
+               return ret;
+
+       return platform_driver_register(&ssi_port_pdriver);
+}
+module_init(ssi_init);
+
+static void __exit ssi_exit(void) {
+       platform_driver_unregister(&ssi_port_pdriver);
+       platform_driver_unregister(&ssi_pdriver);
+}
+module_exit(ssi_exit);
 
 MODULE_ALIAS("platform:omap_ssi");
 MODULE_AUTHOR("Carlos Chinea <carlos.chinea@nokia.com>");
index 530095ed39e748b5fab254dbe77586722fb70fab..1569bbb53ee8cfe49442083c6de2161a723245c6 100644 (file)
@@ -1117,11 +1117,6 @@ static int ssi_port_probe(struct platform_device *pd)
 
        dev_dbg(&pd->dev, "init ssi port...\n");
 
-       if (!try_module_get(ssi->owner)) {
-               dev_err(&pd->dev, "could not increment parent module refcount\n");
-               return -ENODEV;
-       }
-
        if (!ssi->port || !omap_ssi->port) {
                dev_err(&pd->dev, "ssi controller not initialized!\n");
                err = -ENODEV;
@@ -1242,7 +1237,6 @@ static int ssi_port_remove(struct platform_device *pd)
 
        omap_ssi->port[omap_port->port_id] = NULL;
        platform_set_drvdata(pd, NULL);
-       module_put(ssi->owner);
        pm_runtime_disable(&pd->dev);
 
        return 0;
@@ -1369,7 +1363,7 @@ MODULE_DEVICE_TABLE(of, omap_ssi_port_of_match);
 #define omap_ssi_port_of_match NULL
 #endif
 
-static struct platform_driver ssi_port_pdriver = {
+struct platform_driver ssi_port_pdriver = {
        .probe = ssi_port_probe,
        .remove = ssi_port_remove,
        .driver = {
@@ -1378,11 +1372,3 @@ static struct platform_driver ssi_port_pdriver = {
                .pm     = DEV_PM_OPS,
        },
 };
-
-module_platform_driver(ssi_port_pdriver);
-
-MODULE_ALIAS("platform:omap_ssi_port");
-MODULE_AUTHOR("Carlos Chinea <carlos.chinea@nokia.com>");
-MODULE_AUTHOR("Sebastian Reichel <sre@kernel.org>");
-MODULE_DESCRIPTION("Synchronous Serial Interface Port Driver");
-MODULE_LICENSE("GPL v2");