Jonathon Hall has uploaded this change for review.

View Change

internal: Pass programmer_cfg() through to MTD init

extract_programmer_param_str() requires a valid cfg since 813c68a.

Pass cfg through to try_mtd() and linux_mtd_init().

Test: Build with linux_mtd enabled, run with -p internal to ensure
flashrom doesn't crash.

Change-Id: I194ee0318c3bf829868e7b3c368ab45b3d2b3721
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
---
M include/programmer.h
M internal.c
2 files changed, 20 insertions(+), 3 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/44/67744/1
diff --git a/include/programmer.h b/include/programmer.h
index a7cea5e..12d7d7b 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -377,9 +377,9 @@

#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) { return programmer_linux_mtd.init(cfg); };
#else
-static inline int try_mtd(void) { return 1; };
+static inline int try_mtd(const struct programmer_cfg *cfg) { return 1; };
#endif

/* mcp6x_spi.c */
diff --git a/internal.c b/internal.c
index 43aa51b..6a8db5e 100644
--- a/internal.c
+++ b/internal.c
@@ -215,7 +215,7 @@
*/
internal_buses_supported = BUS_NONSPI;

- if (try_mtd() == 0) {
+ if (try_mtd(cfg) == 0) {
ret = 0;
goto internal_init_exit;
}

To view, visit change 67744. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I194ee0318c3bf829868e7b3c368ab45b3d2b3721
Gerrit-Change-Number: 67744
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathon Hall <jonathon.hall@puri.sm>
Gerrit-MessageType: newchange