]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: device: make power domain calls optional
authorAnatolij Gustschin <agust@denx.de>
Sun, 14 Jul 2019 19:11:01 +0000 (21:11 +0200)
committerSimon Glass <sjg@chromium.org>
Wed, 24 Jul 2019 19:54:08 +0000 (12:54 -0700)
Reduce power domain calls when CONFIG_POWER_DOMAIN is disabled.
With gcc v8.2, this change saves 104 bytes.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
drivers/core/device.c

index 37d89bcd1d21dce8bf3755a653d4121a746db7ae..474c1642ee511a4353addfe7cfe275ac29ebff52 100644 (file)
@@ -388,7 +388,8 @@ int device_probe(struct udevice *dev)
        if (dev->parent && device_get_uclass_id(dev) != UCLASS_PINCTRL)
                pinctrl_select_state(dev, "default");
 
-       if (dev->parent && device_get_uclass_id(dev) != UCLASS_POWER_DOMAIN) {
+       if (CONFIG_IS_ENABLED(POWER_DOMAIN) && dev->parent &&
+           device_get_uclass_id(dev) != UCLASS_POWER_DOMAIN) {
                if (!power_domain_get(dev, &pd))
                        power_domain_on(&pd);
        }