linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] w1: gpio: fix problem with platfom data in w1-gpio
       [not found] <20180218170629.6045-1-paweldembicki@gmail.com>
@ 2018-02-18 17:19 ` Pawel Dembicki
  2018-02-19 13:29   ` Andrew F. Davis
  2018-03-14 13:59   ` Greg Kroah-Hartman
  0 siblings, 2 replies; 8+ messages in thread
From: Pawel Dembicki @ 2018-02-18 17:19 UTC (permalink / raw)
  Cc: stable, Pawel Dembicki, Evgeniy Polyakov, Andrew F. Davis,
	Sebastian Reichel, Greg Kroah-Hartman, linux-kernel

In devices, where fdt is used, is impossible to apply platform data
without proper fdt node.

This patch allow to use platform data in devices with fdt.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Acked-by: Andrew F. Davis <afd@ti.com>
---
 drivers/w1/masters/w1-gpio.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c
index a90728ceec5a..7b80762941af 100644
--- a/drivers/w1/masters/w1-gpio.c
+++ b/drivers/w1/masters/w1-gpio.c
@@ -112,17 +112,16 @@ static int w1_gpio_probe_dt(struct platform_device *pdev)
 static int w1_gpio_probe(struct platform_device *pdev)
 {
 	struct w1_bus_master *master;
-	struct w1_gpio_platform_data *pdata;
+	struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
 	int err;
 
-	if (of_have_populated_dt()) {
+	if (of_have_populated_dt() && !pdata) {
 		err = w1_gpio_probe_dt(pdev);
 		if (err < 0)
 			return err;
+		pdata = dev_get_platdata(&pdev->dev);
 	}
 
-	pdata = dev_get_platdata(&pdev->dev);
-
 	if (!pdata) {
 		dev_err(&pdev->dev, "No configuration data\n");
 		return -ENXIO;
-- 
2.14.1

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

* Re: [PATCH] w1: gpio: fix problem with platfom data in w1-gpio
  2018-02-18 17:19 ` [PATCH] w1: gpio: fix problem with platfom data in w1-gpio Pawel Dembicki
@ 2018-02-19 13:29   ` Andrew F. Davis
  2018-03-14 13:59   ` Greg Kroah-Hartman
  1 sibling, 0 replies; 8+ messages in thread
From: Andrew F. Davis @ 2018-02-19 13:29 UTC (permalink / raw)
  To: Pawel Dembicki
  Cc: stable, Evgeniy Polyakov, Sebastian Reichel, Greg Kroah-Hartman,
	linux-kernel

On 02/18/2018 11:19 AM, Pawel Dembicki wrote:
> In devices, where fdt is used, is impossible to apply platform data
> without proper fdt node.
> 
> This patch allow to use platform data in devices with fdt.
> 
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
> ---

Good catch,

Acked-by: Andrew F. Davis <afd@ti.com>

