[PATCH 2/2] ata: ahci_ceva: add missing enable regulator API for Xilinx GT PHY support

From: Radhey Shyam Pandey
Date: Thu Jan 18 2024 - 14:09:13 EST


From: Piyush Mehta <piyush.mehta@xxxxxxx>

The regulators API are disabled and enabled, during suspend and resume,
respectively. The following warning notice shows up on the initial suspend
because the enable regulators API is unaddressed in the probe:

regulator-dummy: Underflow of regulator enable count

Added the ahci_platform_enable_regulators API in probe to maintain the
regulator enabled and disabled ref count.

Fixes: 9a9d3abe24bb ("ata: ahci: ceva: Update the driver to support xilinx GT phy")
Signed-off-by: Piyush Mehta <piyush.mehta@xxxxxxx>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xxxxxxx>
---
drivers/ata/ahci_ceva.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c
index bfc513f1d0b3..1c56f0cabb11 100644
--- a/drivers/ata/ahci_ceva.c
+++ b/drivers/ata/ahci_ceva.c
@@ -219,9 +219,14 @@ static int ceva_ahci_probe(struct platform_device *pdev)
if (rc)
return rc;
} else {
- rc = ahci_platform_enable_clks(hpriv);
+ rc = ahci_platform_enable_regulators(hpriv);
if (rc)
return rc;
+
+ rc = ahci_platform_enable_clks(hpriv);
+ if (rc)
+ goto disable_regulator;
+
/* Assert the controller reset */
reset_control_assert(cevapriv->rst);

@@ -340,6 +345,9 @@ static int ceva_ahci_probe(struct platform_device *pdev)
disable_clks:
ahci_platform_disable_clks(hpriv);

+disable_regulator:
+ ahci_platform_disable_regulators(hpriv);
+
return rc;
}

--
2.34.1