WIP FPC-III support
[linux/fpc-iii.git] / drivers / infiniband / hw / mlx5 / fs.h
blobad320adaf32172e50a67401ac33eec9441b3be5a
1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /*
3 * Copyright (c) 2013-2020, Mellanox Technologies inc. All rights reserved.
4 */
6 #ifndef _MLX5_IB_FS_H
7 #define _MLX5_IB_FS_H
9 #include "mlx5_ib.h"
11 #if IS_ENABLED(CONFIG_INFINIBAND_USER_ACCESS)
12 int mlx5_ib_fs_init(struct mlx5_ib_dev *dev);
13 #else
14 static inline int mlx5_ib_fs_init(struct mlx5_ib_dev *dev)
16 dev->flow_db = kzalloc(sizeof(*dev->flow_db), GFP_KERNEL);
18 if (!dev->flow_db)
19 return -ENOMEM;
21 mutex_init(&dev->flow_db->lock);
22 return 0;
24 #endif
25 static inline void mlx5_ib_fs_cleanup(struct mlx5_ib_dev *dev)
27 kfree(dev->flow_db);
29 #endif /* _MLX5_IB_FS_H */