Skip to content

Commit 1494cdb

Browse files
gmarullhenrikbrixandersen
authored andcommitted
drivers: misc: devmux: fix init signature
It is no longer possible to use other signatures other than `int fn(const struct device *)`. Just cast the device pointer, safe in this context because CONFIG_DEVICE_MUTABLE=y. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent 627e83c commit 1494cdb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/misc/devmux/devmux.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ int z_vrfy_devmux_select_set(struct device *dev, size_t index)
129129
#include <zephyr/syscalls/devmux_select_set_mrsh.c>
130130
#endif
131131

132-
static int devmux_init(struct device *const dev)
132+
static int devmux_init(const struct device *dev)
133133
{
134134
size_t inst = devmux_inst_get(dev);
135135
struct devmux_data *const data = dev->data;
@@ -143,7 +143,7 @@ static int devmux_init(struct device *const dev)
143143
return -ENODEV;
144144
}
145145

146-
*dev = *config->devs[sel];
146+
*(struct device *)dev = *config->devs[sel];
147147

148148
return 0;
149149
}

0 commit comments

Comments
 (0)