diff options
| author | Marek Vasut <[email protected]> | 2020-05-09 22:34:35 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2020-06-12 13:17:23 -0400 |
| commit | 9962dd25b1e228c5c8f0b33ef89c48093ca2a311 (patch) | |
| tree | 35b6891ec000a14e2b359e75f36148071d475254 /drivers | |
| parent | de5468e660742c4d2c2cbfc39e106fc647570110 (diff) | |
net: rtl8139: Factor out device name assignment
Pull the device name setting into a separate function, as this
will be shared between DM/non-DM variants.
Signed-off-by: Marek Vasut <[email protected]>
Cc: Joe Hershberger <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/rtl8139.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c index 0daeefa489b..cc7fcdfea40 100644 --- a/drivers/net/rtl8139.c +++ b/drivers/net/rtl8139.c @@ -524,6 +524,11 @@ static int rtl8139_bcast_addr(struct eth_device *dev, const u8 *bcast_mac, return 0; } +static void rtl8139_name(char *str, int card_number) +{ + sprintf(str, "RTL8139#%u", card_number); +} + static struct pci_device_id supported[] = { { PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139 }, { PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_8139 }, @@ -556,7 +561,7 @@ int rtl8139_initialize(bd_t *bis) } memset(dev, 0, sizeof(*dev)); - sprintf(dev->name, "RTL8139#%d", card_number); + rtl8139_name(dev->name, card_number); dev->priv = (void *)devno; dev->iobase = (int)bus_to_phys(iobase); |
