Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soc/tegra: fuse: Update the SoC revision attribute to display a name

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>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Jon Hunter and committed by
Thierry Reding
37558ac8 d08a4095

+2 -1
+2 -1
drivers/soc/tegra/fuse/fuse-tegra.c
··· 363 363 return NULL; 364 364 365 365 attr->family = kasprintf(GFP_KERNEL, "Tegra"); 366 - attr->revision = kasprintf(GFP_KERNEL, "%d", tegra_sku_info.revision); 366 + attr->revision = kasprintf(GFP_KERNEL, "%s", 367 + tegra_revision_name[tegra_sku_info.revision]); 367 368 attr->soc_id = kasprintf(GFP_KERNEL, "%u", tegra_get_chip_id()); 368 369 attr->custom_attr_group = fuse->soc->soc_attr_group; 369 370