* [PATCH 1/1] block: Fix id of xsysace with missing port-number
@ 2012-11-14 16:27 Gernot Vormayr
0 siblings, 0 replies; only message in thread
From: Gernot Vormayr @ 2012-11-14 16:27 UTC (permalink / raw)
To: Grant Likely; +Cc: linux-kernel, Gernot Vormayr
Since id is u32 the comparsion < 0 will fail. The right way
would be to check the return value of of_property_read_u32
Tested on ml507 board.
Signed-off-by: Gernot Vormayr <gvormayr@gmail.com>
---
drivers/block/xsysace.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 1a17e33..b115e1f 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -1162,8 +1162,7 @@ static int __devinit ace_probe(struct platform_device *dev)
dev_dbg(&dev->dev, "ace_probe(%p)\n", dev);
/* device id and bus width */
- of_property_read_u32(dev->dev.of_node, "port-number", &id);
- if (id < 0)
+ if (of_property_read_u32(dev->dev.of_node, "port-number", &id))
id = 0;
if (of_find_property(dev->dev.of_node, "8-bit", NULL))
bus_width = ACE_BUS_WIDTH_8;
--
1.7.9.5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-11-14 16:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-14 16:27 [PATCH 1/1] block: Fix id of xsysace with missing port-number Gernot Vormayr
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®