[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181216121336.3f31b532@archlinux>
Date: Sun, 16 Dec 2018 12:13:36 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Marcelo Schmitt <marcelo.schmitt1@...il.com>
Cc: lars@...afoo.de, Michael.Hennerich@...log.com, knaack.h@....de,
pmeerw@...erw.net, gregkh@...uxfoundation.org,
stefan.popa@...log.com, alexandru.Ardelean@...log.com,
linux-iio@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org, kernel-usp@...glegroups.com
Subject: Re: [PATCH 1/3] staging: iio: ad5933: change regulator binging for
vref
On Sat, 8 Dec 2018 16:19:08 -0200
Marcelo Schmitt <marcelo.schmitt1@...il.com> wrote:
> Set a single voltage regulator for all voltage references.
> Remove voltage reference value from default platafrom data struct.
>
> Signed-off-by: Marcelo Schmitt <marcelo.schmitt1@...il.com>
> Signed-off-by: Gabriel Capella <gabriel@...ella.pro>
> Co-Developed-by: Gabriel Capella <gabriel@...ella.pro>
Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.
Thanks,
Jonathan
> ---
> drivers/staging/iio/impedance-analyzer/ad5933.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
> index 9e52384f5370..730bc397a26b 100644
> --- a/drivers/staging/iio/impedance-analyzer/ad5933.c
> +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
> @@ -91,7 +91,6 @@
>
> struct ad5933_platform_data {
> unsigned long ext_clk_hz;
> - unsigned short vref_mv;
> };
>
> struct ad5933_state {
> @@ -113,7 +112,6 @@ struct ad5933_state {
> };
>
> static struct ad5933_platform_data ad5933_default_pdata = {
> - .vref_mv = 3300,
> };
>
> #define AD5933_CHANNEL(_type, _extend_name, _info_mask_separate, _address, \
> @@ -691,7 +689,7 @@ static void ad5933_work(struct work_struct *work)
> static int ad5933_probe(struct i2c_client *client,
> const struct i2c_device_id *id)
> {
> - int ret, voltage_uv = 0;
> + int ret;
> struct ad5933_platform_data *pdata = dev_get_platdata(&client->dev);
> struct ad5933_state *st;
> struct iio_dev *indio_dev;
> @@ -718,12 +716,12 @@ static int ad5933_probe(struct i2c_client *client,
> dev_err(&client->dev, "Failed to enable specified VDD supply\n");
> return ret;
> }
> - voltage_uv = regulator_get_voltage(st->reg);
> + ret = regulator_get_voltage(st->reg);
> +
> + if (ret < 0)
> + goto error_disable_reg;
>
> - if (voltage_uv)
> - st->vref_mv = voltage_uv / 1000;
> - else
> - st->vref_mv = pdata->vref_mv;
> + st->vref_mv = ret / 1000;
>
> if (pdata->ext_clk_hz) {
> st->mclk_hz = pdata->ext_clk_hz;
Powered by blists - more mailing lists