Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp627186ybb; Wed, 25 Mar 2020 06:39:07 -0700 (PDT) X-Google-Smtp-Source: ADFU+vskfgr/UeksHYOtKTo48gj+kJvQS/vcV8kwAjupcypRgFFtHnBH8Oogdgt3e027SqZmwr0q X-Received: by 2002:a05:6830:4008:: with SMTP id h8mr2549465ots.295.1585143547456; Wed, 25 Mar 2020 06:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585143547; cv=none; d=google.com; s=arc-20160816; b=tsrz6p51oAyWmQ5sv5aGim4Q8NCinGhc+PhsLegG49NIu+lGAUgptLsxn9iwPCGFZG ZF6A5U2sUUZhHM2U3Gpuw411n79AgolZiXACc97yRPsJknc1Rp/yXxpB4qdHy0J0qaLf a4SFa27Bmr7IjKlTZk7G+CXrlViOEBrd9BMRGGQ8kKRPkDLuk8E3/k058AFgALZNGGOL cV76SvvDtKY/ZvY4Hfd/WZ7Bf9T8l+/Fn4KJ7k0zekCzIbNFVGT7YJ8WswClofD3ny0r 8R8lrOXDEU9JEU7Z336ktmWA1h41yxnbsnZvY+5C8xjvOpYL9Fkirl2ktqUDyRHXKQ8z pFOA== 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=VlVUlT/a5uSOeeixAsl6Y6Fj4Cx5+jx9dCGLPFEgVdo=; b=ngWVATf90ML47fxuNRIhAi+B0z+OiRlWcfn1MiZCzWrRYzKfo+U005ZwpHvz9EcmuI WqJhlbPC8q6eymniOiIJyFyo1Wwxzfafc/JY3JMxo8AwOrG+y5Pek62jBvb1rjmYoVNx joQZ2Cuez1Vp8w1TILrpZs+a9mGzosOC17/9HoYIWm+tB4TVa/ashiA5FHr7wjV2Gncc lyn+0NFfNV2Zw0i5mQqqo7D1UpMBhRIFoYhR8DKdi/ofnjIMv5dBHYbTRYwaCFztAfpX lKxzY3CrHsZDIEYUbWh1jaZs+0KkR8+cINRDfhQeT05zv4cFeE9X/VwPVgcCFmqlz9/U p6+A== 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 m8si1173210oim.26.2020.03.25.06.38.54; Wed, 25 Mar 2020 06:39:07 -0700 (PDT) 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 S1728133AbgCYNhE (ORCPT + 99 others); Wed, 25 Mar 2020 09:37:04 -0400 Received: from esa4.mentor.iphmx.com ([68.232.137.252]:34650 "EHLO esa4.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727493AbgCYNgy (ORCPT ); Wed, 25 Mar 2020 09:36:54 -0400 IronPort-SDR: mgM6mspTB2LAyvtUDGLASdHEiRIr3JQvuD0AJHztcHf02pZ1S9ZX8cfmRME8NdVdm2p71/dSvZ bi3su1sxN+qonhD7VQOSnmLdYH+nZZa3gpwVqWfBv1nuWnCNELrutml2SxVuG1G0qQPMqPWmpw phOTXUidqEvu+hYtCWnmsg6gx3kMmVQGgemhZvytbwJP0wxeI/1Hwfe3aawfJxYA+XQ62UDSS9 sryY2zQnUN9BmF1u6QmbVxMFNmdJv9qYBa1AdL8IkHkyiAGWiH8smFwLQlx8zxL85TXYohqbs4 +yg= X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="47143548" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 25 Mar 2020 05:36:53 -0800 IronPort-SDR: uKU0k0TN8UuNPZp9DSgb1Pcp5hCjvHtFnX0ZX8mOAffjWLqzb9g0BV4NYIyfsJfTgbTG1Yxa/q d9bYtUNf1UnnAwbRePM5UWHPtax7U5GMcOEYi4jLaMLms+A3vUmF9oeGtVAJvlKazyvMXXWwib K8LwWquF24VoiKoJW839kOEPQfwcU+1VU5m6VkX6lPWoJ7J7jxvxOR4zZQPltGLO1pSPXo/J0c 1ijwDPkMpCwR+O72gHHEVKN7el8onVm5+IE3sNcycsgpkQdhEbIEu/UO0Ki/tVFqaB3Bj2kAxt CO0= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v9 48/55] Input: Atmel: Improve error handling in mxt_initialize_input_device() Date: Wed, 25 Mar 2020 06:33:27 -0700 Message-ID: <20200325133334.19346-49-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200325133334.19346-1-jiada_wang@mentor.com> References: <20200325133334.19346-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 069a532bd0b2..ed357e958f07 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -2761,15 +2761,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