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 --- 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;
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;
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 :(
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?
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
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
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
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/?i...
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
linux-stable-mirror@lists.linaro.org