Path: blob/main/sys/compat/linuxkpi/common/include/linux/device/driver.h
39638 views
/*-1* SPDX-License-Identifier: BSD-2-Clause2*3* Copyright (c) 2021 Bjoern A. Zeeb4* Copyright (c) 2024 The FreeBSD Foundation5*6* Portions of this software were developed by Björn Zeeb7* under sponsorship from the FreeBSD Foundation.8*/910#ifndef LINUXKPI_LINUX_DEVICE_DRIVER_H11#define LINUXKPI_LINUX_DEVICE_DRIVER_H1213#include <sys/cdefs.h>14#include <linux/module.h>1516#define module_driver(_drv, _regf, _unregf) \17static inline int \18__CONCAT(__CONCAT(_, _drv), _init)(void) \19{ \20return (_regf(&(_drv))); \21} \22\23static inline void \24__CONCAT(__CONCAT(_, _drv), _exit)(void) \25{ \26_unregf(&(_drv)); \27} \28\29module_init(__CONCAT(__CONCAT(_, _drv), _init)); \30module_exit(__CONCAT(__CONCAT(_, _drv), _exit))3132#endif /* LINUXKPI_LINUX_DEVICE_DRIVER_H */333435