mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
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 <mikhail.kshevetskiy@iopsys.eu>
This commit is contained in:
parent
7ad4c7f8cf
commit
be0c12296e
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user