diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2019-10-22 19:37:29 +0300 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2019-10-22 19:37:29 +0300 |
commit | 39f4d441048444f38fcfcfb1aa3102c030544e86 (patch) | |
tree | bee4fe1443f9a7f17eea21a1f2e8902176b13844 /drivers/amba | |
parent | 2ecb287998a47cc0a766f6071f63bc185f338540 (diff) | |
parent | e963408e8ff439e2b9da20e5399d7dca21462fcc (diff) | |
download | linux-39f4d441048444f38fcfcfb1aa3102c030544e86.tar.xz |
Merge branch 'misc' into fixes
Diffstat (limited to 'drivers/amba')
-rw-r--r-- | drivers/amba/bus.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 100e798a5c82..fe1523664816 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -18,6 +18,7 @@ #include <linux/limits.h> #include <linux/clk/clk-conf.h> #include <linux/platform_device.h> +#include <linux/reset.h> #include <asm/irq.h> @@ -401,6 +402,21 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent) ret = amba_get_enable_pclk(dev); if (ret == 0) { u32 pid, cid; + struct reset_control *rstc; + + /* + * Find reset control(s) of the amba bus and de-assert them. + */ + rstc = of_reset_control_array_get_optional_shared(dev->dev.of_node); + if (IS_ERR(rstc)) { + ret = PTR_ERR(rstc); + if (ret != -EPROBE_DEFER) + dev_err(&dev->dev, "can't get reset: %d\n", + ret); + goto err_reset; + } + reset_control_deassert(rstc); + reset_control_put(rstc); /* * Read pid and cid based on size of resource @@ -458,6 +474,12 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent) release_resource(&dev->res); err_out: return ret; + + err_reset: + amba_put_disable_pclk(dev); + iounmap(tmp); + dev_pm_domain_detach(&dev->dev, true); + goto err_release; } /* |