devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	 Bartosz Golaszewski <brgl@bgdev.pl>,
	Andy Shevchenko <andy@kernel.org>,
	 Rob Herring <robh+dt@kernel.org>,
	 Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Stefan Agner <stefan@agner.ch>,  Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	 Pengutronix Kernel Team <kernel@pengutronix.de>,
	 Fabio Estevam <festevam@gmail.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	 Marco Felsch <m.felsch@pengutronix.de>
Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 Peng Fan <peng.fan@nxp.com>
Subject: [PATCH v5 5/7] gpio: vf610: simplify code by dropping data check
Date: Sun, 01 Oct 2023 16:27:56 +0800	[thread overview]
Message-ID: <20231001-vf610-gpio-v5-5-8d873a8f224a@nxp.com> (raw)
In-Reply-To: <20231001-vf610-gpio-v5-0-8d873a8f224a@nxp.com>

From: Peng Fan <peng.fan@nxp.com>

All of_device_id entries has valid data, so code simplified
a bit by dropping the data check.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/gpio/gpio-vf610.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c
index 8e12706c0b22..c03dfda41d4c 100644
--- a/drivers/gpio/gpio-vf610.c
+++ b/drivers/gpio/gpio-vf610.c
@@ -100,7 +100,7 @@ static int vf610_gpio_get(struct gpio_chip *gc, unsigned int gpio)
 	unsigned long mask = BIT(gpio);
 	unsigned long offset = GPIO_PDIR;
 
-	if (port->sdata && port->sdata->have_paddr) {
+	if (port->sdata->have_paddr) {
 		mask &= vf610_gpio_readl(port->gpio_base + GPIO_PDDR);
 		if (mask)
 			offset = GPIO_PDOR;
@@ -124,7 +124,7 @@ static int vf610_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
 	unsigned long mask = BIT(gpio);
 	u32 val;
 
-	if (port->sdata && port->sdata->have_paddr) {
+	if (port->sdata->have_paddr) {
 		val = vf610_gpio_readl(port->gpio_base + GPIO_PDDR);
 		val &= ~mask;
 		vf610_gpio_writel(val, port->gpio_base + GPIO_PDDR);
@@ -140,7 +140,7 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
 	unsigned long mask = BIT(gpio);
 	u32 val;
 
-	if (port->sdata && port->sdata->have_paddr) {
+	if (port->sdata->have_paddr) {
 		val = vf610_gpio_readl(port->gpio_base + GPIO_PDDR);
 		val |= mask;
 		vf610_gpio_writel(val, port->gpio_base + GPIO_PDDR);

-- 
2.37.1


  parent reply	other threads:[~2023-10-01  8:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-01  8:27 [PATCH v5 0/7] gpio: update i.MX93/8ULP and support i.MX95 Peng Fan (OSS)
2023-10-01  8:27 ` [PATCH v5 1/7] dt-bindings: gpio: vf610: update gpio-ranges Peng Fan (OSS)
2023-10-01  8:27 ` [PATCH v5 2/7] dt-bindings: gpio: vf610: correct i.MX8ULP and i.MX93 Peng Fan (OSS)
2023-10-01  8:27 ` [PATCH v5 3/7] dt-bindings: gpio: vf610: add i.MX95 compatible Peng Fan (OSS)
2023-10-01  8:27 ` [PATCH v5 4/7] gpio: vf610: add i.MX8ULP of_device_id entry Peng Fan (OSS)
2023-10-02  9:04   ` Bartosz Golaszewski
2023-10-02  9:43     ` Peng Fan
2023-10-04  5:04       ` Marco Felsch
2023-10-01  8:27 ` Peng Fan (OSS) [this message]
2023-10-01  8:27 ` [PATCH v5 6/7] arm64: dts: imx8ulp: update gpio node Peng Fan (OSS)
2023-10-10  1:44   ` Shawn Guo
2023-10-01  8:27 ` [PATCH v5 7/7] arm64: dts: imx93: " Peng Fan (OSS)
2023-10-10  1:44   ` Shawn Guo
2023-10-05 17:54 ` [PATCH v5 0/7] gpio: update i.MX93/8ULP and support i.MX95 Bartosz Golaszewski
2023-10-10  1:35 ` Peng Fan

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=20231001-vf610-gpio-v5-5-8d873a8f224a@nxp.com \
    --to=peng.fan@oss.nxp.com \
    --cc=andy@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=peng.fan@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=stefan@agner.ch \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).