]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
soc/tegra: pmc: Use driver-private data
authorThierry Reding <treding@nvidia.com>
Mon, 3 Feb 2025 13:52:46 +0000 (14:52 +0100)
committerThierry Reding <treding@nvidia.com>
Sun, 18 Jan 2026 07:48:30 +0000 (08:48 +0100)
Instead of relying on a global variable for the PMC context, use the
driver-private data for sysfs attributes.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/soc/tegra/pmc.c

index da8890520fc8d0609b20b0e4f75e79498e81b580..9cfa7c3d5cae6467634a49ec36fa2b84bd1038bf 100644 (file)
@@ -2243,6 +2243,7 @@ static int tegra_pmc_pinctrl_init(struct tegra_pmc *pmc)
 static ssize_t reset_reason_show(struct device *dev,
                                 struct device_attribute *attr, char *buf)
 {
+       struct tegra_pmc *pmc = dev_get_drvdata(dev);
        u32 value;
 
        value = tegra_pmc_readl(pmc, pmc->soc->regs->rst_status);
@@ -2260,6 +2261,7 @@ static DEVICE_ATTR_RO(reset_reason);
 static ssize_t reset_level_show(struct device *dev,
                                struct device_attribute *attr, char *buf)
 {
+       struct tegra_pmc *pmc = dev_get_drvdata(dev);
        u32 value;
 
        value = tegra_pmc_readl(pmc, pmc->soc->regs->rst_status);