Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1369230ybj; Thu, 7 May 2020 23:02:49 -0700 (PDT) X-Google-Smtp-Source: APiQypKNkUhpq6zeDHaPLjF21R6yM9Dl00YcuSKDNRwQSqIrhOm3VCeY+0k0nLE14lJPGCvA5aNU X-Received: by 2002:a17:906:3da:: with SMTP id c26mr523076eja.290.1588917769438; Thu, 07 May 2020 23:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588917769; cv=none; d=google.com; s=arc-20160816; b=a9JEldgPSWjA2knr6efjA/E2DGU9KOxYbNeNjX8UFPXaKbr2h/8z7diWxz1+ick/aS 6jMbWWJPkihTze5DRPSSy9rvlD9UOA9kk0KOY7mUt7+TFuzvcpE4CPpxaEXdb4F/hMqu j3bkBNpZ9g9mDwyyQwKCWATgzzKLEq2C5dx/Cjp4OzijRRUBP6OLNzWdGvEHCZk0GS/P TEtxswDD34TOHb+yRqaH7Oir5PUTMHNXZlDJwuHmucwU2++JD4fiXqFeINqRI7nDPhlx MLRcdblkYOxNx5/e+O3KGkN2ARG9NjOeWpsiduq2sv+oqYk4DZSNnmQoLQ+2iHmj4fbC Z34g== 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=MYAE23VGHjuQgWJjvQilk7AMljSQ+Gmy6DOBPHJUcSU=; b=Z2dj/Ch3SOSB0D1RTJkDMSwCX+Ku7A894qnEp+ooIv0sHt24IalAnWMoffW8riE9p9 890OCXMFMqMCaLvQLyIpD/iXbIqDZtQp/dzlu8IQfTx/WLzA7A3+KJUZs7Qy0zXLTfE/ f6Sf1MA/aMsJp37RuQfMwpUTTzFO9OpZKcRJ+GkkVORUWuE2T1R5M9Era+m4jmWI+DIL o51b5/Y/8CoggAQwpeW0cpn0IkCmpHtD85/VYu0MVa+LvrrYjyIjOH1v3n2pxB2NaUVM a2iBMBNlopkUt7lDjkHfh6q6LyOFNYJd0tPpo3QwGOzeWU9C2dndbfdiZEldz5GwYZsR NQjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v28si385755edd.176.2020.05.07.23.02.26; Thu, 07 May 2020 23:02:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727072AbgEHGAJ (ORCPT + 99 others); Fri, 8 May 2020 02:00:09 -0400 Received: from esa1.mentor.iphmx.com ([68.232.129.153]:38783 "EHLO esa1.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727121AbgEHGAH (ORCPT ); Fri, 8 May 2020 02:00:07 -0400 IronPort-SDR: wsVfL+JnYvAfl2qW0+bU5+1GcnnkQwfWKg/SJc0DbqfdlC1JOJu6uvSW1oWaXGtY7CIIa+liiv cmOHdzSm0+Ut2sV8Mf37+1/tDrEJ+68yjoOolf46JRRq8hKWi1a3pFnYzMzCdf8ps4j03MbOry I9wI66iaboRu5yTILUGTmh6qyHhuFf5/iN2+D1cUjNi38WNPzJNyAHC0nu/vVEHIe5E1AcZg8t d8m7SY5tNtsrfJFnMS4/Rx3J+K0T1aGRJ52wsYf9DuSzXaNe7VkIJZW/6Jn+6B9vDMuC8/U1Ad jGk= X-IronPort-AV: E=Sophos;i="5.73,366,1583222400"; d="scan'208";a="50670162" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 07 May 2020 22:00:05 -0800 IronPort-SDR: pN5JCXnsKNku0Kd1SHp203+hkKpRUdwysAHuZpEcV5W8OZldcta3DBfZZUTJfuWjB54KoEKlwp RNr6Gt0Ot2BISO3vlhvW3o3tCYTdqRjW40vd4KR3IjP7X2D3J2ZqeSgpx3xX+EyDjFBDwJZ2Gp UA5YJenPPW8bMtCrOzP0UvqMpRhKPYXrqTUh4nmB6up1tQouQJ2JI3zkH5AIbEN3vs4EDORmfM 6AUI+99w3befZ5e55IpFaA2TzbzJCxOd70jZFlOgLM4GlId5bxiuO9/XQc7pue06tSXSiiSekg yJQ= From: Jiada Wang To: , , , , CC: , , , , Subject: [PATCH v11 49/56] Input: Atmel: Improve error handling in mxt_initialize_input_device() Date: Thu, 7 May 2020 22:56:49 -0700 Message-ID: <20200508055656.96389-50-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200508055656.96389-1-jiada_wang@mentor.com> References: <20200508055656.96389-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 83fa2caddeab..92701bf5291f 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -2748,15 +2748,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