diff options
| author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2018-04-19 10:06:07 -0400 |
|---|---|---|
| committer | Will Deacon <will.deacon@arm.com> | 2018-05-21 13:02:35 -0400 |
| commit | d0f2e423295313a30b1d56f3b24e9e927f0b66b7 (patch) | |
| tree | 2ec8e34b733876ef1de6cd6f259f920e785e3779 /drivers/perf | |
| parent | 75bc37fefc4471e718ba8e651aa74673d4e0a9eb (diff) | |
perf: simplify getting .drvdata
We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/perf')
| -rw-r--r-- | drivers/perf/arm_spe_pmu.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c index 28bb642af18b..54ec278d2fc4 100644 --- a/drivers/perf/arm_spe_pmu.c +++ b/drivers/perf/arm_spe_pmu.c | |||
| @@ -131,8 +131,7 @@ static ssize_t arm_spe_pmu_cap_show(struct device *dev, | |||
| 131 | struct device_attribute *attr, | 131 | struct device_attribute *attr, |
| 132 | char *buf) | 132 | char *buf) |
| 133 | { | 133 | { |
| 134 | struct platform_device *pdev = to_platform_device(dev); | 134 | struct arm_spe_pmu *spe_pmu = dev_get_drvdata(dev); |
| 135 | struct arm_spe_pmu *spe_pmu = platform_get_drvdata(pdev); | ||
| 136 | struct dev_ext_attribute *ea = | 135 | struct dev_ext_attribute *ea = |
| 137 | container_of(attr, struct dev_ext_attribute, attr); | 136 | container_of(attr, struct dev_ext_attribute, attr); |
| 138 | int cap = (long)ea->var; | 137 | int cap = (long)ea->var; |
| @@ -247,8 +246,7 @@ static ssize_t arm_spe_pmu_get_attr_cpumask(struct device *dev, | |||
| 247 | struct device_attribute *attr, | 246 | struct device_attribute *attr, |
| 248 | char *buf) | 247 | char *buf) |
| 249 | { | 248 | { |
| 250 | struct platform_device *pdev = to_platform_device(dev); | 249 | struct arm_spe_pmu *spe_pmu = dev_get_drvdata(dev); |
| 251 | struct arm_spe_pmu *spe_pmu = platform_get_drvdata(pdev); | ||
| 252 | 250 | ||
| 253 | return cpumap_print_to_pagebuf(true, buf, &spe_pmu->supported_cpus); | 251 | return cpumap_print_to_pagebuf(true, buf, &spe_pmu->supported_cpus); |
| 254 | } | 252 | } |
