Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp748180ybg; Thu, 19 Mar 2020 08:05:39 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvVP2e/TKWixq7Al/+HAAZcFY1Zrfw+1n9ftUNe/kQ/fEccKujUMWYdc1H/nw/Lo3iHuwqV X-Received: by 2002:aca:1108:: with SMTP id 8mr2663430oir.93.1584630338917; Thu, 19 Mar 2020 08:05:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584630338; cv=none; d=google.com; s=arc-20160816; b=BEwWfcsB3q31L8lG/jJGcnZ2wfIIEGmbfz90LRl8wE0agTmW0TKuX9N2QbVCUlooTm CBc+oNVOMBzj20TK0TRgBJPhgutiStUTO046RfST633bR1TOb4xbKOOubYFWtJPWAUOE O3GkU4spGGlLWj3JnwHNWe4++1pcihAASw4Z8ksKQ7a7EzWyojMDlqJ7lwEefG6Y61uC PnaVEDTfhQvzg7ExpBGsu5Hi9gDo8ve6ENmglxZk6TbKpXrlW9g8ikLPK1xOJAK5nTtV hfzWtTjlyJM/7Kjd4Rfi0+4mu05xOImIME+5Kt200YjafOcMS/GDUbv14aWjnFdKR+vl cjMA== 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=19i1Oez9rAMu8yxSRPCgkWY+R7If/zN1DUkkRf98smE=; b=TKMGiNPmvLn5gIjH9jwWyMjMHDWDPXYEVdUIvHTds21Yg/pJHFb+6yvWE4BM4eBBPa 9wYZ5tKfPgRhw5AS4LSx8K5ZwSjvaILz7ioT2TkwnpKR4n9BZdmUHpdLW4sqThxVpFRo GzBIz9e/emykrMWCI8QaRTtcbsPpXEK2DflUkHU/WmyG12+QSjHn7OQbAx3GJtwJwXg3 A613giPQus8SBLHUGQ9p2a6/J+BTtT85+aU8ZoPWovX+g8QLI+TMWnkPk3UKElF1+Aix VfhPz2vFpTx8SY+iTe92a7yvgBcHqZ3u+wkjPXnHfN4Mur8DvwpK+2G2cOL8J9IkP+XO nS2w== 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 g206si1147555oib.17.2020.03.19.08.05.09; Thu, 19 Mar 2020 08:05:38 -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 S1728472AbgCSPDV (ORCPT + 99 others); Thu, 19 Mar 2020 11:03:21 -0400 Received: from esa3.mentor.iphmx.com ([68.232.137.180]:32379 "EHLO esa3.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728435AbgCSPDT (ORCPT ); Thu, 19 Mar 2020 11:03:19 -0400 IronPort-SDR: pnEWoouqL2/muF07ofLVYUyUy/HQD2rYos/wwYYyrndkTUgTbtuXEzf3b9yRBrSktuokXqiVg5 qIt4KkVYLTSeH+5ZkVMKURu6W2Eubs8SoD6beJirL/wjCgccRJoVQ/ai3n4mB74BaE8njYSvQN NH9jYB+zKNFvvzgfSCqTs+s9/jHYZ++qbOS7Hm5W8Pgi9DyR2FD4uQtEBoh1AP46hIou5nFWXB lWVR8vYNrJL8ztRpjg8g38N4fo8/lLhamOE9DQo2QOImh1TdWISsxPpvEoH0sCPY5wwkQjuxsv oSU= X-IronPort-AV: E=Sophos;i="5.70,572,1574150400"; d="scan'208";a="46891070" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 19 Mar 2020 07:03:18 -0800 IronPort-SDR: lESiGKohi5ReR/Powo1gz/WoWbBgQye/3KGJ/7wruXSWk6WRigfNw3CAeaW67MWmNF2aQQ1xQB y/85Sj0dYMPz8OnFyZs9S1UDw+eQtjIKThNmseDfy6DdO4JsEkyjRl3W2RpUlF9jutWawaQzjI p0fE348BY5FK6gN5N9pI2Q+N6uo2Dv7WTnvTF/wZUK5NqEodlr0l2PzBeNn7QCbPvK+bILCLri aYY1mDdiES5NHL+BKqixwOR80kT4wOWbStRlQ7FWdLXUutemTvYAdEyJEvSso5+STfiGQWb7G3 P64= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v8 45/52] Input: Atmel: Improve error handling in mxt_initialize_input_device() Date: Thu, 19 Mar 2020 08:00:09 -0700 Message-ID: <20200319150016.61398-46-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200319150016.61398-1-jiada_wang@mentor.com> References: <20200319150016.61398-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 edab65337061..994232c43554 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