2
0

820-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch 924 B

1234567891011121314151617181920212223242526
  1. From d9c8bc8c1408f3e8529db6e4e04017b4c579c342 Mon Sep 17 00:00:00 2001
  2. From: Pawel Dembicki <[email protected]>
  3. Date: Sun, 18 Feb 2018 17:08:04 +0100
  4. Subject: [PATCH] w1: gpio: fix problem with platfom data in w1-gpio
  5. In devices, where fdt is used, is impossible to apply platform data
  6. without proper fdt node.
  7. This patch allow to use platform data in devices with fdt.
  8. Signed-off-by: Pawel Dembicki <[email protected]>
  9. ---
  10. drivers/w1/masters/w1-gpio.c | 7 +++----
  11. 1 file changed, 3 insertions(+), 4 deletions(-)
  12. --- a/drivers/w1/masters/w1-gpio.c
  13. +++ b/drivers/w1/masters/w1-gpio.c
  14. @@ -76,7 +76,7 @@ static int w1_gpio_probe(struct platform
  15. enum gpiod_flags gflags = GPIOD_OUT_LOW_OPEN_DRAIN;
  16. int err;
  17. - if (of_have_populated_dt()) {
  18. + if (of_have_populated_dt() && !dev_get_platdata(&pdev->dev)) {
  19. pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
  20. if (!pdata)
  21. return -ENOMEM;