staging: pi433: remove register debug dev_dbg stmts using DEBUG_VALUES
authorPaulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Sun, 6 Feb 2022 05:55:09 +0000 (18:55 +1300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Feb 2022 09:44:30 +0000 (10:44 +0100)
Which the recent addition of the debugfs dentry (regs), users can now
obtain rf69 register values without having to tweak constants
(DEBUG_VALUES) and recompile the pi433 module source code in order to
see those values.

This patch removes code blocks made obsolete by debugfs regs file.

Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Link: https://lore.kernel.org/r/Yf9ivRB5qpmA5rY2@mail.google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/pi433/rf69.c

index 2ab3bf46e37d4acb6756fe45fdebf45e4b22cff8..bf26aef69daad764e2256a1d8e14cad18f3b6363 100644 (file)
@@ -8,8 +8,6 @@
 
 /* enable prosa debug info */
 #undef DEBUG
-/* enable print of values on reg access */
-#undef DEBUG_VALUES
 /* enable print of values on fifo access */
 #undef DEBUG_FIFO_ACCESS
 
 
 u8 rf69_read_reg(struct spi_device *spi, u8 addr)
 {
-       int retval;
-
-       retval = spi_w8r8(spi, addr);
-
-#ifdef DEBUG_VALUES
-       if (retval < 0)
-               /*
-                * should never happen, since we already checked,
-                * that module is connected. Therefore no error
-                * handling, just an optional error message...
-                */
-               dev_dbg(&spi->dev, "read 0x%x FAILED\n", addr);
-       else
-               dev_dbg(&spi->dev, "read 0x%x from reg 0x%x\n", retval, addr);
-#endif
-
-       return retval;
+       return spi_w8r8(spi, addr);
 }
 
 static int rf69_write_reg(struct spi_device *spi, u8 addr, u8 value)
 {
-       int retval;
        char buffer[2];
 
        buffer[0] = addr | WRITE_BIT;
        buffer[1] = value;
 
-       retval = spi_write(spi, &buffer, 2);
-
-#ifdef DEBUG_VALUES
-       if (retval < 0)
-               /*
-                * should never happen, since we already checked,
-                * that module is connected. Therefore no error
-                * handling, just an optional error message...
-                */
-               dev_dbg(&spi->dev, "write 0x%x to 0x%x FAILED\n", value, addr);
-       else
-               dev_dbg(&spi->dev, "wrote 0x%x to reg 0x%x\n", value, addr);
-#endif
-
-       return retval;
+       return spi_write(spi, &buffer, ARRAY_SIZE(buffer));
 }
 
 /*-------------------------------------------------------------------------*/