RE: [PATCH] ARM: S5PV210: Use REGULATOR_SUPPLY macro for regulator consumers

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

 



Hello,

I'm sorry for the late reply, just noticed this commit on your kernel tree...

On Friday, January 28, 2011 10:29 AM Kukjin Kim wrote:

> To use REGULATOR_SUPPLY macro is cleaner for initializing regulator
> consumer supply.
> 
> Signed-off-by: Kukjin Kim <kgene.kim@xxxxxxxxxxx>
> ---
>  arch/arm/mach-s5pv210/mach-aquila.c |   52 +++++++++++-----------------------
>  arch/arm/mach-s5pv210/mach-goni.c   |   52 +++++++++++-----------------------
>  2 files changed, 34 insertions(+), 70 deletions(-)
> 
> diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
> index 461aa03..38b3d67 100644
> --- a/arch/arm/mach-s5pv210/mach-aquila.c
> +++ b/arch/arm/mach-s5pv210/mach-aquila.c
> @@ -296,13 +296,11 @@ static struct regulator_init_data aquila_ldo17_data = {
>  };
> 
>  /* BUCK */
> -static struct regulator_consumer_supply buck1_consumer[] = {
> -	{	.supply	= "vddarm", },
> -};
> +static struct regulator_consumer_supply buck1_consumer =
> +	REGULATOR_SUPPLY("vddarm", NULL);
> 
> -static struct regulator_consumer_supply buck2_consumer[] = {
> -	{	.supply	= "vddint", },
> -};
> +static struct regulator_consumer_supply buck2_consumer =
> +	REGULATOR_SUPPLY("vddint", NULL);
> 
>  static struct regulator_init_data aquila_buck1_data = {
>  	.constraints	= {
> @@ -313,8 +311,8 @@ static struct regulator_init_data aquila_buck1_data = {
>  		.valid_ops_mask	= REGULATOR_CHANGE_VOLTAGE |
>  				  REGULATOR_CHANGE_STATUS,
>  	},
> -	.num_consumer_supplies	= ARRAY_SIZE(buck1_consumer),
> -	.consumer_supplies	= buck1_consumer,
> +	.num_consumer_supplies	= 1,
> +	.consumer_supplies	= &buck1_consumer,
>  };

I'm really not sure that this type of change is necessary. IMHO it makes the code harder
to read, update or reuse. What is the reason for it?

[snip]

Best regards
--
Marek Szyprowski
Samsung Poland R&D Center


--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux