aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorLars-Peter Clausen <[email protected]>2021-10-19 10:29:28 +0200
committerJonathan Cameron <[email protected]>2021-11-17 17:51:39 +0000
commit907b2ad8c9acad39ac1f0ccdbbe66c63856055e3 (patch)
tree144f453ce43060b689226be4cf7b188aff665812 /tools/perf/scripts/python
parenteb0469894ba788ffdc81097b7dea822432e479d9 (diff)
iio: at91-sama5d2: Fix incorrect cast to platform_device
The at91-sama5d2 driver calls `to_platform_device()` on a struct device that is part of a IIO device. This is incorrect since `to_platform_device()` must only be called on a struct device that is part of a platform device. The code still works by accident because non of the struct platform_device specific fields are accessed. Refactor the code a bit so that it behaves identically, but does not use the incorrect cast. This avoids accidentally adding undefined behavior in the future by assuming the `struct platform_device` is actually valid. Signed-off-by: Lars-Peter Clausen <[email protected]> Tested-by: Eugen Hristev <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions