mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2025-02-22 23:46:10 +00:00
New stm32 target introduces support for stm32mp1 based devices. For now it includes an initial support of the STM32MP135F-DK device. The specifications bellow only list supported features. Specifications -------------- SOC: STM32MP135FAF7 RAM: 512 MiB Storage: SD Card Ethernet: 2x 100 Mbps Wireless: 2.4GHz Cypress CYW43455 (802.11b/g/n) LEDs: Heartbeat (Blue) Buttons: 1x Reset, 1x User (USER2) USB: 4x 2.0 Type-A Signed-off-by: Thomas Richard <thomas.richard@bootlin.com> Link: https://github.com/openwrt/openwrt/pull/16716 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
70 lines
1.9 KiB
Diff
70 lines
1.9 KiB
Diff
From 1ddced59ac1f7c739f21e930d87b126a30c561bb Mon Sep 17 00:00:00 2001
|
|
From: Jisheng Zhang <jszhang@kernel.org>
|
|
Date: Sat, 16 Sep 2023 15:58:23 +0800
|
|
Subject: [PATCH 1/8] net: stmmac: dwmac-stm32: use
|
|
devm_stmmac_probe_config_dt()
|
|
|
|
Simplify the driver's probe() function by using the devres
|
|
variant of stmmac_probe_config_dt().
|
|
|
|
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
|
|
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
---
|
|
.../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 17 ++++++-----------
|
|
1 file changed, 6 insertions(+), 11 deletions(-)
|
|
|
|
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
|
|
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c
|
|
@@ -372,21 +372,18 @@ static int stm32_dwmac_probe(struct plat
|
|
if (ret)
|
|
return ret;
|
|
|
|
- plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
|
|
+ plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
|
|
if (IS_ERR(plat_dat))
|
|
return PTR_ERR(plat_dat);
|
|
|
|
dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL);
|
|
- if (!dwmac) {
|
|
- ret = -ENOMEM;
|
|
- goto err_remove_config_dt;
|
|
- }
|
|
+ if (!dwmac)
|
|
+ return -ENOMEM;
|
|
|
|
data = of_device_get_match_data(&pdev->dev);
|
|
if (!data) {
|
|
dev_err(&pdev->dev, "no of match data provided\n");
|
|
- ret = -EINVAL;
|
|
- goto err_remove_config_dt;
|
|
+ return -EINVAL;
|
|
}
|
|
|
|
dwmac->ops = data;
|
|
@@ -395,14 +392,14 @@ static int stm32_dwmac_probe(struct plat
|
|
ret = stm32_dwmac_parse_data(dwmac, &pdev->dev);
|
|
if (ret) {
|
|
dev_err(&pdev->dev, "Unable to parse OF data\n");
|
|
- goto err_remove_config_dt;
|
|
+ return ret;
|
|
}
|
|
|
|
plat_dat->bsp_priv = dwmac;
|
|
|
|
ret = stm32_dwmac_init(plat_dat);
|
|
if (ret)
|
|
- goto err_remove_config_dt;
|
|
+ return ret;
|
|
|
|
ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
|
|
if (ret)
|
|
@@ -412,8 +409,6 @@ static int stm32_dwmac_probe(struct plat
|
|
|
|
err_clk_disable:
|
|
stm32_dwmac_clk_disable(dwmac);
|
|
-err_remove_config_dt:
|
|
- stmmac_remove_config_dt(pdev, plat_dat);
|
|
|
|
return ret;
|
|
}
|