diff options
Diffstat (limited to 'drivers/bcma')
-rw-r--r-- | drivers/bcma/scan.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c index cd6b20fce680..37768401d113 100644 --- a/drivers/bcma/scan.c +++ b/drivers/bcma/scan.c | |||
@@ -269,6 +269,8 @@ static struct bcma_device *bcma_find_core_reverse(struct bcma_bus *bus, u16 core | |||
269 | return NULL; | 269 | return NULL; |
270 | } | 270 | } |
271 | 271 | ||
272 | #define IS_ERR_VALUE_U32(x) ((x) >= (u32)-MAX_ERRNO) | ||
273 | |||
272 | static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, | 274 | static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, |
273 | struct bcma_device_id *match, int core_num, | 275 | struct bcma_device_id *match, int core_num, |
274 | struct bcma_device *core) | 276 | struct bcma_device *core) |
@@ -351,11 +353,11 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, | |||
351 | * the main register space for the core | 353 | * the main register space for the core |
352 | */ | 354 | */ |
353 | tmp = bcma_erom_get_addr_desc(bus, eromptr, SCAN_ADDR_TYPE_SLAVE, 0); | 355 | tmp = bcma_erom_get_addr_desc(bus, eromptr, SCAN_ADDR_TYPE_SLAVE, 0); |
354 | if (tmp == 0 || IS_ERR_VALUE(tmp)) { | 356 | if (tmp == 0 || IS_ERR_VALUE_U32(tmp)) { |
355 | /* Try again to see if it is a bridge */ | 357 | /* Try again to see if it is a bridge */ |
356 | tmp = bcma_erom_get_addr_desc(bus, eromptr, | 358 | tmp = bcma_erom_get_addr_desc(bus, eromptr, |
357 | SCAN_ADDR_TYPE_BRIDGE, 0); | 359 | SCAN_ADDR_TYPE_BRIDGE, 0); |
358 | if (tmp == 0 || IS_ERR_VALUE(tmp)) { | 360 | if (tmp == 0 || IS_ERR_VALUE_U32(tmp)) { |
359 | return -EILSEQ; | 361 | return -EILSEQ; |
360 | } else { | 362 | } else { |
361 | bcma_info(bus, "Bridge found\n"); | 363 | bcma_info(bus, "Bridge found\n"); |
@@ -369,7 +371,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, | |||
369 | for (j = 0; ; j++) { | 371 | for (j = 0; ; j++) { |
370 | tmp = bcma_erom_get_addr_desc(bus, eromptr, | 372 | tmp = bcma_erom_get_addr_desc(bus, eromptr, |
371 | SCAN_ADDR_TYPE_SLAVE, i); | 373 | SCAN_ADDR_TYPE_SLAVE, i); |
372 | if (IS_ERR_VALUE(tmp)) { | 374 | if (IS_ERR_VALUE_U32(tmp)) { |
373 | /* no more entries for port _i_ */ | 375 | /* no more entries for port _i_ */ |
374 | /* pr_debug("erom: slave port %d " | 376 | /* pr_debug("erom: slave port %d " |
375 | * "has %d descriptors\n", i, j); */ | 377 | * "has %d descriptors\n", i, j); */ |
@@ -386,7 +388,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, | |||
386 | for (j = 0; ; j++) { | 388 | for (j = 0; ; j++) { |
387 | tmp = bcma_erom_get_addr_desc(bus, eromptr, | 389 | tmp = bcma_erom_get_addr_desc(bus, eromptr, |
388 | SCAN_ADDR_TYPE_MWRAP, i); | 390 | SCAN_ADDR_TYPE_MWRAP, i); |
389 | if (IS_ERR_VALUE(tmp)) { | 391 | if (IS_ERR_VALUE_U32(tmp)) { |
390 | /* no more entries for port _i_ */ | 392 | /* no more entries for port _i_ */ |
391 | /* pr_debug("erom: master wrapper %d " | 393 | /* pr_debug("erom: master wrapper %d " |
392 | * "has %d descriptors\n", i, j); */ | 394 | * "has %d descriptors\n", i, j); */ |
@@ -404,7 +406,7 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr, | |||
404 | for (j = 0; ; j++) { | 406 | for (j = 0; ; j++) { |
405 | tmp = bcma_erom_get_addr_desc(bus, eromptr, | 407 | tmp = bcma_erom_get_addr_desc(bus, eromptr, |
406 | SCAN_ADDR_TYPE_SWRAP, i + hack); | 408 | SCAN_ADDR_TYPE_SWRAP, i + hack); |
407 | if (IS_ERR_VALUE(tmp)) { | 409 | if (IS_ERR_VALUE_U32(tmp)) { |
408 | /* no more entries for port _i_ */ | 410 | /* no more entries for port _i_ */ |
409 | /* pr_debug("erom: master wrapper %d " | 411 | /* pr_debug("erom: master wrapper %d " |
410 | * has %d descriptors\n", i, j); */ | 412 | * has %d descriptors\n", i, j); */ |