Re: [PATCH RFC 2/7] hwmon: (adc128d818) Use devm_regulator_get_optional_enable_get_voltage()

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

 



On Wed, 27 Mar 2024 18:18:51 -0500
David Lechner <dlechner@xxxxxxxxxxxx> wrote:

> We can reduce boilerplate code and eliminate the driver remove()
> function by using devm_regulator_get_optional_enable_get_voltage().
> 
> A new external_vref flag is added since we no longer have the handle
> to the regulator to check if it is present.
> 
> Signed-off-by: David Lechner <dlechner@xxxxxxxxxxxx>
One trivial thing.
With that tidied up...

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx>

>  	hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name,
>  							   data, adc128_groups);
>  	if (IS_ERR(hwmon_dev)) {
>  		err = PTR_ERR(hwmon_dev);
> -		goto error;
> +		return err;

return PTR_ERR()

>  	}
>  
>  	return 0;
> -
> -error:
> -	if (data->regulator)
> -		regulator_disable(data->regulator);
> -	return err;
> -}




[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