]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pinctrl: do not set_state for device without valid ofnode
authorKever Yang <kever.yang@rock-chips.com>
Wed, 18 Apr 2018 09:54:04 +0000 (17:54 +0800)
committerSimon Glass <sjg@chromium.org>
Wed, 16 May 2018 06:25:19 +0000 (00:25 -0600)
Not all the udevice have a available DT node, eg. rksdmmc@ff500000.blk
which add by mmc_bind(), these device do not have/need set pinctrl
state.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/pinctrl/pinctrl-uclass.c

index d7e38ae7291c844025b6003dfa4d97accb1e9da2..c38bb212ed74bd74c0f7a3f7194fa1f7b7f24546 100644 (file)
@@ -198,6 +198,12 @@ static int pinctrl_select_state_simple(struct udevice *dev)
 
 int pinctrl_select_state(struct udevice *dev, const char *statename)
 {
+       /*
+        * Some device which is logical like mmc.blk, do not have
+        * a valid ofnode.
+        */
+       if (!ofnode_valid(dev->node))
+               return 0;
        /*
         * Try full-implemented pinctrl first.
         * If it fails or is not implemented, try simple one.