PCI: qcom: Fix error handling in runtime PM support
authorBjorn Andersson <bjorn.andersson@linaro.org>
Fri, 31 Aug 2018 22:55:10 +0000 (15:55 -0700)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Tue, 18 Sep 2018 09:13:14 +0000 (10:13 +0100)
commit6e5da6f7d82474e94c2d4a38cf9ca4edbb3e03a0
tree3839092f405814849f33da32c7037e69d15bba5f
parent0ee2c1f2429f74328c82ea559b127c96d5224ccd
PCI: qcom: Fix error handling in runtime PM support

The driver does not cope with the fact that probe can fail in a number
of cases after enabling runtime PM on the device; this results in
warnings about "Unbalanced pm_runtime_enable". Furthermore if probe
fails after invoking qcom_pcie_host_init() the power-domain will be left
referenced.

As it is not possible for the error handling in qcom_pcie_host_init() to
handle errors happening after returning from that function the
pm_runtime_get_sync() is moved to qcom_pcie_probe() as well.

Fixes: 854b69efbdd2 ("PCI: qcom: add runtime pm support to pcie_port")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
[lorenzo.pieralisi@arm.com: updated commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Stanimir Varbanov <svarbanov@mm-sol.com>
drivers/pci/controller/dwc/pcie-qcom.c