From patchwork Wed Mar 25 13:33:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 208018 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F449C54FD0 for ; Wed, 25 Mar 2020 13:36:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6F6DF2077D for ; Wed, 25 Mar 2020 13:36:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727316AbgCYNgq (ORCPT ); Wed, 25 Mar 2020 09:36:46 -0400 Received: from esa3.mentor.iphmx.com ([68.232.137.180]:53226 "EHLO esa3.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727656AbgCYNgK (ORCPT ); Wed, 25 Mar 2020 09:36:10 -0400 IronPort-SDR: RZ0w/qKXn0vF/UW12Dyd/e6+O0Qsc3bGjij9LLQ7Mu1Dpw6bgGVCDgur9qhIGRdtKMT/5L+ulb jADv18A6QvJtx8MSOvAx8jdDsgctx3ZOzNM9S/UeiGAoKYvWgZkOTHzN9Ns/q3uIIZOAMTGyGd 2n2oRibB9yD2PBNF5paEVAytJEWC/La/rNsG7hNh9xcTtKL0ljTdaO6DzcB2WG7Nxxm2xPqAjD uwIKOoGwaBFy5tfjlJc1VczDHcHhN/LptwDZL7DHvDPfcbh4he0/Rtso9TOooUOQUYKoFeFJ+u 6ts= X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="47099765" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 25 Mar 2020 05:36:04 -0800 IronPort-SDR: ICFDlk+3X/KxgUMcPk9uzWIT7VFtkzczqGXU9VV4R8ntE3yN0AsJThCzcEjjhNcEseQUJP/HsS 9MMBA7teWTHST+AIq9o9oOffmvUvXjTwjyb7j/Vb2DYQzRjaqrdywz8irdVn4ZtSoJH3KCokdU NF5CW4CB9GaYD48mK1J91Px+uxM6eF1julZO5AWlpIajmI4Wdc5SGWXCsZEv3D/Whq3R8xYY/J M7gpLtrmOQ4KD8W0ljZVosnDZew/VH1S6a9w4Uhg2Jz+Eia2HKCC+YsLBNQgB+RYZwtSr+Sv+B Rkk= From: Jiada Wang To: , , , , , CC: , , , , Subject: [PATCH v9 36/55] Input: atmel_mxt_ts - eliminate data->raw_info_block Date: Wed, 25 Mar 2020 06:33:15 -0700 Message-ID: <20200325133334.19346-37-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 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Dynamically allocated in mxt_read_info_block() buffer buf is assigned both to data->info and data->raw_info_block, having both data->info and data->raw_info_block is redundant and confusing. This patch eliminates data->raw_info_block. Signed-off-by: Jiada Wang Signed-off-by: George G. Davis Signed-off-by: Vladimir Zapolskiy --- drivers/input/touchscreen/atmel_mxt_ts.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 9476326596d9..36a87d9b9c83 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -323,7 +323,6 @@ struct mxt_data { char phys[64]; /* device physical location */ struct mxt_object *object_table; struct mxt_info *info; - void *raw_info_block; unsigned int irq; unsigned int max_x; unsigned int max_y; @@ -2067,9 +2066,8 @@ static void mxt_free_object_table(struct mxt_data *data) v4l2_device_unregister(&data->dbg.v4l2); #endif data->object_table = NULL; + kfree(data->info); data->info = NULL; - kfree(data->raw_info_block); - data->raw_info_block = NULL; kfree(data->msg_buf); data->msg_buf = NULL; data->T5_address = 0; @@ -2238,7 +2236,7 @@ static int mxt_read_info_block(struct mxt_data *data) u8 *crc_ptr; /* If info block already allocated, free it */ - if (data->raw_info_block) + if (data->info) mxt_free_object_table(data); /* Read 7-byte ID information block starting at address 0 */ @@ -2289,7 +2287,6 @@ static int mxt_read_info_block(struct mxt_data *data) goto err_free_mem; } - data->raw_info_block = id_buf; data->info = (struct mxt_info *)id_buf; dev_info(&client->dev,