drivers/pinctrl: grab default handles from device core
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / drivers / base / dd.c
index e3bbed8a617c257373a1fa2d75318d9ff930601a..656310156ddeeeabc0d709f3393b9af27e949214 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/wait.h>
 #include <linux/async.h>
 #include <linux/pm_runtime.h>
+#include <linux/pinctrl/devinfo.h>
 
 #include "base.h"
 #include "power/power.h"
@@ -269,6 +270,12 @@ static int really_probe(struct device *dev, struct device_driver *drv)
        WARN_ON(!list_empty(&dev->devres_head));
 
        dev->driver = drv;
+
+       /* If using pinctrl, bind pins now before probing */
+       ret = pinctrl_bind_pins(dev);
+       if (ret)
+               goto probe_failed;
+
        if (driver_sysfs_add(dev)) {
                printk(KERN_ERR "%s: driver_sysfs_add(%s) failed\n",
                        __func__, dev_name(dev));