summaryrefslogtreecommitdiff
path: root/drivers/net/can/spi/mcp25xxfd/mcp25xxfd_can_debugfs.h
blob: a8391370d4bf6da06b24bc1aa0a76a12f4bd5757 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* SPDX-License-Identifier: GPL-2.0 */

/* CAN bus driver for Microchip 25XXFD CAN Controller with SPI Interface
 *
 * Copyright 2019 Martin Sperl <kernel@martin.sperl.org>
 */

#ifndef __MCP25XXFD_CAN_DEBUGFS_H
#define __MCP25XXFD_CAN_DEBUGFS_H

#include "mcp25xxfd_can_priv.h"

#ifdef CONFIG_CAN_MCP25XXFD_DEBUG_FS

#include <linux/debugfs.h>

#define MCP25XXFD_DEBUGFS_INCR(counter) ((counter)++)
#define MCP25XXFD_DEBUGFS_ADD(counter, val) ((counter) += (val))
#define MCP25XXFD_DEBUGFS_STATS_INCR(cpriv, counter)		\
	(((cpriv)->stats.counter)++)
#define MCP25XXFD_DEBUGFS_STATS_ADD(cpriv, counter, val)	\
	(((cpriv)->stats.counter) += (val))

void mcp25xxfd_can_debugfs_setup(struct mcp25xxfd_can_priv *cpriv);
void mcp25xxfd_can_debugfs_remove(struct mcp25xxfd_can_priv *cpriv);

#else /* CONFIG_CAN_MCP25XXFD_DEBUG_FS */

#define MCP25XXFD_DEBUGFS_INCR(counter)
#define MCP25XXFD_DEBUGFS_ADD(counter, val)
#define MCP25XXFD_DEBUGFS_STATS_INCR(cpriv, counter)
#define MCP25XXFD_DEBUGFS_STATS_ADD(cpriv, counter, val)

static inline
void mcp25xxfd_can_debugfs_setup(struct mcp25xxfd_can_priv *cpriv)
{
}

static inline
void mcp25xxfd_can_debugfs_remove(struct mcp25xxfd_can_priv *cpriv)
{
}

#endif /* CONFIG_CAN_MCP25XXFD_DEBUG_FS */
#endif /* __MCP25XXFD_CAN_DEBUGFS_H */