hwspinlock: ignore disabled device
authorFabien Dessenne <fabien.dessenne@st.com>
Fri, 8 Mar 2019 16:53:46 +0000 (17:53 +0100)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Sat, 29 Jun 2019 19:05:06 +0000 (12:05 -0700)
Do not wait for hwspinlock device registration if it is not available
for use.

Acked-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/hwspinlock/hwspinlock_core.c

index 2bad40d42210dbe2250caae353e600fae090dd50..d806307f19c2cca2f0fef71c06cb39ecb6021ae7 100644 (file)
@@ -333,6 +333,11 @@ int of_hwspin_lock_get_id(struct device_node *np, int index)
        if (ret)
                return ret;
 
+       if (!of_device_is_available(args.np)) {
+               ret = -ENOENT;
+               goto out;
+       }
+
        /* Find the hwspinlock device: we need its base_id */
        ret = -EPROBE_DEFER;
        rcu_read_lock();