Skip to contentSkip to conversation

block: Fix id of xsysace with missing port-number

PATCH Superseded Gernot Vormayr 1 participant 1 message Nov 14, 2012 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: Fix id of xsysace with missing port-number

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.

---
 drivers/block/xsysace.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/block/xsysace.c +1 -2
index 1a17e33..b115e1f 100644
@@ -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;
Signature · 1 line
1.7.9.5