samples: drivers: jesd216: check return value of flash_sfdp_read()
Check the return value of flash_sfdp_read() and print error message if not successful. Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit is contained in:
parent
f5d606ef72
commit
8b94d67dc8
|
@ -241,6 +241,13 @@ void main(void)
|
||||||
} u;
|
} u;
|
||||||
const struct jesd216_sfdp_header *hp = &u.sfdp;
|
const struct jesd216_sfdp_header *hp = &u.sfdp;
|
||||||
int rc = flash_sfdp_read(dev, 0, u.raw, sizeof(u.raw));
|
int rc = flash_sfdp_read(dev, 0, u.raw, sizeof(u.raw));
|
||||||
|
|
||||||
|
if (rc != 0) {
|
||||||
|
printf("Read SFDP not supported: device not JESD216-compliant "
|
||||||
|
"(err %d)\n", rc);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t magic = jesd216_sfdp_magic(hp);
|
uint32_t magic = jesd216_sfdp_magic(hp);
|
||||||
|
|
||||||
if (magic != JESD216_SFDP_MAGIC) {
|
if (magic != JESD216_SFDP_MAGIC) {
|
||||||
|
|
Loading…
Reference in a new issue