Skip to contentSkip to conversation

PCI: mvebu: Remove unneeded gpiod NULL check

PATCH In review Fabio Estevam 3 participants 3 messages Jul 16, 2017 – Aug 2, 2017 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: mvebu: Remove unneeded gpiod NULL check

From: Fabio Estevam <[email protected]>

The gpiod API checks for NULL descriptors, so there is no need to duplicate the check in the driver.

---
 drivers/pci/host/pci-mvebu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/host/pci-mvebu.c +1 -2
index f353a6e..fa227d8 100644
@@ -1186,8 +1186,7 @@ static int mvebu_pcie_powerup(struct mvebu_pcie_port *port)
  */
 static void mvebu_pcie_powerdown(struct mvebu_pcie_port *port)
 {
-	if (port->reset_gpio)
-		gpiod_set_value_cansleep(port->reset_gpio, 1);
+	gpiod_set_value_cansleep(port->reset_gpio, 1);
 
 	clk_disable_unprepare(port->clk);
 }
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#1 lore raw

Hello,

Quoted 9 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

The gpiod API checks for NULL descriptors, so there is no need to duplicate the check in the driver.

---
 drivers/pci/host/pci-mvebu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw
In reply to Fabio Estevam
Quoted 6 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

The gpiod API checks for NULL descriptors, so there is no need to duplicate the check in the driver.

Applied with Thomas' ack to pci/host-mvebu for v4.14, thanks!

Quoted 21 lines
---
 drivers/pci/host/pci-mvebu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/host/pci-mvebu.c +1 -2
index f353a6e..fa227d8 100644
@@ -1186,8 +1186,7 @@ static int mvebu_pcie_powerup(struct mvebu_pcie_port *port)
  */
 static void mvebu_pcie_powerdown(struct mvebu_pcie_port *port)
 {
-	if (port->reset_gpio)
-		gpiod_set_value_cansleep(port->reset_gpio, 1);
+	gpiod_set_value_cansleep(port->reset_gpio, 1);
 
 	clk_disable_unprepare(port->clk);
 }
Signature · 1 line
2.7.4