Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752955AbdLLWDE (ORCPT ); Tue, 12 Dec 2017 17:03:04 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:40911 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752709AbdLLWC7 (ORCPT ); Tue, 12 Dec 2017 17:02:59 -0500 X-Google-Smtp-Source: ACJfBosm0KDIJzfc90ti/0cm5KGOT080eOy12mYrOaChI5sooRJqb32+xEsViCESnXXBUqcptziXbQ== From: Kari Argillander To: gregkh@linuxfoundation.org Cc: kari.argillander@gmail.com, marcin.s.ciupak@gmail.com, linux@wolf-entwicklungen.de, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: pi433: Fix disordered switch case Date: Wed, 13 Dec 2017 00:02:11 +0200 Message-Id: <20171212220211.56630-1-kari.argillander@gmail.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1730 Lines: 32 Case: SHAPING_0_5 is writing DATAMODUL_MODLATION_SHAPE_0_3 value and vice versa Signed-off-by: Kari Argillander --- I have checked that defines are correct accounting to the datasheet. My first patch. Hopefully everything goes like needs to. I do not know if this should go to stable because patch is for the staging area and it is known to be unstable. But because Greg is maintainer for both I do not cc stable here. --- drivers/staging/pi433/rf69.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c index 8b6d68f10e8a..bc6d5b6cd186 100644 --- a/drivers/staging/pi433/rf69.c +++ b/drivers/staging/pi433/rf69.c @@ -133,8 +133,8 @@ int rf69_set_modulation_shaping(struct spi_device *spi, 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); - case SHAPING_0_5: return rf69_read_mod_write(spi, REG_DATAMODUL, MASK_DATAMODUL_MODULATION_SHAPE, DATAMODUL_MODULATION_SHAPE_0_3); - case SHAPING_0_3: return rf69_read_mod_write(spi, REG_DATAMODUL, MASK_DATAMODUL_MODULATION_SHAPE, DATAMODUL_MODULATION_SHAPE_0_5); + case SHAPING_0_5: return rf69_read_mod_write(spi, REG_DATAMODUL, MASK_DATAMODUL_MODULATION_SHAPE, DATAMODUL_MODULATION_SHAPE_0_5); + case SHAPING_0_3: return rf69_read_mod_write(spi, REG_DATAMODUL, MASK_DATAMODUL_MODULATION_SHAPE, DATAMODUL_MODULATION_SHAPE_0_3); default: dev_dbg(&spi->dev, "set: illegal input param"); return -EINVAL; -- 2.15.1