OSDN Git Service

PCI: rcar: Pull bus clock enable/disable from rcar_pcie_get_resources()
authorMarek Vasut <marek.vasut@gmail.com>
Thu, 24 May 2018 14:36:19 +0000 (16:36 +0200)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Thu, 24 May 2018 17:38:31 +0000 (18:38 +0100)
commit80b8471e69d706d7622bbd633aca611d11b389b7
treef8a45d47328d8eb20bbaec306d8e2ed6cbbd2811
parent0353ff29b3881a8d9df65ce08a01e636868c1ef2
PCI: rcar: Pull bus clock enable/disable from rcar_pcie_get_resources()

The rcar_pcie_get_resources() is another misnomer with a side effect.
The function does not only get resources, but also enables/disables bus
clock. This is forgotten in the probe() function though and if anything
in probe() fails after rcar_pcie_get_resources() is called, the bus
clock are never disabled.

This patch pulls the clock handling out of the rcar_pcie_get_resources()
and enables clock after all the resources were requested. Moreover, this
patch also always disables the clock in case of failure.

Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-renesas-soc@vger.kernel.org
drivers/pci/host/pcie-rcar.c