diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-25 20:42:33 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-29 07:55:07 +0200 |
commit | 884f8ce42ccec9d0bf11d8bf9f111e5961ca1c82 (patch) | |
tree | b5aa06b6038676d53c88be5efc210a676df9932a /drivers/base/platform-msi.c | |
parent | 75a2d4226b53710380d1017b3f4c88f937ddba78 (diff) |
driver core: class: implement class_get/put without the private pointer.
Much like what was done in commit 273afac615ad ("driver core: bus:
implement bus_get/put() without the private pointer"), it is time to
move the driver core away from using the internal private pointer in
struct class in order to enable it to be always a constant and be placed
in read-only memory in the future.
First step in doing this is to create a helper function that turns a
'struct class' into 'struct subsys_private' called class_to_subsys().
class_to_subsys() walks the list of registered busses in the system and
finds the matching one based on the pointer to the class itself. As
this is a short list, and this function is not on any fast path, it
should not be noticable.
Implement class_get() and class_put() using this new helper function.
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Link: https://lore.kernel.org/r/20230325194234.46588-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/platform-msi.c')
0 files changed, 0 insertions, 0 deletions