Merge tag 'mm-hotfixes-stable-2024-06-26-17-28' of git://git.kernel.org/pub/scm/linux...
[linux.git] / drivers / rpmsg / rpmsg_char.h
blob117d9cbc52f0dfccf78fc0e714e9fffae2c632cc
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (C) 2022, STMicroelectronics
4 */
6 #ifndef __RPMSG_CHRDEV_H__
7 #define __RPMSG_CHRDEV_H__
9 #if IS_ENABLED(CONFIG_RPMSG_CHAR)
10 /**
11 * rpmsg_chrdev_eptdev_create() - register char device based on an endpoint
12 * @rpdev: prepared rpdev to be used for creating endpoints
13 * @parent: parent device
14 * @chinfo: associated endpoint channel information.
16 * This function create a new rpmsg char endpoint device to instantiate a new
17 * endpoint based on chinfo information.
19 int rpmsg_chrdev_eptdev_create(struct rpmsg_device *rpdev, struct device *parent,
20 struct rpmsg_channel_info chinfo);
22 /**
23 * rpmsg_chrdev_eptdev_destroy() - destroy created char device endpoint.
24 * @data: private data associated to the endpoint device
26 * This function destroys a rpmsg char endpoint device created by the RPMSG_DESTROY_EPT_IOCTL
27 * control.
29 int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data);
31 #else /*IS_ENABLED(CONFIG_RPMSG_CHAR) */
33 static inline int rpmsg_chrdev_eptdev_create(struct rpmsg_device *rpdev, struct device *parent,
34 struct rpmsg_channel_info chinfo)
36 return -ENXIO;
39 static inline int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data)
41 return -ENXIO;
44 #endif /*IS_ENABLED(CONFIG_RPMSG_CHAR) */
46 #endif /*__RPMSG_CHRDEV_H__ */