diff options
| author | Mikhail Kshevetskiy <[email protected]> | 2026-02-11 21:22:18 +0300 |
|---|---|---|
| committer | Jerome Forissier <[email protected]> | 2026-03-12 12:49:35 +0100 |
| commit | be0c12296e59925b4f29994b9a4dcaa3bc4660e0 (patch) | |
| tree | c342a416beca33a9a57dcaa02033f2e6ae28ffb8 /drivers/net | |
| parent | 7ad4c7f8cf07bd2206b2baa118ce2ef56f0caf60 (diff) | |
net: airoha: declare airoha_eth_port as U_BOOT_DRIVER()
Declare airoha_eth_port as U_BOOT_DRIVER(), fix airoha_alloc_gdm_port()
to lookup a driver instead of direct airoha_eth_port usage.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Diffstat (limited to 'drivers/net')
| -rw-r--r-- | drivers/net/airoha_eth.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/airoha_eth.c b/drivers/net/airoha_eth.c index 171fb0825fa..4ae97326c36 100644 --- a/drivers/net/airoha_eth.c +++ b/drivers/net/airoha_eth.c @@ -397,8 +397,6 @@ static u32 airoha_rmw(void __iomem *base, u32 offset, u32 mask, u32 val) #define airoha_switch_wr(eth, offset, val) \ airoha_wr((eth)->switch_regs, (offset), (val)) -static struct driver airoha_eth_port; - static inline dma_addr_t dma_map_unaligned(void *vaddr, size_t len, enum dma_data_direction dir) { @@ -781,10 +779,15 @@ static int airoha_alloc_gdm_port(struct udevice *dev, ofnode node) { struct airoha_eth *eth = dev_get_priv(dev); struct udevice *gdm_dev; + struct driver *gdm_drv; char *str; int ret; u32 id; + gdm_drv = lists_driver_lookup_name("airoha-eth-port"); + if (!gdm_drv) + return -ENOENT; + ret = ofnode_read_u32(node, "reg", &id); if (ret) return ret; @@ -796,7 +799,7 @@ static int airoha_alloc_gdm_port(struct udevice *dev, ofnode node) snprintf(str, AIROHA_GDM_PORT_STRING_LEN, "airoha-gdm%d", id); - return device_bind_with_driver_data(dev, &airoha_eth_port, str, + return device_bind_with_driver_data(dev, gdm_drv, str, (ulong)eth, node, &gdm_dev); } @@ -1147,7 +1150,7 @@ static const struct eth_ops airoha_eth_ops = { .write_hwaddr = arht_eth_write_hwaddr, }; -static struct driver airoha_eth_port = { +U_BOOT_DRIVER(airoha_eth_port) = { .name = "airoha-eth-port", .id = UCLASS_ETH, .of_to_plat = airoha_eth_port_of_to_plat, |
