staging: pi433: make local functions static
authorMarcin Ciupak <marcin.s.ciupak@gmail.com>
Wed, 20 Dec 2017 16:13:52 +0000 (16:13 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Dec 2017 17:29:40 +0000 (18:29 +0100)
Following functions:
* rf69_get_modulation
* rf69_read_reg
* rf69_write_reg
are used locally only and should be declared as static

Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/pi433/rf69.c
drivers/staging/pi433/rf69.h

index 2d3c6ab0a12ab18421bad07c41676f9aa99e0cea..61d7dfd7c87378546398bdf1a95bcdb1b3633b2b 100644 (file)
 
 /*-------------------------------------------------------------------------*/
 
+static 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;
+}
+
+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;
+}
+
+/*-------------------------------------------------------------------------*/
+
 static int rf69_set_bit(struct spi_device *spi, u8 reg, u8 mask)
 {
        u8 tmp;
@@ -96,7 +142,7 @@ int rf69_set_modulation(struct spi_device *spi, enum modulation modulation)
        }
 }
 
-enum modulation rf69_get_modulation(struct spi_device *spi)
+static enum modulation rf69_get_modulation(struct spi_device *spi)
 {
        u8 currentValue;
 
@@ -796,49 +842,3 @@ int rf69_write_fifo(struct spi_device *spi, u8 *buffer, unsigned int size)
        return spi_write(spi, local_buffer, size + 1);
 }
 
-/*-------------------------------------------------------------------------*/
-
-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;
-}
-
-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;
-}
-
index 9ec75d8d1b57c1091359d9da3a4cdf4431bca07f..6e1b5af568543cbd31804c55fc7222396e510664 100644 (file)
@@ -28,7 +28,6 @@
 int rf69_set_mode(struct spi_device *spi, enum mode mode);
 int rf69_set_data_mode(struct spi_device *spi, u8 data_mode);
 int rf69_set_modulation(struct spi_device *spi, enum modulation modulation);
-enum modulation rf69_get_modulation(struct spi_device *spi);
 int rf69_set_modulation_shaping(struct spi_device *spi, enum mod_shaping mod_shaping);
 int rf69_set_bit_rate(struct spi_device *spi, u16 bitRate);
 int rf69_set_deviation(struct spi_device *spi, u32 deviation);
@@ -75,6 +74,4 @@ int rf69_set_dagc(struct spi_device *spi, enum dagc dagc);
 int rf69_read_fifo(struct spi_device *spi, u8 *buffer, unsigned int size);
 int rf69_write_fifo(struct spi_device *spi, u8 *buffer, unsigned int size);
 
-u8  rf69_read_reg(struct spi_device *spi, u8 addr);
-int rf69_write_reg(struct spi_device *spi, u8 addr, u8 value);
 #endif