Skip to contentSkip to conversation

amba: move to_amba_device() to use container_of_const

PATCH RESEND New Prathu Baronia 1 participant 1 message May 18, 2023 Arm primecell bus support

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 amba: move to_amba_device() to use container_of_const

to_amba_device() now properly keeps the const-ness of the dev pointer passed into it, while as before it could be lost.

---
 include/linux/amba/bus.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/amba/bus.h +1 -1
index 5001e14c5c06..c60a6a14638c 100644
@@ -107,7 +107,7 @@ enum amba_vendor {
 
 extern struct bus_type amba_bustype;
 
-#define to_amba_device(d)	container_of(d, struct amba_device, dev)
+#define to_amba_device(d)	container_of_const(d, struct amba_device, dev)
 
 #define amba_get_drvdata(d)	dev_get_drvdata(&d->dev)
 #define amba_set_drvdata(d,p)	dev_set_drvdata(&d->dev, p)
Signature · 1 line
2.34.1