Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fc1cf5f authored by Joe Schultz's avatar Joe Schultz Committed by Brian Norris
Browse files

mtd: physmap_of: Add read-only fallback



Previously, when probing a CFI chip which was write-protected at the
hardware level, the probe would fail due to the fact it could not put
the chip into QUERY mode. This would result in no MTD devices being
created.

Add a fallback to probe using the map_rom driver if the user-selected
probe fails.

Signed-off-by: default avatarJoe Schultz <jschultz@xes-inc.com>
Signed-off-by: default avatarAaron Sierra <asierra@xes-inc.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 106effbe
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -269,6 +269,16 @@ static int of_flash_probe(struct platform_device *dev)
			info->list[i].mtd = obsolete_probe(dev,
			info->list[i].mtd = obsolete_probe(dev,
							   &info->list[i].map);
							   &info->list[i].map);
		}
		}

		/* Fall back to mapping region as ROM */
		if (!info->list[i].mtd) {
			dev_warn(&dev->dev,
				"do_map_probe() failed for type %s\n",
				 probe_type);

			info->list[i].mtd = do_map_probe("map_rom",
							 &info->list[i].map);
		}
		mtd_list[i] = info->list[i].mtd;
		mtd_list[i] = info->list[i].mtd;


		err = -ENXIO;
		err = -ENXIO;