summaryrefslogtreecommitdiff
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-09 22:38:58 +0100
commitf67f726d1b12300d6e0241d923b91d979eb11d20 (patch)
treeac2481af0902c61b24b565212afb5d06ee9ed0c4
parentabb917cf53b006c4f0783a8a6ed6ccfe96fbd80c (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>
-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++;