Skip to content

Commit d08a409

Browse files
jonhunterthierryreding
authored andcommitted
soc/tegra: fuse: Trivial clean-up of tegra_init_revision()
Clean-up the tegra_init_revision() function by removing the 'rev' variable which is not needed and use the newly added helper function tegra_get_minor_rev() to get the minor revision. Signed-off-by: Jon Hunter <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent 379ac9e commit d08a409

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

drivers/soc/tegra/fuse/tegra-apbmisc.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,36 +75,32 @@ static const struct of_device_id apbmisc_match[] __initconst = {
7575

7676
void __init tegra_init_revision(void)
7777
{
78-
u32 id, chip_id, minor_rev;
79-
int rev;
78+
u8 chip_id, minor_rev;
8079

81-
id = tegra_read_chipid();
82-
chip_id = (id >> 8) & 0xff;
83-
minor_rev = (id >> 16) & 0xf;
80+
chip_id = tegra_get_chip_id();
81+
minor_rev = tegra_get_minor_rev();
8482

8583
switch (minor_rev) {
8684
case 1:
87-
rev = TEGRA_REVISION_A01;
85+
tegra_sku_info.revision = TEGRA_REVISION_A01;
8886
break;
8987
case 2:
90-
rev = TEGRA_REVISION_A02;
88+
tegra_sku_info.revision = TEGRA_REVISION_A02;
9189
break;
9290
case 3:
9391
if (chip_id == TEGRA20 && (tegra_fuse_read_spare(18) ||
9492
tegra_fuse_read_spare(19)))
95-
rev = TEGRA_REVISION_A03p;
93+
tegra_sku_info.revision = TEGRA_REVISION_A03p;
9694
else
97-
rev = TEGRA_REVISION_A03;
95+
tegra_sku_info.revision = TEGRA_REVISION_A03;
9896
break;
9997
case 4:
100-
rev = TEGRA_REVISION_A04;
98+
tegra_sku_info.revision = TEGRA_REVISION_A04;
10199
break;
102100
default:
103-
rev = TEGRA_REVISION_UNKNOWN;
101+
tegra_sku_info.revision = TEGRA_REVISION_UNKNOWN;
104102
}
105103

106-
tegra_sku_info.revision = rev;
107-
108104
tegra_sku_info.sku_id = tegra_fuse_read_early(FUSE_SKU_INFO);
109105
}
110106

0 commit comments

Comments
 (0)