[PATCH 4.18 105/145] pwm: omap-dmtimer: Return -EPROBE_DEFER if no dmtimer platform data

From: Greg Kroah-Hartman
Date: Fri Sep 07 2018 - 17:18:54 EST


4.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: David Rivshin <DRivshin@xxxxxxxxxxx>

commit 43725feb593127b16318b871e3a9bf89a96d66cb upstream.

If a pwm-omap-dmtimer is probed before the dmtimer it uses, the platform
data won't be set yet.

Fixes: ac30751df953 ("ARM: OMAP: pdata-quirks: Remove unused timer pdata")
Cc: <stable@xxxxxxxxxxxxxxx> # 4.17+
Signed-off-by: David Rivshin <drivshin@xxxxxxxxxxx>
Acked-by: Pavel Machek <pavel@xxxxxx>
Tested-by: Pavel Machek <pavel@xxxxxx>
Acked-by: Ladislav Michl <ladis@xxxxxxxxxxxxxx>
Tested-by: Andreas Kemnade <andreas@xxxxxxxxxxxx>
Signed-off-by: Thierry Reding <thierry.reding@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
drivers/pwm/pwm-omap-dmtimer.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/pwm/pwm-omap-dmtimer.c
+++ b/drivers/pwm/pwm-omap-dmtimer.c
@@ -264,8 +264,9 @@ static int pwm_omap_dmtimer_probe(struct

timer_pdata = dev_get_platdata(&timer_pdev->dev);
if (!timer_pdata) {
- dev_err(&pdev->dev, "dmtimer pdata structure NULL\n");
- ret = -EINVAL;
+ dev_dbg(&pdev->dev,
+ "dmtimer pdata structure NULL, deferring probe\n");
+ ret = -EPROBE_DEFER;
goto put;
}