nubus: Adopt standard linked list implementation

This increases code re-use and improves readability.

Cc: "David S. Miller" <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Acked-by: Bartlomiej Zolnierkiewicz <[email protected]>
Tested-by: Stan Johnson <[email protected]>
Signed-off-by: Finn Thain <[email protected]>
Signed-off-by: Geert Uytterhoeven <[email protected]>
This commit is contained in:
Finn Thain 2018-01-13 17:37:13 -05:00 • committed by Geert Uytterhoeven
commit 41b848160e
7 changed files with 40 additions and 60 deletions

View file

@ -670,15 +670,17 @@ static int __init macfb_init(void)
* code is really broken :-)
*/
while ((ndev = nubus_find_type(NUBUS_CAT_DISPLAY,
NUBUS_TYPE_VIDEO, ndev)))
{
for_each_func_rsrc(ndev) {
unsigned long base = ndev->board->slot_addr;
if (mac_bi_data.videoaddr < base ||
mac_bi_data.videoaddr - base > 0xFFFFFF)
continue;
if (ndev->category != NUBUS_CAT_DISPLAY ||
ndev->type != NUBUS_TYPE_VIDEO)
continue;
video_is_nubus = 1;
slot_addr = (unsigned char *)base;