summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/natsemi/macsonic.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2018-01-14 01:37:13 +0300
committerGeert Uytterhoeven <geert@linux-m68k.org>2018-01-16 18:47:29 +0300
commit41b848160eabb22957652936b66ccafd95ab5ad8 (patch)
treef38449c4f4a4694f6c3215262919dc45c92aeb24 /drivers/net/ethernet/natsemi/macsonic.c
parent189e19e8cbb49f5bf483e55bdbd1e56d3d6bcf75 (diff)
downloadlinux-41b848160eabb22957652936b66ccafd95ab5ad8.tar.xz
nubus: Adopt standard linked list implementation
This increases code re-use and improves readability. Cc: "David S. Miller" <davem@davemloft.net> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Tested-by: Stan Johnson <userm57@yahoo.com> Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'drivers/net/ethernet/natsemi/macsonic.c')
-rw-r--r--drivers/net/ethernet/natsemi/macsonic.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c
index 14f3fb50dc21..313fe5e0184b 100644
--- a/drivers/net/ethernet/natsemi/macsonic.c
+++ b/drivers/net/ethernet/natsemi/macsonic.c
@@ -464,9 +464,11 @@ static int mac_nubus_sonic_probe(struct net_device *dev)
int reg_offset, dma_bitmode;
/* Find the first SONIC that hasn't been initialized already */
- while ((ndev = nubus_find_type(NUBUS_CAT_NETWORK,
- NUBUS_TYPE_ETHERNET, ndev)) != NULL)
- {
+ for_each_func_rsrc(ndev) {
+ if (ndev->category != NUBUS_CAT_NETWORK ||
+ ndev->type != NUBUS_TYPE_ETHERNET)
+ continue;
+
/* Have we seen it already? */
if (slots & (1<<ndev->board->slot))
continue;