Skip to contentSkip to conversation

can: m_can: Use of_property_present() for wakeup-source

PATCH Superseded [email protected] 2 participants 2 messages May 12

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 can: m_can: Use of_property_present() for wakeup-source

From: bui duc phuc <[email protected]>

The 'wakeup-source' property is declared as a phandle-array in both YAML bindings and Device Tree source files. However, the driver currently uses of_property_read_bool() to check for its existence.

According to the function's documentation, usage on non-boolean property types is deprecated. Switch to of_property_present() to comply with the recommended API for checking the presence of a property.

Fixes 04d5826b074e ("can: m_can: Map WoL to device_set_wakeup_enable")

---

Changes in v2:
- Add Acked-by tag
- Add Fixes tag

 drivers/net/can/m_can/m_can.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/m_can/m_can.c +1 -1
index eb856547ae7d..16f80607e150 100644
@@ -2464,7 +2464,7 @@ struct m_can_classdev *m_can_class_allocate_dev(struct device *dev,
 		return ERR_PTR(ret);
 	}
 
-	if (dev->of_node && of_property_read_bool(dev->of_node, "wakeup-source"))
+	if (dev->of_node && of_property_present(dev->of_node, "wakeup-source"))
 		device_set_wakeup_capable(dev, true);
 
 	/* Get TX FIFO size
Signature · 1 line
2.43.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · On 17:25-20260512, [email protected] wrote:

From: bui duc phuc <[email protected]>

The 'wakeup-source' property is declared as a phandle-array in both YAML bindings and Device Tree source files. However, the driver currently uses of_property_read_bool() to check for its existence.

Quoted 7 lines

According to the function's documentation, usage on non-boolean property types is deprecated. Switch to of_property_present() to comply with the recommended API for checking the presence of a property.

Fixes 04d5826b074e ("can: m_can: Map WoL to device_set_wakeup_enable")
Quoted 25 lines

---

Changes in v2:
- Add Acked-by tag
- Add Fixes tag

 drivers/net/can/m_can/m_can.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/m_can/m_can.c +1 -1
index eb856547ae7d..16f80607e150 100644
@@ -2464,7 +2464,7 @@ struct m_can_classdev *m_can_class_allocate_dev(struct device *dev,
 		return ERR_PTR(ret);
 	}
 
-	if (dev->of_node && of_property_read_bool(dev->of_node, "wakeup-source"))
+	if (dev->of_node && of_property_present(dev->of_node, "wakeup-source"))
 		device_set_wakeup_capable(dev, true);
 
 	/* Get TX FIFO size
Signature · 1 line
2.43.0