device.h: move kobj_to_dev() to use container_of_const()
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Dec 2022 12:12:04 +0000 (13:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 Dec 2022 15:55:25 +0000 (16:55 +0100)
commit6149f83b3165955e9519de483b30b26d1518ad0f
tree08a6718c5c71627408336a607d08cf62dc920422
parent64f6a5d1922bf6d2b2d845de20d4563a6f328e2d
device.h: move kobj_to_dev() to use container_of_const()

Instead of rolling our own const-checking logic, use the newly
introduced container_of_const() to handle it all for us automatically.

Cc: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link: https://lore.kernel.org/r/20221205121206.166576-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/device.h