From patchwork Thu May 23 08:56:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Keeping X-Patchwork-Id: 13671510 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2105.outbound.protection.outlook.com [40.107.220.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85D3913CA99; Thu, 23 May 2024 08:56:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.105 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716454600; cv=fail; b=p7z6gdOBnpSdeus1XgY81TaY+Zct3A5O1Q3PFqs9VmMc0b6wVIGGYuQ9hfnwtUkHMdpJx+xO3KcEK6o/4eT8u2bhBg6HjMLRyJvrZqHdNmd3J3cUwY1CrKPiDGl9LG5Liw2JI6/38peGm00+Ifq/8IEnjbZwdOCjglO+q2Oruhg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716454600; c=relaxed/simple; bh=6NoEiCKXl2n8i9VmUqHFLWQm/IK6VPS65YLem2Yo1HU=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=MUk5agBKYPnSFhWbNhpQBdFdOo56A3MxbGbbJs2i0MZ8y0xzfT5N/ZJ17bf/yg6X/Pm6H9y+LCEPC0SA2uALFrXkSiQlYtEOvpJVttHtXDKh2ult1icbPYTtRuEUfgKfjLrAMldE69VeAynA40EWjtRQcjAWYGJjGk2LNKBStt4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inmusicbrands.com; spf=pass smtp.mailfrom=inmusicbrands.com; dkim=pass (1024-bit key) header.d=inmusicbrands.com header.i=@inmusicbrands.com header.b=GQUt3ELU; arc=fail smtp.client-ip=40.107.220.105 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=inmusicbrands.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=inmusicbrands.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=inmusicbrands.com header.i=@inmusicbrands.com header.b="GQUt3ELU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VsTqR08eiIpJrAoUUZuhVEblAJ5OXINZPqffdJhlfemi5iOR1dOuoY0on+zpvuRh7qew27nbqt0DuwdlxH9+8H7pBuwN0V8mc7LqN/RKojIxn+YTSr8z1rZbe3tPowTGOxztFXmbVtk89H7YfvGsk/lk7WVRHzESZN7FvTorauH8SwsDjcOtmMK5fBSreY6zYQBYNEPjJrLw5AdoMfBv3huRVCIZutlcSXAqazw5o38yC73bAb03mEFjzgIHXGInLmkCr83x8tYyqKxyzmmcF9DCv1TZYx7+mFYdnq5lIITGSa7WWXB8mVG5pqXnAMrd40wmruVQGJ0Gm3xE0CYwjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=s6+mxUVCQOxt/GsFdSYQfTdrBO5aBxBFybaV/+ATyYc=; b=VHjqOOS264IjocYG1st3ClgVFqWNDnNq/p8neERvXcQWRPxnBsgOcpmDDUskoXfVvYjV1QPdsqxH/RMB6i/ZSO/Wjsd6MnVAEQ+xIPg4PdnkJe587Gags2OdzhAtS45YmKLS5hOsJSA7VdDyOJRQkEMGbebjcVPoeinlsZ/SX3O2HNiLwSaSmoczVUCiaUz4mkCugqAbjNOD4zmkpQ4B9KKgT3Maf+AQEus35ipIPZgKMbdY9TtqFTOCDfwxNIngh1NHL3cPzSJK0lTBudW/LCxV3/vkND71MfG4vLGqXMd1EZ9ZSZ0liC/i6drDAr6YSy2ZzF5GU3qXTRWtcigOsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=inmusicbrands.com; dmarc=pass action=none header.from=inmusicbrands.com; dkim=pass header.d=inmusicbrands.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inmusicbrands.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s6+mxUVCQOxt/GsFdSYQfTdrBO5aBxBFybaV/+ATyYc=; b=GQUt3ELUSKNh8/DzixAT+RLKMu/OjZiyMj3tAa3kd3uI2CgL/fgKXd/X2CNhtR1j9LNlHMhZ6qAiv8W+Fdgczianucz+hfPe7QYvgF3bdyvzCsEdES1Ig2Lo8UeN/BTesIM+hNkx7couK8QofimdQFgDhsxPTKQcb3BAWBDRVWU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=inmusicbrands.com; Received: from MW4PR08MB8282.namprd08.prod.outlook.com (2603:10b6:303:1bd::18) by SJ0PR08MB6574.namprd08.prod.outlook.com (2603:10b6:a03:2d1::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.19; Thu, 23 May 2024 08:56:36 +0000 Received: from MW4PR08MB8282.namprd08.prod.outlook.com ([fe80::55b3:31f1:11c0:4401]) by MW4PR08MB8282.namprd08.prod.outlook.com ([fe80::55b3:31f1:11c0:4401%5]) with mapi id 15.20.7587.035; Thu, 23 May 2024 08:56:35 +0000 From: John Keeping To: linux-input@vger.kernel.org Cc: John Keeping , Dmitry Torokhov , linux-kernel@vger.kernel.org Subject: [PATCH v2] Input: ili210x - fix ili251x_read_touch_data() return value Date: Thu, 23 May 2024 09:56:24 +0100 Message-ID: <20240523085624.2295988-1-jkeeping@inmusicbrands.com> X-Mailer: git-send-email 2.45.1 X-ClientProxiedBy: LO2P265CA0234.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:b::30) To MW4PR08MB8282.namprd08.prod.outlook.com (2603:10b6:303:1bd::18) Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR08MB8282:EE_|SJ0PR08MB6574:EE_ X-MS-Office365-Filtering-Correlation-Id: fbeff189-f657-448a-a7cf-08dc7b064025 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: 1YKOJY0896vOFs1KTqXhIT//EGacENPUmWhOwVM36rHhQhFzF3HSxcRmEjW/iBL2LWwftpN/x8uCuq/KFIVBkAY35/aA8Jt32c/WbzskCusMaqsuohOh+dAmbNe2FrOjwYOBI2jgCDGB/aWbDpWQlNl9QnK1c69SckO6e6yDgJH5Oc65iXyDZuy8p9U6dcYykyoDx19Crs8oE/lsYv+Of7ggWOyh17QowgKKOA2VVXoTJWPWO/169+wNGP59O8rIggu4RZOBr9KqwG3Cc7C/pL2PWyYUdVSixL5x2Y7g3yr6WD5RkKpg/J4g0VAwNg6nGDhA7xZp1MXBhNttHiuvhOCcB6eWMXm79VARrAwZ43hlnGRSTSTMrZC2D3PWDCyGWfYPyoolAZF4Ig4JNMfi1Fmc77zwrFzMZD47AR0UI9EPzDMCvdgz7DlVFztiWOgB5mXHQ4jgUjsHFDwDCZ3+dfgwmkPSTUa9IN0AFgrQqp5DG8b3S72704xTtuslnJl2pfq/CMZYOYRwnlKEmKuR+4Udtc2EiS4hGG9xF3ydypbx84EYqb03wRQ4S6mg7R7F0y98S1oTcA5hEvIRmvadugs5EhYX+Li5iT4G3Rmqvz98Ia3m+ZXKlN5Kta2qgg9uXVpDxADdfOcrDEbUd8WKX+xoO5QIynPuYmfnAJzM4DrPekVN/9ebf+XESR9EmM0m3DD84e24JqOXE9VNsg8jxK98e/kwaEnCuPl6i9NqHNnK8Th37FMFdzmo40YZ7MezwezANMa+FroFwx7+fksSxb9jweF2fyPe13I2cvpSBwoRxzvRbCuzvY5DOHoB6X+zvvesP7Z30Fn+jy4ZKymRd/hwVsia3r9IhM/3NHpWOzb4nBdEJXk9V6XIPuQkQABus/6vfQMzIbaS8FcmSRVLvmGU+4qOAkrHsFpkRXVKz1bVTA1CjE5XYZ59xTYZsENRXN41BZmiid211VIsd9fw82gAoAr8/OVdla7u36qp/5u1CqH+QrfhEL1n9OWBDe90mblJ/oFzUObmvT5irsxCdxhRqWtsJdmiYkqSZdGanIMmwlvvuDOtJNS5rDm98wwhnT1tFDe2qk5fFjk+HEJFIx+DEc3rDB5VO/ZKcllSZkU39S9W44JmmXz2DsDvXKYZMZsGovCJAueTpyPq9ARw+H8WZuyWUCP7o4AtEWSytsERuQ4nvrZB758m0sZF3OtmyR+aei5yp80HyLEdwE6TPvZyJO7BtLNJR601DN+THIroMaaIhf/wnSInPzBB4jWU08r8LwxASLuM6NhTfoW0Uhtm1Jc7cvy430kyrhzASQtRRhjL2FNWdaXLh+KzSfZfXM2WQZ6Cf05A8YCisrimdA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR08MB8282.namprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CtlTq+gjg1n1c1YVel/p9chMwDAyhij1Q9M92zbZkuAKl7v2MpV1/nTcavbdzvaCFUvsl2eVUt2Dgdev5x9cBulyDQ143kud+VrYllN2t8XrexqVzseM0zURh93IfAoHHKvi4E3QS18K7eFwA4yX2+/GeWcXNItYz8rH7X7Ww7GPW/ry83aw9HTTp0Q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eu1EKlA3RsnyX+IgX1HlTMKeXPdpZ8ZtDmfylQEFss2j23Cgb+Tgwe5t+zDwqQKcYniD8IQqc5FyxV1CLQttkxYm2pWYN2PXir5VSWFKKlQaMQuLBa99jF2hJ5cqauyl0iHlWxCDtbqgE9f41MTC8DtiOaXP6AC44gc/9AKTSWCnERYycUmTBANuX3ITnDvS68NY4GPtOwxe1DPZDF57yyZ5gYzsffPHSqs9RebiNZ9tx/kDXXWAe1azggp2w0U9n17eNwwWuDd7vpym/06X0WRatoB5CY3c1dCgxfEl31kIqG8hPv+CoN0R6GvLBnB9EhtLQeC5+1HiF5h9RxtstpA7gzgQ== X-OriginatorOrg: inmusicbrands.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbeff189-f657-448a-a7cf-08dc7b064025 X-MS-Exchange-CrossTenant-AuthSource: MW4PR08MB8282.namprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2024 08:56:35.8810 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 24507e43-fb7c-4b60-ab03-f78fafaf0a65 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Kc+ZxeAJa/N4hl3qvxZQZArDVXRpiQPVcZzObHrl0RnjTC8+il2sCItgF36MzcK0xgBvgQcVv+9S5jbzZmFGAYuU+U8Nj2kP7rcLybU9zYo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR08MB6574 The caller of this function treats all non-zero values as an error, so the return value of i2c_master_recv() cannot be returned directly. This fixes touch reporting when there are more than 6 active touches. Fixes: ef536abd3afd1 ("Input: ili210x - define and use chip operations structure") Signed-off-by: John Keeping --- Changes since v1: - Simplify change to avoid introducing a new variable - Add Fixes tag drivers/input/touchscreen/ili210x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c index 31ffdc2a93f35..79bdb2b109496 100644 --- a/drivers/input/touchscreen/ili210x.c +++ b/drivers/input/touchscreen/ili210x.c @@ -261,8 +261,8 @@ static int ili251x_read_touch_data(struct i2c_client *client, u8 *data) if (!error && data[0] == 2) { error = i2c_master_recv(client, data + ILI251X_DATA_SIZE1, ILI251X_DATA_SIZE2); - if (error >= 0 && error != ILI251X_DATA_SIZE2) - error = -EIO; + if (error >= 0) + error = error == ILI251X_DATA_SIZE2 ? 0 : -EIO; } return error;