drm/tests: hdmi: Fix memory leaks in drm_display_mode_from_cea_vic()
[drm/drm-misc.git] / include / rdma / ib_sysfs.h
blob3b77cfd74d9a3019278a88f844cd4a456100eef6
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /*
3 * Copyright (c) 2021 Mellanox Technologies Ltd. All rights reserved.
4 */
5 #ifndef DEF_RDMA_IB_SYSFS_H
6 #define DEF_RDMA_IB_SYSFS_H
8 #include <linux/sysfs.h>
10 struct ib_device;
12 struct ib_port_attribute {
13 struct attribute attr;
14 ssize_t (*show)(struct ib_device *ibdev, u32 port_num,
15 struct ib_port_attribute *attr, char *buf);
16 ssize_t (*store)(struct ib_device *ibdev, u32 port_num,
17 struct ib_port_attribute *attr, const char *buf,
18 size_t count);
21 #define IB_PORT_ATTR_RW(_name) \
22 struct ib_port_attribute ib_port_attr_##_name = __ATTR_RW(_name)
24 #define IB_PORT_ATTR_ADMIN_RW(_name) \
25 struct ib_port_attribute ib_port_attr_##_name = \
26 __ATTR_RW_MODE(_name, 0600)
28 #define IB_PORT_ATTR_RO(_name) \
29 struct ib_port_attribute ib_port_attr_##_name = __ATTR_RO(_name)
31 #define IB_PORT_ATTR_WO(_name) \
32 struct ib_port_attribute ib_port_attr_##_name = __ATTR_WO(_name)
34 struct ib_device *ib_port_sysfs_get_ibdev_kobj(struct kobject *kobj,
35 u32 *port_num);
37 #endif