w1: gpio: fix problem with platfom data in w1-gpio
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 w1: gpio: fix problem with platfom data in w1-gpio
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.
--- drivers/w1/masters/w1-gpio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/w1/masters/w1-gpio.c +3 -4
@@ -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 ;
Signature · 1 line
2.14.1
Quoted 7 lines · Pawel Dembicki
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 <[email protected]>---
Good catch,
Quoted 29 lines
drivers/w1/masters/w1-gpio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)drivers/w1/masters/w1-gpio.c +3
-4@@ -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 ;
Greg Kroah-Hartman
maintainerQuoted 10 lines · Pawel Dembicki
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 <[email protected]>Acked-by Andrew F. Davis <[email protected]>--- 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 <[email protected]>:
Quoted 2 lines
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?
Greg Kroah-Hartman
maintainerQuoted 7 lines · Paweł Dembicki
2018-03-14 14:59 GMT+01:00 Greg Kroah-Hartman <[email protected]>:
Quoted 2 lines
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 <[email protected]>:
Quoted 2 lines
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.
Quoted 3 lines
totally confused,
Sorry. This was my first patch.
Quoted 1 line
greg k-h
Signature · 1 line
Pawel Dembicki
Greg Kroah-Hartman
maintainerQuoted 7 lines · Paweł Dembicki
2018-03-17 12:55 GMT+01:00 Greg Kroah-Hartman <[email protected]>:
Quoted 2 lines
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.
Quoted 1 line
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?
Quoted 1 line
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 <[email protected]>:
Quoted 11 lines · Paweł Dembicki
Quoted 7 lines
2018-03-17 12:55 GMT+01:00 Greg Kroah-Hartman <[email protected]>:
Quoted 2 lines
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
Quoted 3 lines
Quoted 1 line
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.
Quoted 10 lines
Quoted 2 lines
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