Re: [PATCH 5/5] hwmon: (gpio-fan) Add regulator support

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

 



On 2/10/25 07:26, Mark Brown wrote:
On Mon, Feb 10, 2025 at 03:59:33PM +0100, Alexander Stein wrote:

+	fan_data->supply = devm_regulator_get_optional(dev, "fan");
+	if (IS_ERR(fan_data->supply)) {
+		err = PTR_ERR(fan_data->supply);

Unless fans are expected to operate without power (which does seem
unlikely) the supply should really be mandatory.

Agreed. devm_regulator_get() returns a dummy regulator of none is
configured in devicetree, so this should be fine. Worse,
regulator_get_optional() returns an error pointer if regulator
support is disabled, while devm_regulator_get() returns NULL.

Guenter





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux