summaryrefslogtreecommitdiff
path: root/io-module
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2022-02-17 18:23:05 -0600
committerJohn Klug <john.klug@multitech.com>2022-02-17 18:55:00 -0600
commitf18fbc09223234947b22434b5fa7fd684d17f448 (patch)
tree404be38f1bce48213440535c395b3242f5dbe05a /io-module
parent9934194837157908acdf39665a4730d46176eb83 (diff)
downloadmts-io-f18fbc09223234947b22434b5fa7fd684d17f448.tar.gz
mts-io-f18fbc09223234947b22434b5fa7fd684d17f448.tar.bz2
mts-io-f18fbc09223234947b22434b5fa7fd684d17f448.zip
Unload the driver if platform_driver register fails, add README to explain the history of MTS-IO4.9.1
Diffstat (limited to 'io-module')
-rw-r--r--io-module/mts-io.c14
-rw-r--r--io-module/version.h2
2 files changed, 9 insertions, 7 deletions
diff --git a/io-module/mts-io.c b/io-module/mts-io.c
index db736f9..d65c7ea 100644
--- a/io-module/mts-io.c
+++ b/io-module/mts-io.c
@@ -1347,12 +1347,7 @@ static int __init mts_io_init(void)
log_info("init: " DRIVER_VERSION);
/* We do a platform_driver_register to do a probe
- * of device tree and set the pinctrl. We then
- * unregister to remove
- * the probe function. If we don't remove the
- * probe function, we will do a 2nd probe in
- * platform_device_add, which will result in a
- * stack trace in the log. */
+ * of device tree and set the pinctrl/gpio settings. */
ret = platform_driver_register(&mts_io_driver);
if (ret) {
printk(KERN_ERR "mts-io: probe failed: %d\n", ret);
@@ -1360,6 +1355,13 @@ static int __init mts_io_init(void)
return ret;
}
+ /* Without a platform device our EEPROM load will
+ * not work, and we cannot continue. */
+ if (mts_io_platform_device == NULL) {
+ pr_err("mts-io: probe failed, possible bad device tree\n");
+ return -ENODEV;
+ }
+
/* request_firmware() requires a device, so call after device allocated */
ret = mts_id_eeprom_load();
diff --git a/io-module/version.h b/io-module/version.h
index a97e7df..b72c4b0 100644
--- a/io-module/version.h
+++ b/io-module/version.h
@@ -1,7 +1,7 @@
#ifndef __VERSION_H
#define __VERSION_H
-#define DRIVER_VERSION "v4.9.0"
+#define DRIVER_VERSION "v4.9.1"
#define DRIVER_AUTHOR "Multitech Systems"
#define DRIVER_DESC "MTS-IO Controller"
#define DRIVER_NAME "mts-io"