summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/pi433/rf69.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c
index 1ae23764b911..8b6d68f10e8a 100644
--- a/drivers/staging/pi433/rf69.c
+++ b/drivers/staging/pi433/rf69.c
@@ -128,7 +128,8 @@ int rf69_set_modulation_shaping(struct spi_device *spi,
dev_dbg(&spi->dev, "set: mod shaping");
#endif
- if (rf69_get_modulation(spi) == FSK) {
+ switch (rf69_get_modulation(spi)) {
+ case FSK:
switch (mod_shaping) {
case SHAPING_OFF: return rf69_read_mod_write(spi, REG_DATAMODUL, MASK_DATAMODUL_MODULATION_SHAPE, DATAMODUL_MODULATION_SHAPE_NONE);
case SHAPING_1_0: return rf69_read_mod_write(spi, REG_DATAMODUL, MASK_DATAMODUL_MODULATION_SHAPE, DATAMODUL_MODULATION_SHAPE_1_0);
@@ -138,7 +139,7 @@ int rf69_set_modulation_shaping(struct spi_device *spi,
dev_dbg(&spi->dev, "set: illegal input param");
return -EINVAL;
}
- } else {
+ case OOK:
switch (mod_shaping) {
case SHAPING_OFF: return rf69_read_mod_write(spi, REG_DATAMODUL, MASK_DATAMODUL_MODULATION_SHAPE, DATAMODUL_MODULATION_SHAPE_NONE);
case SHAPING_BR: return rf69_read_mod_write(spi, REG_DATAMODUL, MASK_DATAMODUL_MODULATION_SHAPE, DATAMODUL_MODULATION_SHAPE_BR);
@@ -147,6 +148,9 @@ int rf69_set_modulation_shaping(struct spi_device *spi,
dev_dbg(&spi->dev, "set: illegal input param");
return -EINVAL;
}
+ default:
+ dev_dbg(&spi->dev, "set: modulation undefined");
+ return -EINVAL;
}
}