Skip to content

Commit 2e944c5

Browse files
committed
soc/tegra: pmc: Use driver-private data
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>
1 parent bb946b0 commit 2e944c5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/soc/tegra/pmc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,6 +2243,7 @@ static int tegra_pmc_pinctrl_init(struct tegra_pmc *pmc)
22432243
static ssize_t reset_reason_show(struct device *dev,
22442244
struct device_attribute *attr, char *buf)
22452245
{
2246+
struct tegra_pmc *pmc = dev_get_drvdata(dev);
22462247
u32 value;
22472248

22482249
value = tegra_pmc_readl(pmc, pmc->soc->regs->rst_status);
@@ -2260,6 +2261,7 @@ static DEVICE_ATTR_RO(reset_reason);
22602261
static ssize_t reset_level_show(struct device *dev,
22612262
struct device_attribute *attr, char *buf)
22622263
{
2264+
struct tegra_pmc *pmc = dev_get_drvdata(dev);
22632265
u32 value;
22642266

22652267
value = tegra_pmc_readl(pmc, pmc->soc->regs->rst_status);

0 commit comments

Comments
 (0)