Skip to content

Commit 4fb6ce3

Browse files
pdgendtkartben
authored andcommitted
drivers: coredump: Place API into iterable section
Add wrapper DEVICE_API macro to all coredump_driver_api instances. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 41b0bd1 commit 4fb6ce3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

drivers/coredump/coredump_impl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ static int coredump_init(const struct device *dev)
126126
return 0;
127127
}
128128

129-
static const struct coredump_driver_api coredump_api = {
129+
static DEVICE_API(coredump, coredump_api) = {
130130
.dump = coredump_impl_dump,
131131
.register_memory = coredump_impl_register_memory,
132132
.unregister_memory = coredump_impl_unregister_memory,

subsys/debug/coredump/coredump_core.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ static void dump_thread(struct k_thread *thread)
101101
#if defined(CONFIG_COREDUMP_DEVICE)
102102
static void process_coredump_dev_memory(const struct device *dev)
103103
{
104-
struct coredump_driver_api *api = (struct coredump_driver_api *)dev->api;
105-
106-
api->dump(dev);
104+
DEVICE_API_GET(coredump, dev)->dump(dev);
107105
}
108106
#endif
109107

0 commit comments

Comments
 (0)