linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power: supply: mt6360: Use LINEAR_RANGE_IDX()
@ 2022-10-31  9:25 Matti Vaittinen
  2022-11-01  0:04 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Matti Vaittinen @ 2022-10-31  9:25 UTC (permalink / raw)
  To: Matti Vaittinen, Matti Vaittinen
  Cc: Sebastian Reichel, Matthias Brugger, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2104 bytes --]

Do minor clean-up by using the newly inroduced LINEAR_RANGE_IDX()
initialization macro.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>

---
Sorry, this one evaded my original grep so sending an individual patch.
Would've squashed this with bd99954 one if I spotted it right away.
---
 drivers/power/supply/mt6360_charger.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/power/supply/mt6360_charger.c b/drivers/power/supply/mt6360_charger.c
index 3abaa72e0668..92e48e3a4853 100644
--- a/drivers/power/supply/mt6360_charger.c
+++ b/drivers/power/supply/mt6360_charger.c
@@ -113,16 +113,13 @@ enum {
 	MT6360_RANGE_MAX,
 };
 
-#define MT6360_LINEAR_RANGE(idx, _min, _min_sel, _max_sel, _step) \
-	[idx] = REGULATOR_LINEAR_RANGE(_min, _min_sel, _max_sel, _step)
-
 static const struct linear_range mt6360_chg_range[MT6360_RANGE_MAX] = {
-	MT6360_LINEAR_RANGE(MT6360_RANGE_VMIVR, 3900000, 0, 0x5F, 100000),
-	MT6360_LINEAR_RANGE(MT6360_RANGE_ICHG, 100000, 0, 0x31, 100000),
-	MT6360_LINEAR_RANGE(MT6360_RANGE_VOREG, 3900000, 0, 0x51, 10000),
-	MT6360_LINEAR_RANGE(MT6360_RANGE_AICR, 100000, 0, 0x3F, 50000),
-	MT6360_LINEAR_RANGE(MT6360_RANGE_IPREC, 100000, 0, 0x0F, 50000),
-	MT6360_LINEAR_RANGE(MT6360_RANGE_IEOC, 100000, 0, 0x0F, 50000),
+	LINEAR_RANGE_IDX(MT6360_RANGE_VMIVR, 3900000, 0, 0x5F, 100000),
+	LINEAR_RANGE_IDX(MT6360_RANGE_ICHG, 100000, 0, 0x31, 100000),
+	LINEAR_RANGE_IDX(MT6360_RANGE_VOREG, 3900000, 0, 0x51, 10000),
+	LINEAR_RANGE_IDX(MT6360_RANGE_AICR, 100000, 0, 0x3F, 50000),
+	LINEAR_RANGE_IDX(MT6360_RANGE_IPREC, 100000, 0, 0x0F, 50000),
+	LINEAR_RANGE_IDX(MT6360_RANGE_IEOC, 100000, 0, 0x0F, 50000),
 };
 
 struct mt6360_chg_info {
-- 
2.37.3


-- 
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =] 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] power: supply: mt6360: Use LINEAR_RANGE_IDX()
  2022-10-31  9:25 [PATCH] power: supply: mt6360: Use LINEAR_RANGE_IDX() Matti Vaittinen
@ 2022-11-01  0:04 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2022-11-01  0:04 UTC (permalink / raw)
  To: Matti Vaittinen
  Cc: Matti Vaittinen, Matthias Brugger, linux-pm, linux-arm-kernel,
	linux-mediatek, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2326 bytes --]

Hi,

On Mon, Oct 31, 2022 at 11:25:00AM +0200, Matti Vaittinen wrote:
> Do minor clean-up by using the newly inroduced LINEAR_RANGE_IDX()
> initialization macro.
> 
> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
> 
> ---
> Sorry, this one evaded my original grep so sending an individual patch.
> Would've squashed this with bd99954 one if I spotted it right away.
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/mt6360_charger.c | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/power/supply/mt6360_charger.c b/drivers/power/supply/mt6360_charger.c
> index 3abaa72e0668..92e48e3a4853 100644
> --- a/drivers/power/supply/mt6360_charger.c
> +++ b/drivers/power/supply/mt6360_charger.c
> @@ -113,16 +113,13 @@ enum {
>  	MT6360_RANGE_MAX,
>  };
>  
> -#define MT6360_LINEAR_RANGE(idx, _min, _min_sel, _max_sel, _step) \
> -	[idx] = REGULATOR_LINEAR_RANGE(_min, _min_sel, _max_sel, _step)
> -
>  static const struct linear_range mt6360_chg_range[MT6360_RANGE_MAX] = {
> -	MT6360_LINEAR_RANGE(MT6360_RANGE_VMIVR, 3900000, 0, 0x5F, 100000),
> -	MT6360_LINEAR_RANGE(MT6360_RANGE_ICHG, 100000, 0, 0x31, 100000),
> -	MT6360_LINEAR_RANGE(MT6360_RANGE_VOREG, 3900000, 0, 0x51, 10000),
> -	MT6360_LINEAR_RANGE(MT6360_RANGE_AICR, 100000, 0, 0x3F, 50000),
> -	MT6360_LINEAR_RANGE(MT6360_RANGE_IPREC, 100000, 0, 0x0F, 50000),
> -	MT6360_LINEAR_RANGE(MT6360_RANGE_IEOC, 100000, 0, 0x0F, 50000),
> +	LINEAR_RANGE_IDX(MT6360_RANGE_VMIVR, 3900000, 0, 0x5F, 100000),
> +	LINEAR_RANGE_IDX(MT6360_RANGE_ICHG, 100000, 0, 0x31, 100000),
> +	LINEAR_RANGE_IDX(MT6360_RANGE_VOREG, 3900000, 0, 0x51, 10000),
> +	LINEAR_RANGE_IDX(MT6360_RANGE_AICR, 100000, 0, 0x3F, 50000),
> +	LINEAR_RANGE_IDX(MT6360_RANGE_IPREC, 100000, 0, 0x0F, 50000),
> +	LINEAR_RANGE_IDX(MT6360_RANGE_IEOC, 100000, 0, 0x0F, 50000),
>  };
>  
>  struct mt6360_chg_info {
> -- 
> 2.37.3
> 
> 
> -- 
> Matti Vaittinen, Linux device drivers
> ROHM Semiconductors, Finland SWDC
> Kiviharjunlenkki 1E
> 90220 OULU
> FINLAND
> 
> ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
> Simon says - in Latin please.
> ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
> Thanks to Simon Glass for the translation =] 



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-01  0:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-31  9:25 [PATCH] power: supply: mt6360: Use LINEAR_RANGE_IDX() Matti Vaittinen
2022-11-01  0:04 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).