#include <linux/leds.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/platform_device.h>
 #include <linux/property.h>
 #include <linux/slab.h>
        struct fwnode_handle *fwnode, gpio_blink_set_t blink_set)
 {
        struct led_init_data init_data = {};
+       struct pinctrl *pinctrl;
        int ret, state;
 
        led_dat->cdev.default_trigger = template->default_trigger;
                                                     &init_data);
        }
 
+       if (ret)
+               return ret;
+
+       pinctrl = devm_pinctrl_get_select_default(led_dat->cdev.dev);
+       if (IS_ERR(pinctrl)) {
+               ret = PTR_ERR(pinctrl);
+               if (ret != -ENODEV) {
+                       dev_warn(led_dat->cdev.dev,
+                                "Failed to select %pOF pinctrl: %d\n",
+                                to_of_node(fwnode), ret);
+               } else {
+                       /* pinctrl-%d not present, not an error */
+                       ret = 0;
+               }
+       }
+
        return ret;
 }