]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net: fec: get regulator optional
authorStefan Agner <stefan@agner.ch>
Mon, 21 Jan 2019 14:58:47 +0000 (15:58 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Jan 2019 04:51:21 +0000 (20:51 -0800)
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 <stefan@agner.ch>
Reviewed-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/fec_main.c

index ae0f88bce9aa6edca13e5cba73b5aba8814097ff..2370dc204202f556093ae200b64a11d36ce36f42 100644 (file)
@@ -3467,7 +3467,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) {