[PATCH 2/3] ata: libahci_platform: drop the dead error check
From: shao.mingyin
Date: Wed Nov 04 2026 - 08:21:19 EST
From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
IS_ERR(hpriv->ahci_regulator) is true here, so PTR_ERR() is negative
and "rc != 0" is always true. Jump to the error path directly.
No functional change.
Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
---
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index ae342080556a..819fbf200dc0 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -557,8 +557,7 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,
hpriv->ahci_regulator = devm_regulator_get(dev, "ahci");
if (IS_ERR(hpriv->ahci_regulator)) {
rc = PTR_ERR(hpriv->ahci_regulator);
- if (rc != 0)
- goto err_out;
+ goto err_out;
}
hpriv->phy_regulator = devm_regulator_get(dev, "phy");