Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5827803ybv; Wed, 12 Feb 2020 00:47:53 -0800 (PST) X-Google-Smtp-Source: APXvYqwcOdF/1EAWCwOmoXx4ycdd9iZRWweLokg7bkfynFNmNuQpz/YwqqZzmnaynlbDV51mEUJ0 X-Received: by 2002:a9d:6184:: with SMTP id g4mr8022775otk.223.1581497272935; Wed, 12 Feb 2020 00:47:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581497272; cv=none; d=google.com; s=arc-20160816; b=cu/wjhx1Gv03BI2huJXsnKvKAuOfTyeVtWZRkDHSDWNoMSPoRbaRbWIuP/xaS6g8s6 ezVonIQUdceYmg+xoLkyNd3Or6rjpvShMbMhY2V4zMV18WQAhfuJLLMZ97geE6/KeK5M HZRnS9KSbf9mMvH7eZYupquGMzaCs2dj6Nzcy0TwjDWZe9o42V/TvXLNY3EsU0v6iqHn vknLbFpZmjCwiorHvI6DsvQ8ihLS0fUM1hBTTw9pkzu+db+VdLt8WHdq0dnrQNdkoeHz ynIbztGlxjOnmVkHJyaLdQpqLFQS7YJ5G8xwl0RAVNGDzD8EJcb7huJtZVawaRcj/Zlz QU6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=hzdEk2PSDKKBG7UsJGaTWXOFXrxdkdvmRAe7XTg+mDs=; b=s66VMr0djONeTUlqG+jRe1UW3Zm858dIQkMR04MsZ5zDOMBSKRcIRO/JqF5C9QphTY dsuWl3Ao0IxGPOLTEaN3p/qpN9phykLQtEDJ7fYkvfuJcyZhSrbzqFYdgkOjER4WPV6d NRCbSZpdWNGBhJSTEZj0inptdo48DK3uliVwL5BpWy/ajOAlGq/3JsEuLmPR5WpHRKp1 vmAN6wH0/wEe3yoI2gYj2mPgwAyUGEKzXmZdeMuDGADeJpFtXF3zF8qypyoZRxrEdKHu AAzLbuAtmWmrNF+JKukpckU4oD5Vt9KfGT35FNqJWMZmoXI8aLVAzYeFQxpQOU2Oln+K Y/rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r10si3219022otk.83.2020.02.12.00.47.40; Wed, 12 Feb 2020 00:47:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728651AbgBLIr1 (ORCPT + 99 others); Wed, 12 Feb 2020 03:47:27 -0500 Received: from esa2.mentor.iphmx.com ([68.232.141.98]:5150 "EHLO esa2.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728544AbgBLIr1 (ORCPT ); Wed, 12 Feb 2020 03:47:27 -0500 IronPort-SDR: 8HuOmCnVODYZngdiFM3tV8yvZSgz3DtseKyY7cs+Ecesj+OCPftV7maS9fRcNPP3ZkNcn6d5Qd rjQz3Ozl6he4uWFM53LqOXf6m2LeRXyFoVhiUngUq9OtiK182dJJm3akR3SzXGpquKb5w7S1QQ BOvekaZpIh/8z2pt9XfhjeSeii0Z1B7S7Nb/yzIJ5C9NAiomyyZgKSZyOLOGQmay9ISp5gUkBt TJmMqrrP19KWAOlZ0gYp/93aYxFK3a1E/aer3JujNn+1vOdjIBKK0vBj06dEdISQQS+ndN0XWq 6TM= X-IronPort-AV: E=Sophos;i="5.70,428,1574150400"; d="scan'208";a="45686305" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 12 Feb 2020 00:47:26 -0800 IronPort-SDR: RhUTOma+4x1Y+3/MS0AApkZYWSDhbSoj41gT83w2tkQKPX1YRoYD/UMxHAhcP/cbWgvXxKJrsb nB5pMzY64IJ/7HenxJm4rfHWUtdEqWoMj4HzmXihLyfwV7tSSF9WYAsiBmmZ2uPqh1EIoTh9Jb dBdtZsxEML2E4jNOgU4wjOA3gAvNcmAvbrRsgwuvTtxNnqQCL5iugDrzFG1a4Uv3LdX/KDRjqS 5noIOvWHK8eN4E7DtsybvJZQTN/a35B30dzrRPCoJChXNolaX5SyDM0W2mYKp+Rc4+yT6yfMPF qX8= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v7 41/48] Input: Atmel: Improve error handling in mxt_initialize_input_device() Date: Wed, 12 Feb 2020 00:42:11 -0800 Message-ID: <20200212084218.32344-42-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200212084218.32344-1-jiada_wang@mentor.com> References: <20200212084218.32344-1-jiada_wang@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Deepak Das Currently Driver probe continues with a warning message when it fails to get the proper multitouch object configurations like TouchScreen resolution. But Driver probe should fail in case of above scneario because it will not behave as expected without the proper touchscreen configurations. This commit modifies mxt_initialize_input_device() to return error when it fails to get the proper touch screen configurations. Signed-off-by: Deepak Das Signed-off-by: Dean Jenkins Signed-off-by: George G. Davis Signed-off-by: Jiada Wang --- drivers/input/touchscreen/atmel_mxt_ts.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 3654f4b399d9..e15f977e0af6 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -2759,15 +2759,19 @@ static int mxt_initialize_input_device(struct mxt_data *data) case MXT_TOUCH_MULTI_T9: num_mt_slots = data->T9_reportid_max - data->T9_reportid_min + 1; error = mxt_read_t9_resolution(data); - if (error) - dev_warn(dev, "Failed to initialize T9 resolution\n"); + if (error) { + dev_err(dev, "Failed to initialize T9 resolution\n"); + return error; + } break; case MXT_TOUCH_MULTITOUCHSCREEN_T100: num_mt_slots = data->num_touchids; error = mxt_read_t100_config(data); - if (error) - dev_warn(dev, "Failed to read T100 config\n"); + if (error) { + dev_err(dev, "Failed to read T100 config\n"); + return error; + } break; default: -- 2.17.1