sfdp: Move hints about SFDP detection into spi_prepare_sfdp()

Now that the preparation is only run when we are actually going to use
the SFDP definition, we can do the logging there, unconditionally.

Change-Id: I9abb22178799c2d2f1098f0d578ac3231983fb19
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/487
diff --git a/flashprog.c b/flashprog.c
index 0b802a7..8746e4e 100644
--- a/flashprog.c
+++ b/flashprog.c
@@ -332,7 +332,7 @@
 }
 
 /* Returns the number of well-defined erasers for a chip. */
-static unsigned int count_usable_erasers(const struct flashctx *flash)
+unsigned int flashprog_count_usable_erasers(const struct flashctx *flash)
 {
 	unsigned int usable_erasefunctions = 0;
 	int k;
@@ -755,28 +755,6 @@
 		 * one for this programmer interface (master) and thus no other chip has
 		 * been found on this interface.
 		 */
-		if (startchip == 0 && flash->chip->id.model == SFDP_DEVICE_ID) {
-			msg_cinfo("===\n"
-				  "SFDP has autodetected a flash chip which is "
-				  "not natively supported by flashprog yet.\n");
-			if (count_usable_erasers(flash) == 0)
-				msg_cinfo("The standard operations read and "
-					  "verify should work, but to support "
-					  "erase, write and all other "
-					  "possible features");
-			else
-				msg_cinfo("All standard operations (read, "
-					  "verify, erase and write) should "
-					  "work, but to support all possible "
-					  "features");
-
-			msg_cinfo(" we need to add them manually.\n"
-				  "You can help us by mailing us the output of the following command to "
-				  "flashprog@flashprog.org:\n"
-				  "'flashprog -VV [plus the -p/--programmer parameter]'\n"
-				  "Thanks for your help!\n"
-				  "===\n");
-		}
 
 		/* First flash chip detected on this bus. */
 		if (startchip == 0)
@@ -1084,7 +1062,7 @@
 static int create_erase_layout(struct flashctx *const flashctx, struct erase_layout **e_layout)
 {
 	const struct flashchip *chip = flashctx->chip;
-	const size_t erasefn_count = count_usable_erasers(flashctx);
+	const size_t erasefn_count = flashprog_count_usable_erasers(flashctx);
 
 	if (!erasefn_count) {
 		msg_gerr("No erase functions supported\n");
@@ -1737,7 +1715,7 @@
 				return 1;
 			msg_cerr("Continuing anyway.\n");
 		}
-		if(count_usable_erasers(flash) == 0) {
+		if(flashprog_count_usable_erasers(flash) == 0) {
 			msg_cerr("flashprog has no erase function for this "
 				 "flash chip.\n");
 			return 1;