diff mbox series

[1/3] PCI: qcom: Fix missing error code in qcom_pcie_probe()

Message ID 20240708180539.1447307-2-dan.carpenter@linaro.org
State Accepted
Commit 101e5c5c4e766901492b51c33b34af5f775b043f
Headers show
Series [1/3] PCI: qcom: Fix missing error code in qcom_pcie_probe() | expand

Commit Message

Dan Carpenter July 8, 2024, 6:05 p.m. UTC
Return a negative error code if dev_pm_opp_find_freq_floor() fails.
Don't return success.

Fixes: 78b5f6f8855e ("PCI: qcom: Add OPP support to scale performance")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Manivannan Sadhasivam July 9, 2024, 5:11 a.m. UTC | #1
On Mon, Jul 08, 2024 at 01:05:36PM -0500, Dan Carpenter wrote:
> Return a negative error code if dev_pm_opp_find_freq_floor() fails.
> Don't return success.
> 
> Fixes: 78b5f6f8855e ("PCI: qcom: Add OPP support to scale performance")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

- Mani

> ---
>  drivers/pci/controller/dwc/pcie-qcom.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index 26405fcfa499..1d36311f9adb 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -1574,7 +1574,8 @@ static int qcom_pcie_probe(struct platform_device *pdev)
>  	if (!ret) {
>  		opp = dev_pm_opp_find_freq_floor(dev, &max_freq);
>  		if (IS_ERR(opp)) {
> -			dev_err_probe(pci->dev, PTR_ERR(opp),
> +			ret = PTR_ERR(opp);
> +			dev_err_probe(pci->dev, ret,
>  				      "Unable to find max freq OPP\n");
>  			goto err_pm_runtime_put;
>  		} else {
> -- 
> 2.43.0
>
diff mbox series

Patch

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 26405fcfa499..1d36311f9adb 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -1574,7 +1574,8 @@  static int qcom_pcie_probe(struct platform_device *pdev)
 	if (!ret) {
 		opp = dev_pm_opp_find_freq_floor(dev, &max_freq);
 		if (IS_ERR(opp)) {
-			dev_err_probe(pci->dev, PTR_ERR(opp),
+			ret = PTR_ERR(opp);
+			dev_err_probe(pci->dev, ret,
 				      "Unable to find max freq OPP\n");
 			goto err_pm_runtime_put;
 		} else {