Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: pi433: remove register debug dev_dbg stmts using DEBUG_VALUES

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>

authored by

Paulo Miguel Almeida and committed by
Greg Kroah-Hartman
9e223aa4 17156184

+2 -35
+2 -35
drivers/staging/pi433/rf69.c
··· 8 8 9 9 /* enable prosa debug info */ 10 10 #undef DEBUG 11 - /* enable print of values on reg access */ 12 - #undef DEBUG_VALUES 13 11 /* enable print of values on fifo access */ 14 12 #undef DEBUG_FIFO_ACCESS 15 13 ··· 24 26 25 27 u8 rf69_read_reg(struct spi_device *spi, u8 addr) 26 28 { 27 - int retval; 28 - 29 - retval = spi_w8r8(spi, addr); 30 - 31 - #ifdef DEBUG_VALUES 32 - if (retval < 0) 33 - /* 34 - * should never happen, since we already checked, 35 - * that module is connected. Therefore no error 36 - * handling, just an optional error message... 37 - */ 38 - dev_dbg(&spi->dev, "read 0x%x FAILED\n", addr); 39 - else 40 - dev_dbg(&spi->dev, "read 0x%x from reg 0x%x\n", retval, addr); 41 - #endif 42 - 43 - return retval; 29 + return spi_w8r8(spi, addr); 44 30 } 45 31 46 32 static int rf69_write_reg(struct spi_device *spi, u8 addr, u8 value) 47 33 { 48 - int retval; 49 34 char buffer[2]; 50 35 51 36 buffer[0] = addr | WRITE_BIT; 52 37 buffer[1] = value; 53 38 54 - retval = spi_write(spi, &buffer, 2); 55 - 56 - #ifdef DEBUG_VALUES 57 - if (retval < 0) 58 - /* 59 - * should never happen, since we already checked, 60 - * that module is connected. Therefore no error 61 - * handling, just an optional error message... 62 - */ 63 - dev_dbg(&spi->dev, "write 0x%x to 0x%x FAILED\n", value, addr); 64 - else 65 - dev_dbg(&spi->dev, "wrote 0x%x to reg 0x%x\n", value, addr); 66 - #endif 67 - 68 - return retval; 39 + return spi_write(spi, &buffer, ARRAY_SIZE(buffer)); 69 40 } 70 41 71 42 /*-------------------------------------------------------------------------*/