From patchwork Wed May 22 21:08:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 2603631 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 9BAF8DF215 for ; Wed, 22 May 2013 21:08:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757279Ab3EVVIj (ORCPT ); Wed, 22 May 2013 17:08:39 -0400 Received: from www.linutronix.de ([62.245.132.108]:58876 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756943Ab3EVVIh (ORCPT ); Wed, 22 May 2013 17:08:37 -0400 Received: from localhost ([127.0.0.1] helo=localhost.localdomain) by Galois.linutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1UfGGw-0001JO-RY; Wed, 22 May 2013 23:08:35 +0200 From: Sebastian Andrzej Siewior To: linux-iio@vger.kernel.org, linux-input@vger.kernel.org Cc: Jonathan Cameron , Dmitry Torokhov , Samuel Ortiz , Felipe Balbi , "Patil Rachna" , Sebastian Andrzej Siewior Subject: [PATCH 1/7] input/ti_am_335x_tsc: remove the else case Date: Wed, 22 May 2013 23:08:11 +0200 Message-Id: <1369256897-25984-1-git-send-email-bigeasy@linutronix.de> X-Mailer: git-send-email 1.7.10.4 X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1, SHORTCIRCUIT=-0.0001 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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 --- 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: