diff options
author | Sebastian Reichel <sre@kernel.org> | 2016-04-29 21:24:09 -0400 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2016-05-02 15:56:21 -0400 |
commit | 0fae198988b873d30fe9ecb6a6271afb36df97e9 (patch) | |
tree | 8799cca9edc3e06c29882b64321aa2c2da255bc0 /drivers/hsi | |
parent | 2a57aba8503d5694ee113016cb1a107831b8236f (diff) |
HSI: omap_ssi: built omap_ssi and omap_ssi_port into one module
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>
Diffstat (limited to 'drivers/hsi')
-rw-r--r-- | drivers/hsi/controllers/Kconfig | 5 | ||||
-rw-r--r-- | drivers/hsi/controllers/Makefile | 4 | ||||
-rw-r--r-- | drivers/hsi/controllers/omap_ssi.h | 2 | ||||
-rw-r--r-- | drivers/hsi/controllers/omap_ssi_core.c (renamed from drivers/hsi/controllers/omap_ssi.c) | 17 | ||||
-rw-r--r-- | drivers/hsi/controllers/omap_ssi_port.c | 16 |
5 files changed, 21 insertions, 23 deletions
diff --git a/drivers/hsi/controllers/Kconfig b/drivers/hsi/controllers/Kconfig index 6aba27808172..084ec97eec64 100644 --- a/drivers/hsi/controllers/Kconfig +++ b/drivers/hsi/controllers/Kconfig | |||
@@ -12,8 +12,3 @@ config OMAP_SSI | |||
12 | If you say Y here, you will enable the OMAP SSI hardware driver. | 12 | If you say Y here, you will enable the OMAP SSI hardware driver. |
13 | 13 | ||
14 | If unsure, say N. | 14 | If unsure, say N. |
15 | |||
16 | config OMAP_SSI_PORT | ||
17 | tristate | ||
18 | default m if OMAP_SSI=m | ||
19 | default y if OMAP_SSI=y | ||
diff --git a/drivers/hsi/controllers/Makefile b/drivers/hsi/controllers/Makefile index d2665cf9c545..7aba9c7f71bb 100644 --- a/drivers/hsi/controllers/Makefile +++ b/drivers/hsi/controllers/Makefile | |||
@@ -2,5 +2,5 @@ | |||
2 | # Makefile for HSI controllers drivers | 2 | # Makefile for HSI controllers drivers |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-$(CONFIG_OMAP_SSI) += omap_ssi.o | 5 | omap_ssi-objs += omap_ssi_core.o omap_ssi_port.o |
6 | obj-$(CONFIG_OMAP_SSI_PORT) += omap_ssi_port.o | 6 | obj-$(CONFIG_OMAP_SSI) += omap_ssi.o |
diff --git a/drivers/hsi/controllers/omap_ssi.h b/drivers/hsi/controllers/omap_ssi.h index 1fa028078a3c..e493321cb0c3 100644 --- a/drivers/hsi/controllers/omap_ssi.h +++ b/drivers/hsi/controllers/omap_ssi.h | |||
@@ -164,4 +164,6 @@ struct omap_ssi_controller { | |||
164 | #endif | 164 | #endif |
165 | }; | 165 | }; |
166 | 166 | ||
167 | extern struct platform_driver ssi_port_pdriver; | ||
168 | |||
167 | #endif /* __LINUX_HSI_OMAP_SSI_H__ */ | 169 | #endif /* __LINUX_HSI_OMAP_SSI_H__ */ |
diff --git a/drivers/hsi/controllers/omap_ssi.c b/drivers/hsi/controllers/omap_ssi_core.c index 68dfdaa19938..535c76038288 100644 --- a/drivers/hsi/controllers/omap_ssi.c +++ b/drivers/hsi/controllers/omap_ssi_core.c | |||
@@ -605,7 +605,22 @@ static struct platform_driver ssi_pdriver = { | |||
605 | }, | 605 | }, |
606 | }; | 606 | }; |
607 | 607 | ||
608 | module_platform_driver(ssi_pdriver); | 608 | static int __init ssi_init(void) { |
609 | int ret; | ||
610 | |||
611 | ret = platform_driver_register(&ssi_pdriver); | ||
612 | if (ret) | ||
613 | return ret; | ||
614 | |||
615 | return platform_driver_register(&ssi_port_pdriver); | ||
616 | } | ||
617 | module_init(ssi_init); | ||
618 | |||
619 | static void __exit ssi_exit(void) { | ||
620 | platform_driver_unregister(&ssi_port_pdriver); | ||
621 | platform_driver_unregister(&ssi_pdriver); | ||
622 | } | ||
623 | module_exit(ssi_exit); | ||
609 | 624 | ||
610 | MODULE_ALIAS("platform:omap_ssi"); | 625 | MODULE_ALIAS("platform:omap_ssi"); |
611 | MODULE_AUTHOR("Carlos Chinea <carlos.chinea@nokia.com>"); | 626 | MODULE_AUTHOR("Carlos Chinea <carlos.chinea@nokia.com>"); |
diff --git a/drivers/hsi/controllers/omap_ssi_port.c b/drivers/hsi/controllers/omap_ssi_port.c index 530095ed39e7..1569bbb53ee8 100644 --- a/drivers/hsi/controllers/omap_ssi_port.c +++ b/drivers/hsi/controllers/omap_ssi_port.c | |||
@@ -1117,11 +1117,6 @@ static int ssi_port_probe(struct platform_device *pd) | |||
1117 | 1117 | ||
1118 | dev_dbg(&pd->dev, "init ssi port...\n"); | 1118 | dev_dbg(&pd->dev, "init ssi port...\n"); |
1119 | 1119 | ||
1120 | if (!try_module_get(ssi->owner)) { | ||
1121 | dev_err(&pd->dev, "could not increment parent module refcount\n"); | ||
1122 | return -ENODEV; | ||
1123 | } | ||
1124 | |||
1125 | if (!ssi->port || !omap_ssi->port) { | 1120 | if (!ssi->port || !omap_ssi->port) { |
1126 | dev_err(&pd->dev, "ssi controller not initialized!\n"); | 1121 | dev_err(&pd->dev, "ssi controller not initialized!\n"); |
1127 | err = -ENODEV; | 1122 | err = -ENODEV; |
@@ -1242,7 +1237,6 @@ static int ssi_port_remove(struct platform_device *pd) | |||
1242 | 1237 | ||
1243 | omap_ssi->port[omap_port->port_id] = NULL; | 1238 | omap_ssi->port[omap_port->port_id] = NULL; |
1244 | platform_set_drvdata(pd, NULL); | 1239 | platform_set_drvdata(pd, NULL); |
1245 | module_put(ssi->owner); | ||
1246 | pm_runtime_disable(&pd->dev); | 1240 | pm_runtime_disable(&pd->dev); |
1247 | 1241 | ||
1248 | return 0; | 1242 | return 0; |
@@ -1369,7 +1363,7 @@ MODULE_DEVICE_TABLE(of, omap_ssi_port_of_match); | |||
1369 | #define omap_ssi_port_of_match NULL | 1363 | #define omap_ssi_port_of_match NULL |
1370 | #endif | 1364 | #endif |
1371 | 1365 | ||
1372 | static struct platform_driver ssi_port_pdriver = { | 1366 | struct platform_driver ssi_port_pdriver = { |
1373 | .probe = ssi_port_probe, | 1367 | .probe = ssi_port_probe, |
1374 | .remove = ssi_port_remove, | 1368 | .remove = ssi_port_remove, |
1375 | .driver = { | 1369 | .driver = { |
@@ -1378,11 +1372,3 @@ static struct platform_driver ssi_port_pdriver = { | |||
1378 | .pm = DEV_PM_OPS, | 1372 | .pm = DEV_PM_OPS, |
1379 | }, | 1373 | }, |
1380 | }; | 1374 | }; |
1381 | |||
1382 | module_platform_driver(ssi_port_pdriver); | ||
1383 | |||
1384 | MODULE_ALIAS("platform:omap_ssi_port"); | ||
1385 | MODULE_AUTHOR("Carlos Chinea <carlos.chinea@nokia.com>"); | ||
1386 | MODULE_AUTHOR("Sebastian Reichel <sre@kernel.org>"); | ||
1387 | MODULE_DESCRIPTION("Synchronous Serial Interface Port Driver"); | ||
1388 | MODULE_LICENSE("GPL v2"); | ||