2019-01-21 15:00:31

by Stefan Agner

[permalink] [raw]
Subject: [PATCH] net: fec: get regulator optional

According to the device tree binding the phy-supply property is
optional. Use the regulator_get_optional API accordingly. The
code already handles NULL just fine.

This gets rid of the following warning:
fec 2188000.ethernet: 2188000.ethernet supply phy not found, using dummy regulator

Signed-off-by: Stefan Agner <[email protected]>
---
drivers/net/ethernet/freescale/fec_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 6db69ba30dcd..c8315d880c8c 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -3479,7 +3479,7 @@ fec_probe(struct platform_device *pdev)
if (ret)
goto failed_clk_ipg;

- fep->reg_phy = devm_regulator_get(&pdev->dev, "phy");
+ fep->reg_phy = devm_regulator_get_optional(&pdev->dev, "phy");
if (!IS_ERR(fep->reg_phy)) {
ret = regulator_enable(fep->reg_phy);
if (ret) {
--
2.20.1



2019-01-21 15:39:24

by Marcel Ziswiler

[permalink] [raw]
Subject: Re: [PATCH] net: fec: get regulator optional

On Mon, 2019-01-21 at 15:58 +0100, Stefan Agner wrote:
> According to the device tree binding the phy-supply property is
> optional. Use the regulator_get_optional API accordingly. The
> code already handles NULL just fine.
>
> This gets rid of the following warning:
> fec 2188000.ethernet: 2188000.ethernet supply phy not found, using
> dummy regulator
>
> Signed-off-by: Stefan Agner <[email protected]>

Reviewed-by: Marcel Ziswiler <[email protected]>

> ---
> drivers/net/ethernet/freescale/fec_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index 6db69ba30dcd..c8315d880c8c 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -3479,7 +3479,7 @@ fec_probe(struct platform_device *pdev)
> if (ret)
> goto failed_clk_ipg;
>
> - fep->reg_phy = devm_regulator_get(&pdev->dev, "phy");
> + fep->reg_phy = devm_regulator_get_optional(&pdev->dev, "phy");
> if (!IS_ERR(fep->reg_phy)) {
> ret = regulator_enable(fep->reg_phy);
> if (ret) {

2019-01-22 01:42:14

by Andy Duan

[permalink] [raw]
Subject: RE: [PATCH] net: fec: get regulator optional

From: Stefan Agner <[email protected]> Sent: Monday, January 21, 2019 10:59 PM
> According to the device tree binding the phy-supply property is optional. Use
> the regulator_get_optional API accordingly. The code already handles NULL
> just fine.
>
> This gets rid of the following warning:
> fec 2188000.ethernet: 2188000.ethernet supply phy not found, using
> dummy regulator
>
> Signed-off-by: Stefan Agner <[email protected]>
Thanks.

Acked-by: Fugang Duan <[email protected]>
> ---
> drivers/net/ethernet/freescale/fec_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index 6db69ba30dcd..c8315d880c8c 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -3479,7 +3479,7 @@ fec_probe(struct platform_device *pdev)
> if (ret)
> goto failed_clk_ipg;
>
> - fep->reg_phy = devm_regulator_get(&pdev->dev, "phy");
> + fep->reg_phy = devm_regulator_get_optional(&pdev->dev, "phy");
> if (!IS_ERR(fep->reg_phy)) {
> ret = regulator_enable(fep->reg_phy);
> if (ret) {
> --
> 2.20.1


2019-01-23 04:53:25

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] net: fec: get regulator optional

From: Stefan Agner <[email protected]>
Date: Mon, 21 Jan 2019 15:58:47 +0100

> According to the device tree binding the phy-supply property is
> optional. Use the regulator_get_optional API accordingly. The
> code already handles NULL just fine.
>
> This gets rid of the following warning:
> fec 2188000.ethernet: 2188000.ethernet supply phy not found, using dummy regulator
>
> Signed-off-by: Stefan Agner <[email protected]>

Applied.