* [PATCH] ata: ahci: ceva: Updated code by using dev_err_probe()
@ 2021-03-04 15:53 Piyush Mehta
2021-03-04 15:53 ` Piyush Mehta
0 siblings, 1 reply; 3+ messages in thread
From: Piyush Mehta @ 2021-03-04 15:53 UTC (permalink / raw)
To: axboe; +Cc: linux-ide, linux-kernel, git, sgoud, michal.simek, 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.
Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com>
---
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
---
drivers/ata/ahci_ceva.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c
index b980218..a935209 100644
--- a/drivers/ata/ahci_ceva.c
+++ b/drivers/ata/ahci_ceva.c
@@ -207,9 +207,8 @@ 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));
+ dev_err_probe(&pdev->dev, PTR_ERR(cevapriv->rst),
+ "failed to get reset\n");
}
hpriv = ahci_platform_get_resources(pdev, 0);
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] ata: ahci: ceva: Updated code by using dev_err_probe()
2021-03-04 15:53 [PATCH] ata: ahci: ceva: Updated code by using dev_err_probe() Piyush Mehta
@ 2021-03-04 15:53 ` Piyush Mehta
2021-03-04 16:22 ` Michal Simek
0 siblings, 1 reply; 3+ messages in thread
From: Piyush Mehta @ 2021-03-04 15:53 UTC (permalink / raw)
To: axboe; +Cc: linux-ide, linux-kernel, git, sgoud, michal.simek, 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.
Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com>
---
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
---
drivers/ata/ahci_ceva.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c
index b980218..a935209 100644
--- a/drivers/ata/ahci_ceva.c
+++ b/drivers/ata/ahci_ceva.c
@@ -207,9 +207,8 @@ 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));
+ dev_err_probe(&pdev->dev, PTR_ERR(cevapriv->rst),
+ "failed to get reset\n");
}
hpriv = ahci_platform_get_resources(pdev, 0);
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ata: ahci: ceva: Updated code by using dev_err_probe()
2021-03-04 15:53 ` Piyush Mehta
@ 2021-03-04 16:22 ` Michal Simek
0 siblings, 0 replies; 3+ messages in thread
From: Michal Simek @ 2021-03-04 16:22 UTC (permalink / raw)
To: Piyush Mehta, axboe; +Cc: linux-ide, linux-kernel, git, sgoud, michal.simek
On 3/4/21 4:53 PM, Piyush Mehta wrote:
> 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.
>
> Signed-off-by: Piyush Mehta <piyush.mehta@xilinx.com>
> ---
> 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
> ---
> drivers/ata/ahci_ceva.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/ata/ahci_ceva.c b/drivers/ata/ahci_ceva.c
> index b980218..a935209 100644
> --- a/drivers/ata/ahci_ceva.c
> +++ b/drivers/ata/ahci_ceva.c
> @@ -207,9 +207,8 @@ 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));
> + dev_err_probe(&pdev->dev, PTR_ERR(cevapriv->rst),
> + "failed to get reset\n");
> }
I got it twice not sure why.
nit: Sorry I didn't spot it in the first internal review.
But you can also remove that {} around.
With that fixed please add my
Acked-by: Michal Simek <michal.simek@xilinx.com>
Thanks,
Michal
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-04 16:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04 15:53 [PATCH] ata: ahci: ceva: Updated code by using dev_err_probe() Piyush Mehta
2021-03-04 15:53 ` Piyush Mehta
2021-03-04 16:22 ` Michal Simek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).