public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] spi: cadence_qspi: Fix checking return value of fdt_first_subnode()
@ 2015-01-07  1:54 Axel Lin
  2015-01-07  7:02 ` Jagan Teki
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2015-01-07  1:54 UTC (permalink / raw)
  To: u-boot

fdt_first_subnode() returns -FDT_ERR_NOTFOUND if no subnode found.
0 is supposed to be a valid offset returns from fdt_first_subnode().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/spi/cadence_qspi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
index fa95b19..98ae3b8 100644
--- a/drivers/spi/cadence_qspi.c
+++ b/drivers/spi/cadence_qspi.c
@@ -297,7 +297,7 @@ static int cadence_spi_ofdata_to_platdata(struct udevice *bus)
 
 	/* All other paramters are embedded in the child node */
 	subnode = fdt_first_subnode(blob, node);
-	if (!subnode) {
+	if (subnode < 0) {
 		printf("Error: subnode with SPI flash config missing!\n");
 		return -ENODEV;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-07  7:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-07  1:54 [U-Boot] [PATCH] spi: cadence_qspi: Fix checking return value of fdt_first_subnode() Axel Lin
2015-01-07  7:02 ` Jagan Teki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox