diff mbox

[v2,06/10] mfd: tps65910: Use the standard DT property system-power-controller

Message ID 1414427215-14380-6-git-send-email-romain.perier@gmail.com
State Not Applicable, archived
Headers show

Commit Message

Romain Perier Oct. 27, 2014, 4:26 p.m. UTC
No longer use custom property to define poweroff capability, use the standard
DT property instead.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
---
 drivers/mfd/tps65910.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Lucas Stach Oct. 27, 2014, 4:35 p.m. UTC | #1
Am Montag, den 27.10.2014, 16:26 +0000 schrieb Romain Perier:
> No longer use custom property to define poweroff capability, use the standard
> DT property instead.
> 
> Signed-off-by: Romain Perier <romain.perier@gmail.com>
> ---
>  drivers/mfd/tps65910.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
> index 7612d89..a7faff2 100644
> --- a/drivers/mfd/tps65910.c
> +++ b/drivers/mfd/tps65910.c
> @@ -423,8 +423,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
>  
>  	board_info->irq = client->irq;
>  	board_info->irq_base = -1;
> -	board_info->pm_off = of_property_read_bool(np,
> -			"ti,system-power-controller");
> +	board_info->pm_off = of_is_system_power_controller();
>  
>  	return board_info;
>  }
You are breaking compatibility with older DTs here. This is not
acceptable.

You may change all in-tree DTs to use the new property and also patch
the driver to understand it, but you must make sure that the driver
still understands the old, custom property. And especially in this case
it isn't really hard to do.

Regards,
Lucas
Felipe Balbi Oct. 27, 2014, 4:41 p.m. UTC | #2
On Mon, Oct 27, 2014 at 04:26:51PM +0000, Romain Perier wrote:
> No longer use custom property to define poweroff capability, use the standard
> DT property instead.
> 
> Signed-off-by: Romain Perier <romain.perier@gmail.com>
> ---
>  drivers/mfd/tps65910.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
> index 7612d89..a7faff2 100644
> --- a/drivers/mfd/tps65910.c
> +++ b/drivers/mfd/tps65910.c
> @@ -423,8 +423,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
>  
>  	board_info->irq = client->irq;
>  	board_info->irq_base = -1;
> -	board_info->pm_off = of_property_read_bool(np,
> -			"ti,system-power-controller");
> +	board_info->pm_off = of_is_system_power_controller();

you didn't build-test this, did you ?
Felipe Balbi Oct. 27, 2014, 4:41 p.m. UTC | #3
On Mon, Oct 27, 2014 at 05:35:49PM +0100, Lucas Stach wrote:
> Am Montag, den 27.10.2014, 16:26 +0000 schrieb Romain Perier:
> > No longer use custom property to define poweroff capability, use the standard
> > DT property instead.
> > 
> > Signed-off-by: Romain Perier <romain.perier@gmail.com>
> > ---
> >  drivers/mfd/tps65910.c | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
> > index 7612d89..a7faff2 100644
> > --- a/drivers/mfd/tps65910.c
> > +++ b/drivers/mfd/tps65910.c
> > @@ -423,8 +423,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
> >  
> >  	board_info->irq = client->irq;
> >  	board_info->irq_base = -1;
> > -	board_info->pm_off = of_property_read_bool(np,
> > -			"ti,system-power-controller");
> > +	board_info->pm_off = of_is_system_power_controller();
> >  
> >  	return board_info;
> >  }
> You are breaking compatibility with older DTs here. This is not
> acceptable.
> 
> You may change all in-tree DTs to use the new property and also patch
> the driver to understand it, but you must make sure that the driver
> still understands the old, custom property. And especially in this case
> it isn't really hard to do.

correct, it should be simple to hide that under
of_is_system_power_controller() itself.
Johan Hovold Oct. 27, 2014, 4:43 p.m. UTC | #4
On Mon, Oct 27, 2014 at 11:41:53AM -0500, Felipe Balbi wrote:
> On Mon, Oct 27, 2014 at 05:35:49PM +0100, Lucas Stach wrote:
> > Am Montag, den 27.10.2014, 16:26 +0000 schrieb Romain Perier:
> > > No longer use custom property to define poweroff capability, use the standard
> > > DT property instead.
> > > 
> > > Signed-off-by: Romain Perier <romain.perier@gmail.com>
> > > ---
> > >  drivers/mfd/tps65910.c | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
> > > index 7612d89..a7faff2 100644
> > > --- a/drivers/mfd/tps65910.c
> > > +++ b/drivers/mfd/tps65910.c
> > > @@ -423,8 +423,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
> > >  
> > >  	board_info->irq = client->irq;
> > >  	board_info->irq_base = -1;
> > > -	board_info->pm_off = of_property_read_bool(np,
> > > -			"ti,system-power-controller");
> > > +	board_info->pm_off = of_is_system_power_controller();
> > >  
> > >  	return board_info;
> > >  }
> > You are breaking compatibility with older DTs here. This is not
> > acceptable.
> > 
> > You may change all in-tree DTs to use the new property and also patch
> > the driver to understand it, but you must make sure that the driver
> > still understands the old, custom property. And especially in this case
> > it isn't really hard to do.
> 
> correct, it should be simple to hide that under
> of_is_system_power_controller() itself.

Guys, take a look at the code (PATCH 1/10). ;)

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Heiko Stübner Oct. 27, 2014, 4:49 p.m. UTC | #5
Am Montag, 27. Oktober 2014, 11:41:53 schrieb Felipe Balbi:
> On Mon, Oct 27, 2014 at 05:35:49PM +0100, Lucas Stach wrote:
> > Am Montag, den 27.10.2014, 16:26 +0000 schrieb Romain Perier:
> > > No longer use custom property to define poweroff capability, use the
> > > standard DT property instead.
> > > 
> > > Signed-off-by: Romain Perier <romain.perier@gmail.com>
> > > ---
> > > 
> > >  drivers/mfd/tps65910.c | 3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
> > > index 7612d89..a7faff2 100644
> > > --- a/drivers/mfd/tps65910.c
> > > +++ b/drivers/mfd/tps65910.c
> > > @@ -423,8 +423,7 @@ static struct tps65910_board
> > > *tps65910_parse_dt(struct i2c_client *client,> > 
> > >  	board_info->irq = client->irq;
> > >  	board_info->irq_base = -1;
> > > 
> > > -	board_info->pm_off = of_property_read_bool(np,
> > > -			"ti,system-power-controller");
> > > +	board_info->pm_off = of_is_system_power_controller();
> > > 
> > >  	return board_info;
> > >  
> > >  }
> > 
> > You are breaking compatibility with older DTs here. This is not
> > acceptable.
> > 
> > You may change all in-tree DTs to use the new property and also patch
> > the driver to understand it, but you must make sure that the driver
> > still understands the old, custom property. And especially in this case
> > it isn't really hard to do.
> 
> correct, it should be simple to hide that under
> of_is_system_power_controller() itself.

If I'm reading patch 1 correctly, it already does handle the generic "system-
power-controller", as well as any foo,system-power-controller properties.


Heiko

--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Felipe Balbi Oct. 27, 2014, 4:49 p.m. UTC | #6
On Mon, Oct 27, 2014 at 05:49:34PM +0100, Heiko Stübner wrote:
> Am Montag, 27. Oktober 2014, 11:41:53 schrieb Felipe Balbi:
> > On Mon, Oct 27, 2014 at 05:35:49PM +0100, Lucas Stach wrote:
> > > Am Montag, den 27.10.2014, 16:26 +0000 schrieb Romain Perier:
> > > > No longer use custom property to define poweroff capability, use the
> > > > standard DT property instead.
> > > > 
> > > > Signed-off-by: Romain Perier <romain.perier@gmail.com>
> > > > ---
> > > > 
> > > >  drivers/mfd/tps65910.c | 3 +--
> > > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > > > 
> > > > diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
> > > > index 7612d89..a7faff2 100644
> > > > --- a/drivers/mfd/tps65910.c
> > > > +++ b/drivers/mfd/tps65910.c
> > > > @@ -423,8 +423,7 @@ static struct tps65910_board
> > > > *tps65910_parse_dt(struct i2c_client *client,> > 
> > > >  	board_info->irq = client->irq;
> > > >  	board_info->irq_base = -1;
> > > > 
> > > > -	board_info->pm_off = of_property_read_bool(np,
> > > > -			"ti,system-power-controller");
> > > > +	board_info->pm_off = of_is_system_power_controller();
> > > > 
> > > >  	return board_info;
> > > >  
> > > >  }
> > > 
> > > You are breaking compatibility with older DTs here. This is not
> > > acceptable.
> > > 
> > > You may change all in-tree DTs to use the new property and also patch
> > > the driver to understand it, but you must make sure that the driver
> > > still understands the old, custom property. And especially in this case
> > > it isn't really hard to do.
> > 
> > correct, it should be simple to hide that under
> > of_is_system_power_controller() itself.
> 
> If I'm reading patch 1 correctly, it already does handle the generic "system-
> power-controller", as well as any foo,system-power-controller properties.

that's very true, but it doesn't handle poweroff-source which, one way
or another, will be merged into Linus' tree creating a bisection point
where things won't work.

The best solution would be for those patches to be removed from
whichever tree they are, otherwise there will always be a commit in the
mainline kernel with that binding and, even if unlikely, there will
always be the possibility of people using that commit or a developer
having to bisect an issue only to find a few commits where things don't
even build.
Romain Perier Oct. 27, 2014, 4:53 p.m. UTC | #7
Please take a look at "PATCH v1 1/10" of this serie, read it
carefully... it's already handled ^^

2014-10-27 17:43 GMT+01:00 Johan Hovold <johan@kernel.org>:
> On Mon, Oct 27, 2014 at 11:41:53AM -0500, Felipe Balbi wrote:
>> On Mon, Oct 27, 2014 at 05:35:49PM +0100, Lucas Stach wrote:
>> > Am Montag, den 27.10.2014, 16:26 +0000 schrieb Romain Perier:
>> > > No longer use custom property to define poweroff capability, use the standard
>> > > DT property instead.
>> > >
>> > > Signed-off-by: Romain Perier <romain.perier@gmail.com>
>> > > ---
>> > >  drivers/mfd/tps65910.c | 3 +--
>> > >  1 file changed, 1 insertion(+), 2 deletions(-)
>> > >
>> > > diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
>> > > index 7612d89..a7faff2 100644
>> > > --- a/drivers/mfd/tps65910.c
>> > > +++ b/drivers/mfd/tps65910.c
>> > > @@ -423,8 +423,7 @@ static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
>> > >
>> > >   board_info->irq = client->irq;
>> > >   board_info->irq_base = -1;
>> > > - board_info->pm_off = of_property_read_bool(np,
>> > > -                 "ti,system-power-controller");
>> > > + board_info->pm_off = of_is_system_power_controller();
>> > >
>> > >   return board_info;
>> > >  }
>> > You are breaking compatibility with older DTs here. This is not
>> > acceptable.
>> >
>> > You may change all in-tree DTs to use the new property and also patch
>> > the driver to understand it, but you must make sure that the driver
>> > still understands the old, custom property. And especially in this case
>> > it isn't really hard to do.
>>
>> correct, it should be simple to hide that under
>> of_is_system_power_controller() itself.
>
> Guys, take a look at the code (PATCH 1/10). ;)
>
> Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index 7612d89..a7faff2 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -423,8 +423,7 @@  static struct tps65910_board *tps65910_parse_dt(struct i2c_client *client,
 
 	board_info->irq = client->irq;
 	board_info->irq_base = -1;
-	board_info->pm_off = of_property_read_bool(np,
-			"ti,system-power-controller");
+	board_info->pm_off = of_is_system_power_controller();
 
 	return board_info;
 }