Re: [PATCH 2/4] hwmon: Add Qualcomm PMIC BCL hardware monitor driver

Krzysztof Kozlowski
2026-02-06T09:38:47Z

On 06/02/2026 10:27, Konrad Dybcio wrote:
> On 2/5/26 10:14 PM, Manaf Meethalavalappu Pallikunhi wrote:
>
>> +static unsigned int bcl_get_version_major(const struct bcl_device *bcl)
>> +{
>> + u32 raw_val = 0;
>> +
>> + bcl_read_field_value(bcl, F_V_MAJOR, &raw_val);
>> +
>> + return raw_val;
>> +}
>> +
>> +static unsigned int bcl_get_version_minor(const struct bcl_device *bcl)
>> +{
>> + u32 raw_val = 0;
>> +
>> + bcl_read_field_value(bcl, F_V_MINOR, &raw_val);
>> +
>> + return raw_val;
>> +}
>
> Do we really need so many read-1-value functions?

Yes, because we need multiple layers of indirections and multiple
abstract layers, so the code will be difficult to understand. This gives
us job security. Also, more lines of code justifies our spent time.
That's why this should also include kerneldoc of at least 10 lines.

Best regards,
Krzysztof