]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
device property: Allow const parameter to dev_fwnode()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 4 Oct 2022 09:21:25 +0000 (12:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jan 2024 14:13:40 +0000 (15:13 +0100)
commit339add0430e7cc94a483179ed2b2cc8d2eec0b4f
treee0d49ae724cf8ee678653962eec3bb237e8e6289
parent4d9dcdb333ca637e7c7c66119a16e83b5a25c74f
device property: Allow const parameter to dev_fwnode()

commit b295d484b97081feba72b071ffcb72fb4638ccfd upstream.

It's not fully correct to take a const parameter pointer to a struct
and return a non-const pointer to a member of that struct.

Instead, introduce a const version of the dev_fwnode() API which takes
and returns const pointers and use it where it's applicable.

With this, convert dev_fwnode() to be a macro wrapper on top of const
and non-const APIs that chooses one based on the type.

Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Fixes: aade55c86033 ("device property: Add const qualifier to device_get_match_data() parameter")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://lore.kernel.org/r/20221004092129.19412-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/property.c
include/linux/property.h