All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin Hundebøll" <martin@geanix.com>
To: Mark Brown <broonie@kernel.org>, linux-spi@vger.kernel.org
Cc: "Martin Hundebøll" <martin@geanix.com>,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	bcm-kernel-feedback-list@broadcom.com,
	"Scott Branden" <sbranden@broadcom.com>,
	"Ray Jui" <rjui@broadcom.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Nicolas Saenz Julienne" <nsaenzjulienne@suse.de>
Subject: [PATCH] spi: bcm2835: remove use of uninitialized gpio flags variable
Date: Thu,  5 Nov 2020 10:06:15 +0100	[thread overview]
Message-ID: <20201105090615.620315-1-martin@geanix.com> (raw)
In-Reply-To: <20201014090230.2706810-1-martin@geanix.com>

Removing the duplicate gpio chip select level handling in
bcm2835_spi_setup() left the lflags variable uninitialized. Avoid trhe
use of such variable by passing default flags to
gpiochip_request_own_desc().

Fixes: 5e31ba0c0543 ("spi: bcm2835: fix gpio cs level inversion")
Signed-off-by: Martin Hundebøll <martin@geanix.com>
---

Feel free to squash this commit with my previous patch, if rebasing
for-next is allowed.

 drivers/spi/spi-bcm2835.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 9b6ba94fe878..7104cf17b848 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -1193,7 +1193,6 @@ static int bcm2835_spi_setup(struct spi_device *spi)
 	struct spi_controller *ctlr = spi->controller;
 	struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr);
 	struct gpio_chip *chip;
-	enum gpio_lookup_flags lflags;
 	u32 cs;
 
 	/*
@@ -1261,7 +1260,7 @@ static int bcm2835_spi_setup(struct spi_device *spi)
 
 	spi->cs_gpiod = gpiochip_request_own_desc(chip, 8 - spi->chip_select,
 						  DRV_NAME,
-						  lflags,
+						  GPIO_LOOKUP_FLAGS_DEFAULT,
 						  GPIOD_OUT_LOW);
 	if (IS_ERR(spi->cs_gpiod))
 		return PTR_ERR(spi->cs_gpiod);
-- 
2.28.0


WARNING: multiple messages have this Message-ID (diff)
From: "Martin Hundebøll" <martin@geanix.com>
To: Mark Brown <broonie@kernel.org>, linux-spi@vger.kernel.org
Cc: "Florian Fainelli" <f.fainelli@gmail.com>,
	"Scott Branden" <sbranden@broadcom.com>,
	"Martin Hundebøll" <martin@geanix.com>,
	"Nicolas Saenz Julienne" <nsaenzjulienne@suse.de>,
	bcm-kernel-feedback-list@broadcom.com,
	linux-rpi-kernel@lists.infradead.org,
	"Ray Jui" <rjui@broadcom.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH] spi: bcm2835: remove use of uninitialized gpio flags variable
Date: Thu,  5 Nov 2020 10:06:15 +0100	[thread overview]
Message-ID: <20201105090615.620315-1-martin@geanix.com> (raw)
In-Reply-To: <20201014090230.2706810-1-martin@geanix.com>

Removing the duplicate gpio chip select level handling in
bcm2835_spi_setup() left the lflags variable uninitialized. Avoid trhe
use of such variable by passing default flags to
gpiochip_request_own_desc().

Fixes: 5e31ba0c0543 ("spi: bcm2835: fix gpio cs level inversion")
Signed-off-by: Martin Hundebøll <martin@geanix.com>
---

Feel free to squash this commit with my previous patch, if rebasing
for-next is allowed.

 drivers/spi/spi-bcm2835.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 9b6ba94fe878..7104cf17b848 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -1193,7 +1193,6 @@ static int bcm2835_spi_setup(struct spi_device *spi)
 	struct spi_controller *ctlr = spi->controller;
 	struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr);
 	struct gpio_chip *chip;
-	enum gpio_lookup_flags lflags;
 	u32 cs;
 
 	/*
@@ -1261,7 +1260,7 @@ static int bcm2835_spi_setup(struct spi_device *spi)
 
 	spi->cs_gpiod = gpiochip_request_own_desc(chip, 8 - spi->chip_select,
 						  DRV_NAME,
-						  lflags,
+						  GPIO_LOOKUP_FLAGS_DEFAULT,
 						  GPIOD_OUT_LOW);
 	if (IS_ERR(spi->cs_gpiod))
 		return PTR_ERR(spi->cs_gpiod);
-- 
2.28.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-11-05  9:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14  9:02 [PATCH] spi: bcm2835: fix gpio cs level inversion Martin Hundebøll
2020-10-14  9:02 ` Martin Hundebøll
2020-10-29 13:07 ` Mark Brown
2020-10-30  9:06 ` Nathan Chancellor
2020-10-30  9:06   ` Nathan Chancellor
2020-11-05  9:06 ` Martin Hundebøll [this message]
2020-11-05  9:06   ` [PATCH] spi: bcm2835: remove use of uninitialized gpio flags variable Martin Hundebøll
2020-11-05 15:08   ` Mark Brown
2020-11-05 15:08     ` Mark Brown
2020-11-06 11:54   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201105090615.620315-1-martin@geanix.com \
    --to=martin@geanix.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=broonie@kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=nsaenzjulienne@suse.de \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.