public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 01/10] net: rtl8139: Factor out device name assignment
@ 2020-05-09 20:34 Marek Vasut
  2020-05-09 20:34 ` [PATCH 02/10] net: rtl8139: Switch from malloc()+memset() to calloc() Marek Vasut
                   ` (9 more replies)
  0 siblings, 10 replies; 20+ messages in thread
From: Marek Vasut @ 2020-05-09 20:34 UTC (permalink / raw)
  To: u-boot

Pull the device name setting into a separate function, as this
will be shared between DM/non-DM variants.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
---
 drivers/net/rtl8139.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c
index 1f08397291..adee618543 100644
--- a/drivers/net/rtl8139.c
+++ b/drivers/net/rtl8139.c
@@ -521,6 +521,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 },
@@ -553,7 +558,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);
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-06-12 21:17 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-09 20:34 [PATCH 01/10] net: rtl8139: Factor out device name assignment Marek Vasut
2020-05-09 20:34 ` [PATCH 02/10] net: rtl8139: Switch from malloc()+memset() to calloc() Marek Vasut
2020-06-12 21:16   ` Tom Rini
2020-05-09 20:34 ` [PATCH 03/10] net: rtl8139: Use dev->iobase instead of custom ioaddr Marek Vasut
2020-06-12 21:16   ` Tom Rini
2020-05-09 20:34 ` [PATCH 04/10] net: rtl8139: Clean up bus_to_phys()/phys_to_bus() macros Marek Vasut
2020-06-12 21:16   ` Tom Rini
2020-05-09 20:34 ` [PATCH 05/10] net: rtl8139: Introduce device private data Marek Vasut
2020-06-12 21:16   ` Tom Rini
2020-05-09 20:34 ` [PATCH 06/10] net: rtl8139: Pass private data into rtl8139_eeprom_delay() Marek Vasut
2020-06-12 21:17   ` Tom Rini
2020-05-09 20:34 ` [PATCH 07/10] net: rtl8139: Split out common and non-DM functions Marek Vasut
2020-06-12 21:17   ` Tom Rini
2020-05-09 20:34 ` [PATCH 08/10] net: rtl8139: Use PCI_DEVICE() to define PCI device compat list Marek Vasut
2020-06-12 21:17   ` Tom Rini
2020-05-09 20:34 ` [PATCH 09/10] net: rtl8139: Read HW address from EEPROM only on probe Marek Vasut
2020-06-12 21:17   ` Tom Rini
2020-05-09 20:34 ` [PATCH 10/10] net: rtl8139: Add DM support Marek Vasut
2020-06-12 21:17   ` Tom Rini
2020-06-12 21:16 ` [PATCH 01/10] net: rtl8139: Factor out device name assignment Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox