diff mbox series

[v4,2/2] tpm_crb_ffa: use dev_xx() macro to print log

Message ID 20250415075712.2157073-3-yeoreum.yun@arm.com (mailing list archive)
State New
Headers show
Series tpm_ffa_crb: add support direct message request v2 | expand

Commit Message

Yeoreum Yun April 15, 2025, 7:57 a.m. UTC
Instread of pr_xxx() macro, use dev_xxx() to print log.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
---
 drivers/char/tpm/tpm_crb_ffa.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Stefano Garzarella April 15, 2025, 8:41 a.m. UTC | #1
On Tue, Apr 15, 2025 at 08:57:12AM +0100, Yeoreum Yun wrote:
>Instread of pr_xxx() macro, use dev_xxx() to print log.
>
>Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
>---
> drivers/char/tpm/tpm_crb_ffa.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/char/tpm/tpm_crb_ffa.c b/drivers/char/tpm/tpm_crb_ffa.c
>index fed775cf53ab..0bb8098e93ae 100644
>--- a/drivers/char/tpm/tpm_crb_ffa.c
>+++ b/drivers/char/tpm/tpm_crb_ffa.c
>@@ -303,7 +303,7 @@ static int tpm_crb_ffa_probe(struct ffa_device *ffa_dev)
>
> 	if (!ffa_partition_supports_direct_recv(ffa_dev) &&
> 	    !ffa_partition_supports_direct_req2_recv(ffa_dev)) {
>-		pr_err("TPM partition doesn't support direct message receive.\n");
>+		dev_warn(&ffa_dev->dev, "partition doesn't support direct message receive.\n");

It's pre-existent, but since we are here, should we put \n also in the 
other messages besides this one?

That said, maybe I'd mention in the commit message that we changed some 
errors to warnings and why.

Thanks,
Stefano

> 		return -EINVAL;
> 	}
>
>@@ -324,17 +324,17 @@ static int tpm_crb_ffa_probe(struct ffa_device *ffa_dev)
> 	rc = tpm_crb_ffa_get_interface_version(&tpm_crb_ffa->major_version,
> 					       &tpm_crb_ffa->minor_version);
> 	if (rc) {
>-		pr_err("failed to get crb interface version. rc:%d", rc);
>+		dev_err(&ffa_dev->dev, "failed to get crb interface version. rc:%d", rc);
> 		goto out;
> 	}
>
>-	pr_info("ABI version %u.%u", tpm_crb_ffa->major_version,
>+	dev_info(&ffa_dev->dev, "ABI version %u.%u", tpm_crb_ffa->major_version,
> 		tpm_crb_ffa->minor_version);
>
> 	if (tpm_crb_ffa->major_version != CRB_FFA_VERSION_MAJOR ||
> 	    (tpm_crb_ffa->minor_version > 0 &&
> 	    tpm_crb_ffa->minor_version < CRB_FFA_VERSION_MINOR)) {
>-		pr_err("Incompatible ABI version");
>+		dev_warn(&ffa_dev->dev, "Incompatible ABI version");
> 		goto out;
> 	}
>
>-- 
>LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}
>
Yeoreum Yun April 15, 2025, 6:42 p.m. UTC | #2
Hi,

