summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2019-11-14 09:46:36 +0100
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2020-02-12 11:06:10 +0100
commit0ecab00b0e4c1ceb266799749860b034c21c63f9 (patch)
tree0d5d104b8e7ed835be917a7c9cef2edc51136ffd /drivers
parent5a0b913974a915bfd3193690d27a0a2e0762bfe2 (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>
Diffstat (limited to 'drivers')
-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++;