linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] input/ti_am_335x_tsc: remove the else case
@ 2013-05-22 21:08 Sebastian Andrzej Siewior
       [not found] ` <1369256897-25984-1-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-05-22 21:08 UTC (permalink / raw)
  To: linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-input-u79uwXL29TY76Z2rM5mHXA
  Cc: Jonathan Cameron, Dmitry Torokhov, Samuel Ortiz, Felipe Balbi,
	Patil Rachna, Sebastian Andrzej Siewior

The DT support added in ("input: touchscreen: am335x: Add DT support")
added an else case which shifts the code to the righ for no reaseon.
This patch simply removes the pointless else case and shifts the code
back to the left.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
---
 drivers/input/touchscreen/ti_am335x_tsc.c |   63 +++++++++++++----------------
 1 file changed, 28 insertions(+), 35 deletions(-)

diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index 4fcf72f..20f4505 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -396,41 +396,34 @@ static int titsc_parse_dt(struct ti_tscadc_dev *tscadc_dev,
 
 	if (!node)
 		return -EINVAL;
-	else {
-		node = of_get_child_by_name(node, "tsc");
-		if (!node)
-			return -EINVAL;
-		else {
-			err = of_property_read_u32(node, "ti,wires", &val32);
-			if (err < 0)
-				goto error_ret;
-			else
-				ts_dev->wires = val32;
-
-			err = of_property_read_u32(node,
-					"ti,x-plate-resistance", &val32);
-			if (err < 0)
-				goto error_ret;
-			else
-				ts_dev->x_plate_resistance = val32;
-
-			err = of_property_read_u32(node,
-					"ti,steps-to-configure", &val32);
-			if (err < 0)
-				goto error_ret;
-			else
-				ts_dev->steps_to_configure = val32;
-
-			err = of_property_read_u32_array(node, "ti,wire-config",
-					wires_conf, ARRAY_SIZE(wires_conf));
-			if (err < 0)
-				goto error_ret;
-			else {
-				for (i = 0; i < ARRAY_SIZE(wires_conf); i++)
-					ts_dev->config_inp[i] = wires_conf[i];
-			}
-		}
-	}
+
+	node = of_get_child_by_name(node, "tsc");
+	if (!node)
+		return -EINVAL;
+	err = of_property_read_u32(node, "ti,wires", &val32);
+	if (err < 0)
+		goto error_ret;
+	ts_dev->wires = val32;
+
+	err = of_property_read_u32(node,
+			"ti,x-plate-resistance", &val32);
+	if (err < 0)
+		goto error_ret;
+	ts_dev->x_plate_resistance = val32;
+
+	err = of_property_read_u32(node,
+			"ti,steps-to-configure", &val32);
+	if (err < 0)
+		goto error_ret;
+	ts_dev->steps_to_configure = val32;
+
+	err = of_property_read_u32_array(node, "ti,wire-config",
+			wires_conf, ARRAY_SIZE(wires_conf));
+	if (err < 0)
+		goto error_ret;
+
+	for (i = 0; i < ARRAY_SIZE(wires_conf); i++)
+		ts_dev->config_inp[i] = wires_conf[i];
 	return 0;
 
 error_ret:
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-05-31  7:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-22 21:08 [PATCH 1/7] input/ti_am_335x_tsc: remove the else case Sebastian Andrzej Siewior
     [not found] ` <1369256897-25984-1-git-send-email-bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2013-05-22 21:08   ` [PATCH 2/7] input/ti_am33x_tsc: remove platform_data support Sebastian Andrzej Siewior
2013-05-22 21:08   ` [PATCH 3/7] input/i_am335x_tsc: removed unused variable in titsc_irq() Sebastian Andrzej Siewior
2013-05-22 21:44     ` Jonathan Cameron
2013-05-22 21:08   ` [PATCH 4/7] iio/ti_am335x_adc: remove the else case Sebastian Andrzej Siewior
2013-05-22 21:55     ` Jonathan Cameron
2013-05-31  7:43       ` Sebastian Andrzej Siewior
2013-05-22 21:08   ` [PATCH 6/7] mfd/ti_am335x_tscadc: remove platform_data support Sebastian Andrzej Siewior
2013-05-22 21:08 ` [PATCH 5/7] iio/ti_am335x_adc: " Sebastian Andrzej Siewior
2013-05-22 21:08 ` [PATCH 7/7] Documentation/DT bindings: add info for TI TSC ADC Sebastian Andrzej Siewior

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).