1 /* 2 * Copyright (c) 2022 Nordic Semiconductor ASA 3 * SPDX-License-Identifier: Apache-2.0 4 */ 5 6 #include <zephyr/device.h> 7 8 struct test_api { 9 void (*open)(const struct device *dev); 10 void (*close)(const struct device *dev); 11 }; 12 test_open(const struct device * dev)13static inline void test_open(const struct device *dev) 14 { 15 const struct test_api *api = 16 (const struct test_api *)dev->api; 17 18 api->open(dev); 19 } 20 test_close(const struct device * dev)21static inline void test_close(const struct device *dev) 22 { 23 const struct test_api *api = 24 (const struct test_api *)dev->api; 25 26 api->close(dev); 27 } 28