Pass programmer context to programmer->init()

Change-Id: I064eb4e25c3d382e4e5bde802306698fafe5e1d0
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/72526
diff --git a/include/programmer.h b/include/programmer.h
index f45aab9..2684b08 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -40,6 +40,7 @@
 	const char *device_name;
 };
 
+struct flashprog_programmer;
 struct programmer_entry {
 	const char *name;
 	const enum programmer_type type;
@@ -48,7 +49,7 @@
 		const char *const note;
 	} devs;
 
-	int (*init) (void);
+	int (*init) (struct flashprog_programmer *);
 
 	void (*delay) (unsigned int usecs);
 };
@@ -377,9 +378,9 @@
 
 #if CONFIG_LINUX_MTD == 1 && LINUX_MTD_AS_INTERNAL == 1
 /* trivial wrapper to avoid cluttering internal_init() with #if */
-static inline int try_mtd(void) { return programmer_linux_mtd.init(); };
+static inline int try_mtd(struct flashprog_programmer *prog) { return programmer_linux_mtd.init(prog); };
 #else
-static inline int try_mtd(void) { return 1; };
+static inline int try_mtd(struct flashprog_programmer *prog) { return 1; };
 #endif
 
 /* mcp6x_spi.c */