From ab7f17fb5b776933dd1a3431ae02bc2e394e2cba Mon Sep 17 00:00:00 2001 From: Prathu Baronia Date: Thu, 18 May 2023 19:16:56 +0530 Subject: 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. Signed-off-by: Prathu Baronia Link: https://lore.kernel.org/r/20230518134656.9559-1-prathubaronia2011@gmail.com Signed-off-by: Greg Kroah-Hartman --- include/linux/amba/bus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/amba') diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 5001e14c5c06..c60a6a14638c 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -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) -- cgit v1.2.3