summaryrefslogtreecommitdiff
path: root/drivers/net/can/spi/mcp25xxfd
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2019-11-14 09:46:36 +0100
committerOleksandr Suvorov <oleksandr.suvorov@toradex.com>2021-01-27 20:36:31 +0200
commit931f8d4e136d8bdf5c6db98120a1a0b3d4c20639 (patch)
tree97f5e4423b44d4ea08278c2bf51ef08cc5e3b848 /drivers/net/can/spi/mcp25xxfd
parent13407ff27074ad4369611a211dd913f81a92158a (diff)
can: mcp25xxfd: allow building without debugfs functionality
If CONFIG_CAN_MCP25XXFD_DEBUG_FS is not defined but CONFIG_DEBUG_FS is then the code fails to compile. Fix this by conditionally compile on CONFIG_CAN_MCP25XXFD_DEBUG_FS. CONFIG_CAN_MCP25XXFD_DEBUG_FS depends on CONFIG_DEBUG_FS, there is no need to test for both. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit c6be3e002d9d878a5119bcaa31ff85a4dbf00301)
Diffstat (limited to 'drivers/net/can/spi/mcp25xxfd')
-rw-r--r--drivers/net/can/spi/mcp25xxfd/mcp25xxfd_cmd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/can/spi/mcp25xxfd/mcp25xxfd_cmd.c b/drivers/net/can/spi/mcp25xxfd/mcp25xxfd_cmd.c
index 1fd385690912..81a4ff49ebc6 100644
--- a/drivers/net/can/spi/mcp25xxfd/mcp25xxfd_cmd.c
+++ b/drivers/net/can/spi/mcp25xxfd/mcp25xxfd_cmd.c
@@ -249,11 +249,13 @@ static int _mcp25xxfd_cmd_readn_crc(struct spi_device *spi, u32 reg,
static int mcp25xxfd_cmd_readn_crc(struct spi_device *spi, u32 reg,
void *data, int n)
{
+#ifdef CONFIG_CAN_MCP25XXFD_DEBUG_FS
struct mcp25xxfd_priv *priv = spi_get_drvdata(spi);
+#endif
int ret;
for (; n > 0; n -= 254, reg += 254, data += 254) {
-#if defined(CONFIG_DEBUG_FS)
+#ifdef CONFIG_CAN_MCP25XXFD_DEBUG_FS
priv->stats.spi_crc_read++;
if (n > 254)
priv->stats.spi_crc_read_split++;