Skip to contentSkip to conversation

ata: ahci: ceva: Updated code by using dev_err_probe()

PATCH Applied Piyush Mehta 3 participants 3 messages Mar 5, 2021 – Apr 6, 2021 libata

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ata: ahci: ceva: Updated code by using dev_err_probe()

Updated code with already prepared dev_err_probe(). It reduces code size and simplifies EPROBE_DEFER handling.

Also, unify message format for similar error cases.

---
This patch is based on ahci-ceva patches:
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?h=for-next&id=5542fabd9e07d6c49c07862e73070c325f93d390

Tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/tree/?h=for-next

Changes for V2:
- Address review comment- remove curly brackets {}.

---
 drivers/ata/ahci_ceva.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/ata/ahci_ceva.c +3 -5
index b980218..50b56cd 100644
@@ -206,11 +206,9 @@ static int ceva_ahci_probe(struct platform_device *pdev)
 
 	cevapriv->rst = devm_reset_control_get_optional_exclusive(&pdev->dev,
 								  NULL);
-	if (IS_ERR(cevapriv->rst)) {
-		if (PTR_ERR(cevapriv->rst) != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "failed to get reset: %ld\n",
-				PTR_ERR(cevapriv->rst));
-	}
+	if (IS_ERR(cevapriv->rst))
+		dev_err_probe(&pdev->dev, PTR_ERR(cevapriv->rst),
+			      "failed to get reset\n");
 
 	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))
Signature · 1 line
2.7.4
#1 lore raw

Hi Jens,

Quoted 29 lines · Piyush Mehta

Updated code with already prepared dev_err_probe(). It reduces code size and simplifies EPROBE_DEFER handling.

Also, unify message format for similar error cases.

---
This patch is based on ahci-ceva patches:
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/commit/?h=for-next&id=5542fabd9e07d6c49c07862e73070c325f93d390

Tree: https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/tree/?h=for-next

Changes for V2:
- Address review comment- remove curly brackets {}.

---
 drivers/ata/ahci_ceva.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/ata/ahci_ceva.c +0 -1
index b980218..50b56cd 100644
@@ -206,11 +206,9 @@ static int ceva_ahci_probe(struct platform_device *pdev)
 
 	cevapriv->rst = devm_reset_control_get_optional_exclusive(&pdev->dev,
 								  NULL);
-	if (IS_ERR(cevapriv->rst)) {

drivers/ata/ahci_ceva.c static int ceva_ahci_probe(struct platform_device *pdev) · line 214

Quoted 10 lines
drivers/ata/ahci_ceva.c +3 -4
-		if (PTR_ERR(cevapriv->rst) != -EPROBE_DEFER)
-			dev_err(&pdev->dev, "failed to get reset: %ld\n",
-				PTR_ERR(cevapriv->rst));
-	}
+	if (IS_ERR(cevapriv->rst))
+		dev_err_probe(&pdev->dev, PTR_ERR(cevapriv->rst),
+			      "failed to get reset\n");
 
 	hpriv = ahci_platform_get_resources(pdev, 0);
 	if (IS_ERR(hpriv))

Can you please apply this to your tree?

Thanks,
Michal

Applied
#2 lore raw
In reply to Piyush Mehta
Quoted 2 lines · Piyush Mehta

Updated code with already prepared dev_err_probe(). It reduces code size and simplifies EPROBE_DEFER handling.

Applied, thanks.

Signature · 1 line
Jens Axboe