summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/vio.h
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-11 14:30:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-27 15:45:41 +0300
commitb84d6d3b4580ad1551ada9046fbed85f3b1373af (patch)
treea3c7f5d24da0f53b3e31bf42b730b370fed6c5c0 /arch/powerpc/include/asm/vio.h
parent42bb5be8936f40a1d0e618766645e7fd0cbfe591 (diff)
downloadlinux-b84d6d3b4580ad1551ada9046fbed85f3b1373af.tar.xz
vio: move to_vio_dev() to use container_of_const()
The driver core is changing to pass some pointers as const, so move to_vio_dev() to use container_of_const() to handle this change. to_vio_dev() now properly keeps the const-ness of the pointer passed into it, while as before it could be lost. Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: "David S. Miller" <davem@davemloft.net> Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org> Cc: Kees Cook <keescook@chromium.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20230111113018.459199-9-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/powerpc/include/asm/vio.h')
-rw-r--r--arch/powerpc/include/asm/vio.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/vio.h b/arch/powerpc/include/asm/vio.h
index e7479a4abf96..cc9b787627ad 100644
--- a/arch/powerpc/include/asm/vio.h
+++ b/arch/powerpc/include/asm/vio.h
@@ -161,10 +161,7 @@ static inline struct vio_driver *to_vio_driver(struct device_driver *drv)
return container_of(drv, struct vio_driver, driver);
}
-static inline struct vio_dev *to_vio_dev(struct device *dev)
-{
- return container_of(dev, struct vio_dev, dev);
-}
+#define to_vio_dev(__dev) container_of_const(__dev, struct vio_dev, dev)
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_VIO_H */