Skip to contentSkip to conversation

devres: rename the first parameter of devm_add_action_or_reset()

PATCH Superseded Masahiro Yamada 2 participants 3 messages Sep 7, 2023 – Sep 8, 2023 Driver core

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devres: rename the first parameter of devm_add_action_or_reset()

Fix a possible mistake in commit 410e7088e971 ("devres: Pass unique name of the resource to devm_add_action_or_reset()").

The first parameter of devm_add_action_or_reset() is the associated device. The name 'release' is confusing because it is often used for dr_release_t in the devres context.

Rename it to 'dev'. No functional change intended.

---

 include/linux/device.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/device.h +2 -2
index 56d93a1ffb7b..1fa0e9cb5e01 100644
@@ -403,8 +403,8 @@ static inline int __devm_add_action_or_reset(struct device *dev, void (*action)(
 
 	return ret;
 }
-#define devm_add_action_or_reset(release, action, data) \
-	__devm_add_action_or_reset(release, action, data, #action)
+#define devm_add_action_or_reset(dev, action, data) \
+	__devm_add_action_or_reset(dev, action, data, #action)
 
 /**
  * devm_alloc_percpu - Resource-managed alloc_percpu
Signature · 1 line
2.39.2
#1 lore raw
Quoted 8 lines · Masahiro Yamada

Fix a possible mistake in commit 410e7088e971 ("devres: Pass unique name of the resource to devm_add_action_or_reset()").

The first parameter of devm_add_action_or_reset() is the associated device. The name 'release' is confusing because it is often used for dr_release_t in the devres context.

Rename it to 'dev'. No functional change intended.

...

include/linux/device.h static inline int __devm_add_action_or_reset(struct device *dev, void (*action)( · line 407

Quoted 4 lines
include/linux/device.h +2 -2
-#define devm_add_action_or_reset(release, action, data) \
-	__devm_add_action_or_reset(release, action, data, #action)
+#define devm_add_action_or_reset(dev, action, data) \
+	__devm_add_action_or_reset(dev, action, data, #action)

What about devm_add_action() and Co?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 11 lines · Andy Shevchenko
Quoted 8 lines · Masahiro Yamada

Fix a possible mistake in commit 410e7088e971 ("devres: Pass unique name of the resource to devm_add_action_or_reset()").

The first parameter of devm_add_action_or_reset() is the associated device. The name 'release' is confusing because it is often used for dr_release_t in the devres context.

Rename it to 'dev'. No functional change intended.

Quoted 8 lines

...

include/linux/device.h static inline int __devm_add_action_or_reset(struct device *dev, void (*action)( · line 407

Quoted 4 lines
include/linux/device.h +2 -2
-#define devm_add_action_or_reset(release, action, data) \
-     __devm_add_action_or_reset(release, action, data, #action)
+#define devm_add_action_or_reset(dev, action, data) \
+     __devm_add_action_or_reset(dev, action, data, #action)

What about devm_add_action() and Co?

I will fix devm_add_action too.

Thanks.

Quoted 5 lines

--
With Best Regards,
Andy Shevchenko

Signature · 2 lines
Best Regards
Masahiro Yamada