>  drivers/w1/masters/w1-gpio.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/w1/masters/w1-gpio.c b/drivers/w1/masters/w1-gpio.c
> index a90728ceec5a..7b80762941af 100644
> --- a/drivers/w1/masters/w1-gpio.c
> +++ b/drivers/w1/masters/w1-gpio.c
> @@ -112,17 +112,16 @@ static int w1_gpio_probe_dt(struct platform_device *pdev)
>  static int w1_gpio_probe(struct platform_device *pdev)
>  {
>  	struct w1_bus_master *master;
> -	struct w1_gpio_platform_data *pdata;
> +	struct w1_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev);
>  	int err;
>  
> -	if (of_have_populated_dt()) {
> +	if (of_have_populated_dt() && !pdata) {
>  		err = w1_gpio_probe_dt(pdev);
>  		if (err < 0)
>  			return err;
> +		pdata = dev_get_platdata(&pdev->dev);
>  	}
>  
> -	pdata = dev_get_platdata(&pdev->dev);
> -
>  	if (!pdata) {
>  		dev_err(&pdev->dev, "No configuration data\n");
>  		return -ENXIO;
> 

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

* Re: [PATCH] w1: gpio: fix problem with platfom data in w1-gpio
  2018-02-18 17:19 ` [PATCH] w1: gpio: fix problem with platfom data in w1-gpio Pawel Dembicki
  2018-02-19 13:29   ` Andrew F. Davis
@ 2018-03-14 13:59   ` Greg Kroah-Hartman
  2018-03-17 10:39     ` Paweł Dembicki
  1 sibling, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2018-03-14 13:59 UTC (permalink / raw)
  To: Pawel Dembicki
  Cc: stable, Evgeniy Polyakov, Andrew F. Davis, Sebastian Reichel,
	linux-kernel

On Sun, Feb 18, 2018 at 06:19:26PM +0100, Pawel Dembicki wrote:
> In devices, where fdt is used, is impossible to apply platform data
> without proper fdt node.
> 
> This patch allow to use platform data in devices with fdt.
> 
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
> Acked-by: Andrew F. Davis <afd@ti.com>
> ---
>  drivers/w1/masters/w1-gpio.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)

Patch does not apply at all to my tree :(

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

* Re: [PATCH] w1: gpio: fix problem with platfom data in w1-gpio
  2018-03-14 13:59   ` Greg Kroah-Hartman
@ 2018-03-17 10:39     ` Paweł Dembicki
  2018-03-17 11:55       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 8+ messages in thread
From: Paweł Dembicki @ 2018-03-17 10:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: stable, Evgeniy Polyakov, Andrew F. Davis, Sebastian Reichel,
	linux-kernel

2018-03-14 14:59 GMT+01:00 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:

>
> Patch does not apply at all to my tree :(

Patch works with stable kernels (e.g 4.9 and 4.14).
On which tip You test?

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

* Re: [PATCH] w1: gpio: fix problem with platfom data in w1-gpio
  2018-03-17 10:39     ` Paweł Dembicki
@ 2018-03-17 11:55       ` Greg Kroah-Hartman
  2018-03-29  9:47         ` Paweł Dembicki
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2018-03-17 11:55 UTC (permalink / raw)
  To: Paweł Dembicki
  Cc: stable, Evgeniy Polyakov, Andrew F. Davis, Sebastian Reichel,
	linux-kernel

On Sat, Mar 17, 2018 at 11:39:11AM +0100, Paweł Dembicki wrote:
> 2018-03-14 14:59 GMT+01:00 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
> 
> >
> > Patch does not apply at all to my tree :(
> 
> Patch works with stable kernels (e.g 4.9 and 4.14).
> On which tip You test?

Where is this patch supposed to go?  Is this a stable backport patch, or
something to go into Linus's tree?

totally confused,

greg k-h

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

* Re: [PATCH] w1: gpio: fix problem with platfom data in w1-gpio
  2018-03-17 11:55       ` Greg Kroah-Hartman
@ 2018-03-29  9:47         ` Paweł Dembicki
  2018-03-29 10:01           ` Greg Kroah-Hartman
  0 siblings, 1 reply; 8+ messages in thread
From: Paweł Dembicki @ 2018-03-29  9:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: stable, Evgeniy Polyakov, Andrew F. Davis, Sebastian Reichel,
	linux-kernel

2018-03-17 12:55 GMT+01:00 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:

> Where is this patch supposed to go?  Is this a stable backport patch, or
> something to go into Linus's tree?

I tested it in 4.9 and 4.14 kernels in OpenERT. So it is a stable
backport patch.

In current release this bug is fixed because w1-gpio use gpiod.

>
> totally confused,
>

Sorry. This was my first patch.

> greg k-h

-- 
Pawel Dembicki

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

* Re: [PATCH] w1: gpio: fix problem with platfom data in w1-gpio
  2018-03-29  9:47         ` Paweł Dembicki
@ 2018-03-29 10:01           ` Greg Kroah-Hartman
  2018-04-04 16:44             ` Paweł Dembicki
  0 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2018-03-29 10:01 UTC (permalink / raw)
  To: Paweł Dembicki
  Cc: stable, Evgeniy Polyakov, Andrew F. Davis, Sebastian Reichel,
	linux-kernel

On Thu, Mar 29, 2018 at 11:47:25AM +0200, Paweł Dembicki wrote:
> 2018-03-17 12:55 GMT+01:00 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
> 
> > Where is this patch supposed to go?  Is this a stable backport patch, or
> > something to go into Linus's tree?
> 
> I tested it in 4.9 and 4.14 kernels in OpenERT. So it is a stable
> backport patch.

What commit is being backported.

> In current release this bug is fixed because w1-gpio use gpiod.

Then why can we not just use the actual patch that fixes this?

> Sorry. This was my first patch.

Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to submit a patch for the stable tree.

thanks,

greg k-h

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

* Re: [PATCH] w1: gpio: fix problem with platfom data in w1-gpio
  2018-03-29 10:01           ` Greg Kroah-Hartman
@ 2018-04-04 16:44             ` Paweł Dembicki
  0 siblings, 0 replies; 8+ messages in thread
From: Paweł Dembicki @ 2018-04-04 16:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: stable, Evgeniy Polyakov, Andrew F. Davis, Sebastian Reichel,
	linux-kernel

2018-03-29 12:01 GMT+02:00 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
> On Thu, Mar 29, 2018 at 11:47:25AM +0200, Paweł Dembicki wrote:
>> 2018-03-17 12:55 GMT+01:00 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
>>
>> > Where is this patch supposed to go?  Is this a stable backport patch, or
>> > something to go into Linus's tree?
>>
>> I tested it in 4.9 and 4.14 kernels in OpenERT. So it is a stable
>> backport patch.
>
> What commit is being backported.
>

This commit resolve problem in mainline:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e0fc62a6552f3d9c21e73cc65844f9aad1892cf7

>> In current release this bug is fixed because w1-gpio use gpiod.
>
> Then why can we not just use the actual patch that fixes this?


I think, mainline commit is big change. My patch is answer for problem
in stable kernels, which is resolved in mainline.


>
>> Sorry. This was my first patch.
>
> Please read:
>     https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> for how to submit a patch for the stable tree.
>
> thanks,
>
> greg k-h


Pawel Dembicki

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

end of thread, other threads:[~2018-04-04 16:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20180218170629.6045-1-paweldembicki@gmail.com>
2018-02-18 17:19 ` [PATCH] w1: gpio: fix problem with platfom data in w1-gpio Pawel Dembicki
2018-02-19 13:29   ` Andrew F. Davis
2018-03-14 13:59   ` Greg Kroah-Hartman
2018-03-17 10:39     ` Paweł Dembicki
2018-03-17 11:55       ` Greg Kroah-Hartman
2018-03-29  9:47         ` Paweł Dembicki
2018-03-29 10:01           ` Greg Kroah-Hartman
2018-04-04 16:44             ` Paweł Dembicki

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).