[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240328140525.6364512e@jic23-huawei>
Date: Thu, 28 Mar 2024 14:05:25 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: David Lechner <dlechner@...libre.com>
Cc: Jonathan Corbet <corbet@....net>, Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, Jean Delvare <jdelvare@...e.com>, Guenter
Roeck <linux@...ck-us.net>, Support Opensource
<support.opensource@...semi.com>, Cosmin Tanislav
<cosmin.tanislav@...log.com>, Lars-Peter Clausen <lars@...afoo.de>, Michael
Hennerich <Michael.Hennerich@...log.com>, Antoniu Miclaus
<antoniu.miclaus@...log.com>, Greg Kroah-Hartman
<gregkh@...uxfoundation.org>, Dmitry Torokhov <dmitry.torokhov@...il.com>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hwmon@...r.kernel.org, linux-iio@...r.kernel.org,
linux-staging@...ts.linux.dev, linux-input@...r.kernel.org
Subject: Re: [PATCH RFC 2/7] hwmon: (adc128d818) Use
devm_regulator_get_optional_enable_get_voltage()
On Wed, 27 Mar 2024 18:18:51 -0500
David Lechner <dlechner@...libre.com> 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@...libre.com>
One trivial thing.
With that tidied up...
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
> 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;
> -}
Powered by blists - more mailing lists