aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/programmer.h9
-rw-r--r--internal.c2
2 files changed, 7 insertions, 4 deletions
diff --git a/include/programmer.h b/include/programmer.h
index a7cea5e7..17abfd22 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -375,12 +375,15 @@ void exit_conf_mode_ite(uint16_t port);
void probe_superio_ite(void);
int init_superio_ite(const struct programmer_cfg *cfg);
-#if CONFIG_LINUX_MTD == 1
/* trivial wrapper to avoid cluttering internal_init() with #if */
-static inline int try_mtd(void) { return programmer_linux_mtd.init(NULL); };
+static inline int try_mtd(const struct programmer_cfg *cfg)
+{
+#if CONFIG_LINUX_MTD == 1
+ return programmer_linux_mtd.init(cfg);
#else
-static inline int try_mtd(void) { return 1; };
+ return 1;
#endif
+}
/* mcp6x_spi.c */
int mcp6x_spi_init(int want_spi);
diff --git a/internal.c b/internal.c
index 43aa51bc..6a8db5e6 100644
--- a/internal.c
+++ b/internal.c
@@ -215,7 +215,7 @@ static int internal_init(const struct programmer_cfg *cfg)
*/
internal_buses_supported = BUS_NONSPI;
- if (try_mtd() == 0) {
+ if (try_mtd(cfg) == 0) {
ret = 0;
goto internal_init_exit;
}