[PATCH 3/3] serial: samsung: improve code clarity by defining a variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@xxxxxxxxxxx>
Cc: gregkh@xxxxxxxxxxxxxxxxxxx
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux