Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3367288ybb; Tue, 31 Mar 2020 03:55:59 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtOlW5pNorpVnaFLcjkV6EZDEufUz/SDGFqsVmm+s1FZnr/o0AB4Zjz4oz5Ds9+q0u8ZXrD X-Received: by 2002:a9d:6ad2:: with SMTP id m18mr2818031otq.28.1585652159495; Tue, 31 Mar 2020 03:55:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585652159; cv=none; d=google.com; s=arc-20160816; b=rRAVhgbeIHrwWRJiyOLBEY151/AAy4WAGWyZo4NWeUu+azOeo8lvtEs0wBKXIHtXpL ETPJ3J8tqBZLKDME8l1Buz8S+QhMu8XCGFKrSVjOvO0mLfjWk61W5esVwqVe+gArf44V vKK/Vg6s2QuYsGLWCoLsfnzjbQ7NN2A3jHBxWYSgg727x92an6mDsF7KQzoj4qwqpNYf qP46p1jF9y5AtUXGRyE/NqdIoG56bO4U9szY2ufB1z2cMVNqphanap+SzPwvajG4egZ2 J13KPvCcTTyRkAcmyPNzFSwZ+HhqzmnSo1bMJbB2wfOT9xLvC11cD20g3i1wXLjEdKL9 OJvA== 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=yOD6UPA4JjuyRCEyq2MqbGspSMOQaycW8NrYgX1hnx+C8uJ8tHY0c1DJ55KBG0hOA8 u2vL2J5QDZkiU+R8ZPKblg7x4UNSBAoMdO9xacLvNIXG7sfMPkgC9oD2OcMRs06Tktb8 nfBLWLfL9z9RStguUJd9TNFEEXpvubH9nBGjAOWBeytNPQc0CtLQdQkPjE4MXK6cdX5l dg5MGOEcaBqy4s2Xvex9p63Ibb0qGf9yZw02LqWtXwtJE5Jmq8Nh/Iz8mAgGeoUkVYz1 NzrtmlRwv6SB32AHe5VG64Uu7/SWTaPKfAKSvOs8egRlfEPpimbpZ98WJ5iTZ6D20jEC sSnw== 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 i9si7974695otk.101.2020.03.31.03.55.47; Tue, 31 Mar 2020 03:55:59 -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 S1731001AbgCaKyA (ORCPT + 99 others); Tue, 31 Mar 2020 06:54:00 -0400 Received: from esa4.mentor.iphmx.com ([68.232.137.252]:43597 "EHLO esa4.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730442AbgCaKx6 (ORCPT ); Tue, 31 Mar 2020 06:53:58 -0400 IronPort-SDR: 7UFbKBYjs9UC4mGHRIwjuoCP+/tDSYVmeVkNCHuiFSxJqrf3sS+n4v16/KDWpLuBGou+l8Ljzh eaBhKIK9IwytNpm0UHv3V6rhqRJhlNY1zBR5PTiLmRoGpPuL6TrsaBZFKFtCjcMQWZZt1FnSnN muLzqmF0ahBwKUxY5KljdXAi/vaAdWD7xWXd9SptBl6NU0z7SovrEgRYSLANiPIF2/hTcwNhDE EdcwUFsedSGFu1BC3ucroc8B4AjfeCUpOBcxVmlwYjwOP3VnZOzh2qV4Ib0R7/yurwg/Miuvqo +Ig= X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="47330848" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 31 Mar 2020 02:53:57 -0800 IronPort-SDR: Pu2HhLCygRrU10jR/0iFFLx1jJcP0aD+lrJdMYzqzwbzkWqRfRoF3BqdlPO/+IWyF5nh3LpRFq 1SCIqPh7SyB5MuUL+1MQ5AC7UxbvY46cEX2w53X6qEJ+R51DvbUl+GgRzh5UuMqOhWLxLOGDHi q2/kTnnCjWwjap6/Q2NBubGBWZ+mNhfoGsLYC82GUMjjEVd6MIY6lmVegtEegMrkNX2Lp4lQvK w/9+lq0pYvPaQr2WMYornqI+QasJOek8tVkoZSVTQVVS681+kHmBZhLgFCL3v8i+SkF1cNz5oL zmk= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v10 48/55] Input: Atmel: Improve error handling in mxt_initialize_input_device() Date: Tue, 31 Mar 2020 03:50:44 -0700 Message-ID: <20200331105051.58896-49-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200331105051.58896-1-jiada_wang@mentor.com> References: <20200331105051.58896-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