CC Sergei

On Fri, May 25, 2018 at 8:33 PM, Marek Vasut <[email protected]> wrote:
> If the Gen3 PHY fails to power up, the code does not undo the
> initialization caused by phy_init(). Add the missing failure
> handling to the rcar_pcie_phy_init_gen3() function.
>
> Signed-off-by: Marek Vasut <[email protected]>
> Reported-by: Geert Uytterhoeven <[email protected]>
> Cc: Geert Uytterhoeven <[email protected]>
> Cc: Lorenzo Pieralisi <[email protected]>
> Cc: Phil Edworthy <[email protected]>
> Cc: Simon Horman <[email protected]>
> Cc: Wolfram Sang <[email protected]>
> Cc: [email protected]
> Fixes: 517ca93a7159 ("PCI: rcar: Add R-Car gen3 PHY support")

Reviewed-by: Geert Uytterhoeven <[email protected]>

> ---
>  drivers/pci/host/pcie-rcar.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> index 695781934f0a..477bf40cc031 100644
> --- a/drivers/pci/host/pcie-rcar.c
> +++ b/drivers/pci/host/pcie-rcar.c
> @@ -678,7 +678,11 @@ static int rcar_pcie_phy_init_gen3(struct rcar_pcie 
> *pcie)
>         if (err)
>                 return err;
>
> -       return phy_power_on(pcie->phy);
> +       err = phy_power_on(pcie->phy);
> +       if (err)
> +               phy_exit(pcie->phy);
> +
> +       return err;
>  }
>
>  static int rcar_msi_alloc(struct rcar_msi *chip)

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Reply via email to