mirror of
https://github.com/torvalds/linux.git
synced 2024-10-25 14:40:58 +00:00
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>
This commit is contained in:
parent
75bc37fefc
commit
d0f2e42329
|
@ -131,8 +131,7 @@ static ssize_t arm_spe_pmu_cap_show(struct device *dev,
|
||||||
struct device_attribute *attr,
|
struct device_attribute *attr,
|
||||||
char *buf)
|
char *buf)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct arm_spe_pmu *spe_pmu = dev_get_drvdata(dev);
|
||||||
struct arm_spe_pmu *spe_pmu = platform_get_drvdata(pdev);
|
|
||||||
struct dev_ext_attribute *ea =
|
struct dev_ext_attribute *ea =
|
||||||
container_of(attr, struct dev_ext_attribute, attr);
|
container_of(attr, struct dev_ext_attribute, attr);
|
||||||
int cap = (long)ea->var;
|
int cap = (long)ea->var;
|
||||||
|
@ -247,8 +246,7 @@ static ssize_t arm_spe_pmu_get_attr_cpumask(struct device *dev,
|
||||||
struct device_attribute *attr,
|
struct device_attribute *attr,
|
||||||
char *buf)
|
char *buf)
|
||||||
{
|
{
|
||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct arm_spe_pmu *spe_pmu = dev_get_drvdata(dev);
|
||||||
struct arm_spe_pmu *spe_pmu = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
return cpumap_print_to_pagebuf(true, buf, &spe_pmu->supported_cpus);
|
return cpumap_print_to_pagebuf(true, buf, &spe_pmu->supported_cpus);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user