diff options
author | Christoph Muellner <christoph.muellner@theobroma-systems.com> | 2015-05-04 17:40:18 +0200 |
---|---|---|
committer | Klaus Goger <klaus.goger@theobroma-systems.com> | 2015-07-30 18:52:56 +0200 |
commit | b9e372bbfd75f5860ce193669ce1459a86738470 (patch) | |
tree | 54bcd31e55d3f8723d0c2de40e89dce95eef1696 | |
parent | a1e68bae9e88aa24515cfbc7420e9f28ef56b30d (diff) |
pinctrl: sunxi: Defer on missing reset controller in probe.
This patch defers the device probing in case of a missing reset
controller. This is needed for cases where the pinctrl device is
probed before the reset controller.
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
-rw-r--r-- | drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c b/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c index 02174fa57997..643184bb6661 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c +++ b/drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c @@ -98,13 +98,20 @@ static const struct sunxi_pinctrl_desc sun6i_a31_r_pinctrl_data = { static int sun6i_a31_r_pinctrl_probe(struct platform_device *pdev) { + struct device_node *np = pdev->dev.of_node; struct reset_control *rstc; int ret; - rstc = devm_reset_control_get(&pdev->dev, NULL); + if (!np) + return -ENODEV; + + rstc = of_reset_control_get(np, NULL); if (IS_ERR(rstc)) { - dev_err(&pdev->dev, "Reset controller missing\n"); - return PTR_ERR(rstc); + /* we, as a pinctrl, will most likely be probed before + * our reset controller is probed. + * So we will simply defer probing. + */ + return -EPROBE_DEFER; } ret = reset_control_deassert(rstc); |