aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-4.19/0931-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/generic/pending-4.19/0931-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch')
-rw-r--r--target/linux/generic/pending-4.19/0931-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch24
1 files changed, 6 insertions, 18 deletions
diff --git a/target/linux/generic/pending-4.19/0931-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch b/target/linux/generic/pending-4.19/0931-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch
index 0c4a13f9df..be9ceebc3a 100644
--- a/target/linux/generic/pending-4.19/0931-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch
+++ b/target/linux/generic/pending-4.19/0931-w1-gpio-fix-problem-with-platfom-data-in-w1-gpio.patch
@@ -15,24 +15,12 @@ Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
--- 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 platf
- 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);
+@@ -79,7 +79,7 @@ static int w1_gpio_probe(struct platform
+ enum gpiod_flags gflags = GPIOD_OUT_LOW_OPEN_DRAIN;
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;
++ if (of_have_populated_dt() && !dev_get_platdata(&pdev->dev)) {
+ pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+ if (!pdata)
+ return -ENOMEM;