On 7/2/23 18:48, Dixit, Ashutosh wrote:
On Sun, 02 Jul 2023 13:51:40 -0700, Guenter Roeck wrote:
On 7/2/23 13:29, Dixit, Ashutosh wrote:
Of course people might have been abusing the deprecated API's (or NULL chip
parameter) but to me it seems there is also some legitimate use for them.
You still neglect to explain what you think that legitimate use would be.
To me "drivers/gpu/drm/amd/pm/amdgpu_pm.c" is a legitimate use case which
doesn't use chip_info (both standard and custom hwmon attributes are
defined without using chip_info). "drivers/gpu/drm/i915/i915_hwmon.c" has
In new code, standard hwmon attributes MUST be defined using chip_info.
Declaring the use of a deprecated API as "legitimate use case" and use it
as example for new code is never appropriate.
all this extra code related to chip_info/channel_info which is not
needed. i915 could well move to the amdgpu model and that would reduce i915
Yes, and the proposed i915 code _doesn't_ have all the extra code that would
otherwise be needed to generate and read/write sysfs attributes directly.
code. That is what I was originally proposing for this new patch series.
This is wrong. Using chip_info _always_ reduces code size for standard
hwmon attributes, because the code can concentrate on reading and
writing values from/to the chip and doesn't have to bother with sysfs
attribute handling. Convert drivers/gpu/drm/amd/pm/amdgpu_pm.c to use
the with_info API and you'll see.
Guenter