staging: pi433: fix validation for min bit rate supported by the device
authorPaulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Tue, 18 Jan 2022 23:04:13 +0000 (12:04 +1300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Jan 2022 15:33:55 +0000 (16:33 +0100)
rf69 datasheets establishes that the minimum supported bit rate is
1.2 kbps regardless of modulation.

this patch replaces the errouneous validation with the correct value

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

index ee8c81d164e1cf861ec634808c5704771844a0f1..f4ac17adcd8381d42ceb361c7eb3f53160deb454 100644 (file)
@@ -226,14 +226,12 @@ int rf69_set_modulation_shaping(struct spi_device *spi,
 int rf69_set_bit_rate(struct spi_device *spi, u16 bit_rate)
 {
        int retval;
-       u32 bit_rate_min;
        u32 bit_rate_reg;
        u8 msb;
        u8 lsb;
 
        // check input value
-       bit_rate_min = F_OSC / 8388608; // 8388608 = 2^23;
-       if (bit_rate < bit_rate_min) {
+       if (bit_rate < 1200) {
                dev_dbg(&spi->dev, "setBitRate: illegal input param");
                return -EINVAL;
        }