Re: [PATCH v2 3/4] hwmon: Add support for Amphenol ChipCap 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/11/2023 15:55, Guenter Roeck wrote:
>>> +	if (IS_ERR(data->hwmon)) {
>>> +		ret = PTR_ERR(data->hwmon);
>>> +		goto cleanup;
>>> +	}
>>> +
>>> +	return 0;
>>> +
>>> +cleanup:
>>> +	if (cc2_disable(data))
>>> +		dev_dbg(dev, "Failed to disable device");
>>> +
>>> +	return dev_err_probe(dev, ret,
>>> +			     "Unable to register hwmon device\n");
>>
>> Drop or move to each error path.
>>
> This actually follows Documentation/process/coding-style.rst, chapter 7
> (Centralized exiting of functions).

The point is that centralized message of error is useless. Probe failure
is already handled by core, thus another message doing the same is
redundant. What is needed to explain the true reason of failure, thus
the error message should be next to each type of failure. Missing
regulator? Say it. Missing clock? Say something else.

Best regards,
Krzysztof




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux