[RAPIDIO] Auto-probe the RapidIO system size
[pandora-kernel.git] / drivers / rapidio / rio-sysfs.c
index 659e311..97a147f 100644 (file)
@@ -43,7 +43,8 @@ static ssize_t routes_show(struct device *dev, struct device_attribute *attr, ch
        if (!rdev->rswitch)
                goto out;
 
-       for (i = 0; i < RIO_MAX_ROUTE_ENTRIES; i++) {
+       for (i = 0; i < RIO_MAX_ROUTE_ENTRIES(rdev->net->hport->sys_size);
+                       i++) {
                if (rdev->rswitch->route_table[i] == RIO_INVALID_ROUTE)
                        continue;
                str +=