From: Axel Lin <axel.lin@ingics.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Liu Gang <Gang.Liu@nxp.com>, Alexandre Courbot <gnurou@gmail.com>,
Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>,
Alexander Stein <alexander.stein@systec-electronic.com>,
linux-gpio@vger.kernel.org
Subject: [RFT][PATCH v2 3/3] gpio: mpc8xxx: Slightly update the code for better readability
Date: Mon, 22 Feb 2016 15:24:54 +0800 [thread overview]
Message-ID: <1456125894.27297.2.camel@ingics.com> (raw)
In-Reply-To: <1456125772.27297.0.camel@ingics.com>
Setting gc->direction_output to gc->direction_output looks strange.
I think this change makes the intention more clear.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/gpio/gpio-mpc8xxx.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c
index bc042ad6..425501c 100644
--- a/drivers/gpio/gpio-mpc8xxx.c
+++ b/drivers/gpio/gpio-mpc8xxx.c
@@ -339,8 +339,11 @@ static int mpc8xxx_probe(struct platform_device *pdev)
*/
mpc8xxx_irq_chip.irq_set_type = devtype->irq_set_type;
- gc->direction_output = devtype->gpio_dir_out ?: gc->direction_output;
- gc->get = devtype->gpio_get ?: gc->get;
+ if (devtype->gpio_dir_out)
+ gc->direction_output = devtype->gpio_dir_out;
+ if (devtype->gpio_get)
+ gc->get = devtype->gpio_get;
+
gc->to_irq = mpc8xxx_gpio_to_irq;
ret = gpiochip_add_data(gc, mpc8xxx_gc);
--
2.1.4
next prev parent reply other threads:[~2016-02-22 7:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 7:22 [RFT][PATCH v2 1/3] gpio: mpc8xxx: Fixup setting gpio direction output Axel Lin
2016-02-22 7:24 ` [RFT][PATCH v2 2/3] gpio: mpc8xxx: Remove *read_reg and *write_reg from struct mpc8xxx_gpio_chip Axel Lin
2016-03-02 7:31 ` Gang Liu
2016-03-09 3:43 ` Linus Walleij
2016-02-22 7:24 ` Axel Lin [this message]
2016-03-02 7:32 ` [RFT][PATCH v2 3/3] gpio: mpc8xxx: Slightly update the code for better readability Gang Liu
2016-03-09 3:44 ` Linus Walleij
2016-03-02 7:20 ` [RFT][PATCH v2 1/3] gpio: mpc8xxx: Fixup setting gpio direction output Gang Liu
2016-03-09 3:42 ` Linus Walleij
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=1456125894.27297.2.camel@ingics.com \
--to=axel.lin@ingics.com \
--cc=Gang.Liu@nxp.com \
--cc=alexander.stein@systec-electronic.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=ricardo.ribalda@gmail.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.