> On Tue, Apr 15, 2025 at 08:57:12AM +0100, Yeoreum Yun wrote:
> > Instread of pr_xxx() macro, use dev_xxx() to print log.
> >
> > Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
> > ---
> > drivers/char/tpm/tpm_crb_ffa.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/char/tpm/tpm_crb_ffa.c b/drivers/char/tpm/tpm_crb_ffa.c
> > index fed775cf53ab..0bb8098e93ae 100644
> > --- a/drivers/char/tpm/tpm_crb_ffa.c
> > +++ b/drivers/char/tpm/tpm_crb_ffa.c
> > @@ -303,7 +303,7 @@ static int tpm_crb_ffa_probe(struct ffa_device *ffa_dev)
> >
> > 	if (!ffa_partition_supports_direct_recv(ffa_dev) &&
> > 	    !ffa_partition_supports_direct_req2_recv(ffa_dev)) {
> > -		pr_err("TPM partition doesn't support direct message receive.\n");
> > +		dev_warn(&ffa_dev->dev, "partition doesn't support direct message receive.\n");
>
> It's pre-existent, but since we are here, should we put \n also in the other
> messages besides this one?
>
> That said, maybe I'd mention in the commit message that we changed some
> errors to warnings and why.
>

Okay. I'll respin it.

Thanks

>
> > 		return -EINVAL;
> > 	}
> >
> > @@ -324,17 +324,17 @@ static int tpm_crb_ffa_probe(struct ffa_device *ffa_dev)
> > 	rc = tpm_crb_ffa_get_interface_version(&tpm_crb_ffa->major_version,
> > 					       &tpm_crb_ffa->minor_version);
> > 	if (rc) {
> > -		pr_err("failed to get crb interface version. rc:%d", rc);
> > +		dev_err(&ffa_dev->dev, "failed to get crb interface version. rc:%d", rc);
> > 		goto out;
> > 	}
> >
> > -	pr_info("ABI version %u.%u", tpm_crb_ffa->major_version,
> > +	dev_info(&ffa_dev->dev, "ABI version %u.%u", tpm_crb_ffa->major_version,
> > 		tpm_crb_ffa->minor_version);
> >
> > 	if (tpm_crb_ffa->major_version != CRB_FFA_VERSION_MAJOR ||
> > 	    (tpm_crb_ffa->minor_version > 0 &&
> > 	    tpm_crb_ffa->minor_version < CRB_FFA_VERSION_MINOR)) {
> > -		pr_err("Incompatible ABI version");
> > +		dev_warn(&ffa_dev->dev, "Incompatible ABI version");
> > 		goto out;
> > 	}
> >
> > --
> > LEVI:{C3F47F37-75D8-414A-A8BA-3980EC8A46D7}
> >
>

--
Sincerely,
Yeoreum Yun
diff mbox series

Patch

diff --git a/drivers/char/tpm/tpm_crb_ffa.c b/drivers/char/tpm/tpm_crb_ffa.c
index fed775cf53ab..0bb8098e93ae 100644
--- a/drivers/char/tpm/tpm_crb_ffa.c
+++ b/drivers/char/tpm/tpm_crb_ffa.c
@@ -303,7 +303,7 @@  static int tpm_crb_ffa_probe(struct ffa_device *ffa_dev)
 
 	if (!ffa_partition_supports_direct_recv(ffa_dev) &&
 	    !ffa_partition_supports_direct_req2_recv(ffa_dev)) {
-		pr_err("TPM partition doesn't support direct message receive.\n");
+		dev_warn(&ffa_dev->dev, "partition doesn't support direct message receive.\n");
 		return -EINVAL;
 	}
 
@@ -324,17 +324,17 @@  static int tpm_crb_ffa_probe(struct ffa_device *ffa_dev)
 	rc = tpm_crb_ffa_get_interface_version(&tpm_crb_ffa->major_version,
 					       &tpm_crb_ffa->minor_version);
 	if (rc) {
-		pr_err("failed to get crb interface version. rc:%d", rc);
+		dev_err(&ffa_dev->dev, "failed to get crb interface version. rc:%d", rc);
 		goto out;
 	}
 
-	pr_info("ABI version %u.%u", tpm_crb_ffa->major_version,
+	dev_info(&ffa_dev->dev, "ABI version %u.%u", tpm_crb_ffa->major_version,
 		tpm_crb_ffa->minor_version);
 
 	if (tpm_crb_ffa->major_version != CRB_FFA_VERSION_MAJOR ||
 	    (tpm_crb_ffa->minor_version > 0 &&
 	    tpm_crb_ffa->minor_version < CRB_FFA_VERSION_MINOR)) {
-		pr_err("Incompatible ABI version");
+		dev_warn(&ffa_dev->dev, "Incompatible ABI version");
 		goto out;
 	}