Skip to contentSkip to conversation

dm: device: make power domain calls optional

PATCH New Anatolij Gustschin 3 participants 3 messages Jul 14, 2019 – Jul 21, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm: device: make power domain calls optional

Reduce power domain calls when CONFIG_POWER_DOMAIN is disabled. With gcc v8.2, this change saves 104 bytes.

---
 drivers/core/device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/core/device.c +2 -1
index 0d15e5062b..8ec0f02bde 100644
@@ -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);
 	}
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 dm: device: make power domain calls optional

Quoted 15 lines

Subject: [PATCH] dm: device: make power domain calls optional

Reduce power domain calls when CONFIG_POWER_DOMAIN is disabled. With gcc v8.2, this change saves 104 bytes.

---
 drivers/core/device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/core/device.c index renamed from drivers/core/device.c +0 -0

0d15e5062b..8ec0f02bde 100644

drivers/core/device.c int device_probe(struct udevice *dev) · line 395

Quoted 9 lines
drivers/core/device.c +2 -1
@@ -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);
Quoted 3 lines

}
--
2.17.1

#2 lore raw

PATCH 1/1 dm: device: make power domain calls optional

Quoted 10 lines

Subject: [PATCH] dm: device: make power domain calls optional

Reduce power domain calls when CONFIG_POWER_DOMAIN is disabled. With gcc v8.2, this change saves 104 bytes.

---
 drivers/core/device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Applied to u-boot-dm, thanks!