linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc/tegra: fuse: Update the SoC revision attribute to display a name
@ 2020-04-17 12:40 Jon Hunter
  2020-04-21 22:16 ` Thierry Reding
  0 siblings, 1 reply; 2+ messages in thread
From: Jon Hunter @ 2020-04-17 12:40 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-tegra, linux-kernel, Jon Hunter

Currently the SoC revision attribute for Tegra devices displays the
value of the enum associated with a particular revision. This is not
very useful because to obtain the actual revision you need to
use the tegra_revision enumeration to translate the value.

It is more meaningful to display a name for the revision, such as
'A01', than the enumarated value and therefore, update the revision
attribute to display a name. This change does alter the ABI, which
is unfortunate, but this is more meaningful and maintable.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/soc/tegra/fuse/fuse-tegra.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
index db65ddb6a5d2..d1f8dd0289e6 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra.c
@@ -363,7 +363,8 @@ struct device * __init tegra_soc_device_register(void)
 		return NULL;
 
 	attr->family = kasprintf(GFP_KERNEL, "Tegra");
-	attr->revision = kasprintf(GFP_KERNEL, "%d", tegra_sku_info.revision);
+	attr->revision = kasprintf(GFP_KERNEL, "%s",
+		tegra_revision_name[tegra_sku_info.revision]);
 	attr->soc_id = kasprintf(GFP_KERNEL, "%u", tegra_get_chip_id());
 	attr->custom_attr_group = fuse->soc->soc_attr_group;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] soc/tegra: fuse: Update the SoC revision attribute to display a name
  2020-04-17 12:40 [PATCH] soc/tegra: fuse: Update the SoC revision attribute to display a name Jon Hunter
@ 2020-04-21 22:16 ` Thierry Reding
  0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2020-04-21 22:16 UTC (permalink / raw)
  To: Jon Hunter; +Cc: linux-tegra, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 800 bytes --]

On Fri, Apr 17, 2020 at 01:40:46PM +0100, Jon Hunter wrote:
> Currently the SoC revision attribute for Tegra devices displays the
> value of the enum associated with a particular revision. This is not
> very useful because to obtain the actual revision you need to
> use the tegra_revision enumeration to translate the value.
> 
> It is more meaningful to display a name for the revision, such as
> 'A01', than the enumarated value and therefore, update the revision
> attribute to display a name. This change does alter the ABI, which
> is unfortunate, but this is more meaningful and maintable.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  drivers/soc/tegra/fuse/fuse-tegra.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-21 22:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17 12:40 [PATCH] soc/tegra: fuse: Update the SoC revision attribute to display a name Jon Hunter
2020-04-21 22:16 ` Thierry Reding

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).