Let the flash context directly point to the used master

We used to have a pointer to a full `registered_master` struct in
our flash context. Beside the used master, this contained a bit
mask of supported buses. Oddly convenient, this bit mask invited
to bypass the chip driver and break the abstraction. It allowed
to place bus-specific details virtually anywhere in flashprog,
making it harder to find a good place for them.

So, get rid of the `buses_supported` bit mask by pointing directly
to the master. Only the chip driver will implicitly know which type
of master is used.

Change-Id: I9ce13d8df0e7ccc67519d888dd9cb2e2ff8d6682
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/72533
diff --git a/linux_mtd.c b/linux_mtd.c
index ca05305..e52b8a5 100644
--- a/linux_mtd.c
+++ b/linux_mtd.c
@@ -175,7 +175,7 @@
 
 static int linux_mtd_probe(struct flashctx *flash)
 {
-	struct linux_mtd_data *data = flash->mst->opaque.data;
+	struct linux_mtd_data *data = flash->mst.opaque->data;
 
 	if (data->no_erase)
 		flash->chip->feature_bits |= FEATURE_NO_ERASE;
@@ -190,7 +190,7 @@
 static int linux_mtd_read(struct flashctx *flash, uint8_t *buf,
 			  unsigned int start, unsigned int len)
 {
-	struct linux_mtd_data *data = flash->mst->opaque.data;
+	struct linux_mtd_data *data = flash->mst.opaque->data;
 	unsigned int eb_size = flash->chip->block_erasers[0].eraseblocks[0].size;
 	unsigned int i;
 
@@ -224,7 +224,7 @@
 static int linux_mtd_write(struct flashctx *flash, const uint8_t *buf,
 				unsigned int start, unsigned int len)
 {
-	struct linux_mtd_data *data = flash->mst->opaque.data;
+	struct linux_mtd_data *data = flash->mst.opaque->data;
 	unsigned int chunksize = flash->chip->block_erasers[0].eraseblocks[0].size;
 	unsigned int i;
 
@@ -265,7 +265,7 @@
 static int linux_mtd_erase(struct flashctx *flash,
 			unsigned int start, unsigned int len)
 {
-	struct linux_mtd_data *data = flash->mst->opaque.data;
+	struct linux_mtd_data *data = flash->mst.opaque->data;
 	uint32_t u;
 
 	if (data->no_erase) {