drivers/block/xsysace.c: fix id with missing port-number
authorGernot Vormayr <gvormayr@gmail.com>
Fri, 24 May 2013 22:55:03 +0000 (15:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 24 May 2013 23:22:50 +0000 (16:22 -0700)
If the port number is missing from the device-tree the device gets named
xs` instead of xsa.  This fixes the check for missing ids.

Tested on ml507 board.

Signed-off-by: Gernot Vormayr <gvormayr@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/xsysace.c

index f8ef15f37c5ec67eb6a35151b756c7496a1a666d..3fd130fdfbc1f742aa706ea96aa5d20361d05d37 100644 (file)
@@ -1160,8 +1160,7 @@ static int 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;