Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <prathubaronia2011@gmail.com>
Link: https://lore.kernel.org/r/20230518134656.9559-1-prathubaronia2011@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Prathu Baronia and committed by
Greg Kroah-Hartman
ab7f17fb c9d9d11b

+1 -1
+1 -1
include/linux/amba/bus.h
··· 107 107 108 108 extern struct bus_type amba_bustype; 109 109 110 - #define to_amba_device(d) container_of(d, struct amba_device, dev) 110 + #define to_amba_device(d) container_of_const(d, struct amba_device, dev) 111 111 112 112 #define amba_get_drvdata(d) dev_get_drvdata(&d->dev) 113 113 #define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p)