thermal: sysfs: Get to trips via attribute pointers
The _store() and _show() functions for sysfs attributes corresponding to trip point parameters (type, temperature and hysteresis) read the trip ID from the attribute name and then use the trip ID as the index in the given thermal zone's trips table to get to the trip object they want. Instead of doing this, make them use the attribute pointer they get as the second argument to get to the trip object embedded in the same struct thermal_trip_desc as the struct device_attribute pointed to by it, which is much more straightforward and less overhead. Signed-off-by:Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/114841552.nniJfEyVGO@rjwysocki.net
Showing
Please register or sign in to comment