summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2007-10-17 17:26:54 +0000
committerGabor Juhos <juhosg@openwrt.org>2007-10-17 17:26:54 +0000
commit5044a3267a397f65e24f4eb23d74250ee496005b (patch)
tree649b620ec817335d029351cb8f5051f239f986ee
parent49b631d7305b1311b54a8c41daa2f10a0968ca80 (diff)
downloadmtk-20170518-5044a3267a397f65e24f4eb23d74250ee496005b.zip
mtk-20170518-5044a3267a397f65e24f4eb23d74250ee496005b.tar.gz
mtk-20170518-5044a3267a397f65e24f4eb23d74250ee496005b.tar.bz2
fix initcall level in i2c-gpio-custom driver if not built as a module
SVN-Revision: 9341
-rw-r--r--target/linux/adm5120/files/drivers/i2c/busses/i2c-gpio-custom.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/target/linux/adm5120/files/drivers/i2c/busses/i2c-gpio-custom.c b/target/linux/adm5120/files/drivers/i2c/busses/i2c-gpio-custom.c
index 9d62a2d..36a8bf0 100644
--- a/target/linux/adm5120/files/drivers/i2c/busses/i2c-gpio-custom.c
+++ b/target/linux/adm5120/files/drivers/i2c/busses/i2c-gpio-custom.c
@@ -144,7 +144,7 @@ err:
return err;
}
-static int __init i2c_gpio_custom_init(void)
+static int __init i2c_gpio_custom_probe(void)
{
int err;
@@ -174,6 +174,12 @@ err:
i2c_gpio_custom_cleanup();
return err;
}
+
+#ifdef MODULE
+static int __init i2c_gpio_custom_init(void)
+{
+ return i2c_gpio_custom_probe();
+}
module_init(i2c_gpio_custom_init);
static void __exit i2c_gpio_custom_exit(void)
@@ -181,10 +187,11 @@ static void __exit i2c_gpio_custom_exit(void)
i2c_gpio_custom_cleanup();
}
module_exit(i2c_gpio_custom_exit);
-
+#else
+subsys_initcall(i2c_gpio_custom_probe);
+#endif /* MODULE*/
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Gabor Juhos <juhosg at openwrt.org >");
MODULE_DESCRIPTION(DRV_DESC);
MODULE_VERSION(DRV_VERSION);
-