[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0fad815c-e6aa-06a6-4280-bc4ebad33107@gmail.com>
Date: Sat, 20 Aug 2022 16:26:38 +0300
From: Matti Vaittinen <mazziesaccount@...il.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>,
Lars-Peter Clausen <lars@...afoo.de>,
Miaoqian Lin <linmq006@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Xiang wangx <wangxiang@...rlc.com>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 08/14] iio: bmg160_core: Simplify using
devm_regulator_*get_enable()
On 8/20/22 14:22, Jonathan Cameron wrote:
> On Fri, 19 Aug 2022 22:19:31 +0300
> Matti Vaittinen <mazziesaccount@...il.com> wrote:
>
>> Use devm_regulator_bulk_get_enable() instead of open coded bulk-get,
>> bulk-enable, add-action-to-disable-at-detach - pattern.
>>
>> Signed-off-by: Matti Vaittinen <mazziesaccount@...il.com>
>>
>> ---
>> v2 => v3
>> Split to own patch.
>> ---
>> drivers/iio/gyro/bmg160_core.c | 24 +++---------------------
>> 1 file changed, 3 insertions(+), 21 deletions(-)
>>
>> diff --git a/drivers/iio/gyro/bmg160_core.c b/drivers/iio/gyro/bmg160_core.c
>> index cedd9f02ea21..baa80980c99f 100644
>> --- a/drivers/iio/gyro/bmg160_core.c
>> +++ b/drivers/iio/gyro/bmg160_core.c
>> @@ -93,7 +93,6 @@
>>
>> struct bmg160_data {
>> struct regmap *regmap;
>> - struct regulator_bulk_data regulators[2];
>> struct iio_trigger *dready_trig;
>> struct iio_trigger *motion_trig;
>> struct iio_mount_matrix orientation;
>> @@ -1067,19 +1066,13 @@ static const char *bmg160_match_acpi_device(struct device *dev)
>> return dev_name(dev);
>> }
>>
>> -static void bmg160_disable_regulators(void *d)
>> -{
>> - struct bmg160_data *data = d;
>> -
>> - regulator_bulk_disable(ARRAY_SIZE(data->regulators), data->regulators);
>> -}
>> -
>> int bmg160_core_probe(struct device *dev, struct regmap *regmap, int irq,
>> const char *name)
>> {
>> struct bmg160_data *data;
>> struct iio_dev *indio_dev;
>> int ret;
>> + static const char * const regulators[] = {"vdd", "vddio"};
>
> As in previous, small preference for spaces after { and before }
Thanks. I'll fix it when I respin.
--
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland
~~ When things go utterly wrong vim users can always type :help! ~~
Powered by blists - more mailing lists