2023-08-09 17:28:47

by Jisheng Zhang

[permalink] [raw]
Subject: [PATCH net-next v3 08/10] net: stmmac: platform: support parsing safety irqs from DT

The snps dwmac IP may support safety features, and those Safety
Feature Correctible Error and Uncorrectible Error irqs may be
separate irqs. Add support to parse the safety irqs from DT.

Signed-off-by: Jisheng Zhang <[email protected]>
---
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 23d53ea04b24..29145682b57b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -738,6 +738,18 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
dev_info(&pdev->dev, "IRQ eth_lpi not found\n");
}

+ stmmac_res->sfty_ce_irq = platform_get_irq_byname_optional(pdev, "sfty_ce");
+ if (stmmac_res->sfty_ce_irq < 0) {
+ if (stmmac_res->sfty_ce_irq == -EPROBE_DEFER)
+ return -EPROBE_DEFER;
+ }
+
+ stmmac_res->sfty_ue_irq = platform_get_irq_byname_optional(pdev, "sfty_ue");
+ if (stmmac_res->sfty_ue_irq < 0) {
+ if (stmmac_res->sfty_ue_irq == -EPROBE_DEFER)
+ return -EPROBE_DEFER;
+ }
+
stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0);

return PTR_ERR_OR_ZERO(stmmac_res->addr);
--
2.40.1



2023-08-10 15:51:24

by Alexandre TORGUE

[permalink] [raw]
Subject: Re: [PATCH net-next v3 08/10] net: stmmac: platform: support parsing safety irqs from DT

On 8/9/23 18:50, Jisheng Zhang wrote:
> The snps dwmac IP may support safety features, and those Safety
> Feature Correctible Error and Uncorrectible Error irqs may be
> separate irqs. Add support to parse the safety irqs from DT.
>
> Signed-off-by: Jisheng Zhang <[email protected]>
> ---
> .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 23d53ea04b24..29145682b57b 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -738,6 +738,18 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
> dev_info(&pdev->dev, "IRQ eth_lpi not found\n");
> }
>
> + stmmac_res->sfty_ce_irq = platform_get_irq_byname_optional(pdev, "sfty_ce");
> + if (stmmac_res->sfty_ce_irq < 0) {
> + if (stmmac_res->sfty_ce_irq == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
> + }
> +
> + stmmac_res->sfty_ue_irq = platform_get_irq_byname_optional(pdev, "sfty_ue");
> + if (stmmac_res->sfty_ue_irq < 0) {
> + if (stmmac_res->sfty_ue_irq == -EPROBE_DEFER)
> + return -EPROBE_DEFER;
> + }
> +
> stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0);
>
> return PTR_ERR_OR_ZERO(stmmac_res->addr);
Acked-by: Alexandre TORGUE <[email protected]>

Regards
Alex