devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
To: kgene.kim@samsung.com, linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
Cc: gregkh@linuxfoundation.org, ben-linux@fluff.org, cpgs@samsung.com
Subject: [PATCH 3/3] serial: samsung: improve code clarity by defining a variable
Date: Mon, 14 Jul 2014 17:07:18 +0530	[thread overview]
Message-ID: <1405337838-30335-4-git-send-email-ch.naveen@samsung.com> (raw)
In-Reply-To: <1405337838-30335-1-git-send-email-ch.naveen@samsung.com>

The of_node is derived from pdev for every usage, define a
device_node variable instead.

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Cc: gregkh@linuxfoundation.org
---
 drivers/tty/serial/samsung.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index d98f93d..4aff02d 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1269,12 +1269,13 @@ static inline struct s3c24xx_serial_drv_data *s3c24xx_get_driver_data(
 
 static int s3c24xx_serial_probe(struct platform_device *pdev)
 {
+	struct device_node *np = pdev->dev.of_node;
 	struct s3c24xx_uart_port *ourport;
 	int index = probe_index;
 	int ret;
 
-	if (pdev->dev.of_node) {
-		ret = of_alias_get_id(pdev->dev.of_node, "serial");
+	if (np) {
+		ret = of_alias_get_id(np, "serial");
 		if (ret >= 0)
 			index = ret;
 	}
@@ -1295,8 +1296,8 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
 			dev_get_platdata(&pdev->dev) :
 			ourport->drv_data->def_cfg;
 
-	if (pdev->dev.of_node)
-		of_property_read_u32(pdev->dev.of_node,
+	if (np)
+		of_property_read_u32(np,
 			"samsung,uart-fifosize", &ourport->port.fifosize);
 
 	if (!ourport->port.fifosize) {
-- 
1.7.9.5

  parent reply	other threads:[~2014-07-14 11:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14 11:37 [PATCH 0/3] serial: samsung: get fifosize from DT and clean up Naveen Krishna Chatradhi
2014-07-14 11:37 ` [PATCH 1/3] serial: samsung: get fifosize via device tree Naveen Krishna Chatradhi
2014-07-14 11:37 ` [PATCH 2/3] serial: samsung: correct the case and default order in switch Naveen Krishna Chatradhi
2014-07-14 11:37 ` Naveen Krishna Chatradhi [this message]
2014-07-16 12:02 ` [PATCH 0/3] serial: samsung: get fifosize from DT and clean up Tomasz Figa

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=1405337838-30335-4-git-send-email-ch.naveen@samsung.com \
    --to=ch.naveen@samsung.com \
    --cc=ben-linux@fluff.org \
    --cc=cpgs@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    /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).