Extract chip selfcheck into new selfcheck_chip() function

We're going to call it from the SFDP parser, too.

Change-Id: Ib526d005b84717d4be69cc2dff46cf628af4c9cd
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/392
diff --git a/include/flash.h b/include/flash.h
index 67853cb..4304bb8 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -543,6 +543,7 @@
 int verify_range(struct flashctx *flash, const uint8_t *cmpbuf, unsigned int start, unsigned int len);
 void emergency_help_message(void);
 void list_programmers_linebreak(int startcol, int cols, int paren);
+int selfcheck_chip(const struct flashchip *, int idx);
 int selfcheck(void);
 int read_buf_from_file(unsigned char *buf, unsigned long size, const char *filename);
 int write_buf_to_file(const unsigned char *buf, unsigned long size, const char *filename);