From mboxrd@z Thu Jan 1 00:00:00 1970 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=unavailable 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 F4171CA9EC2 for ; Tue, 29 Oct 2019 07:22:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D024920663 for ; Tue, 29 Oct 2019 07:22:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726527AbfJ2HWE (ORCPT ); Tue, 29 Oct 2019 03:22:04 -0400 Received: from esa1.mentor.iphmx.com ([68.232.129.153]:7825 "EHLO esa1.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbfJ2HWD (ORCPT ); Tue, 29 Oct 2019 03:22:03 -0400 IronPort-SDR: ntVK3UF8nwIjZJNlz9SGjIluOlO+PbFf0vUSuohJoLsIsr6bTdD1sz27Q+arVxTtmo49NESNJX ZBOe9zLG+AESgfm7pxzASQTX5JUiqDizTOZqGa7keBQ+6seGkapn6plDlbCeUMjx64uy+VJALW 00wrK6/2twDLncCBiC3NguvBz1AUBNmlkWt2LTae5vXQ1ng64IatbA1jMMFxuiAYqZkPkaLaub SoBPA1sa3+7FC2T86okJJKAqE3SSksyF854+yJxAie7rJuzS3Z+vH2VMXtISJF1zWGLZPmrGgQ 2Ok= X-IronPort-AV: E=Sophos;i="5.68,243,1569312000"; d="scan'208";a="44509417" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 28 Oct 2019 23:22:03 -0800 IronPort-SDR: yQF09jRNpDN2Wq1WRpAobXC1jKl4Ia/mWCo+gWx1AnIBchvscEY++QliQR1R07XoHjg4gYvVBz Spvna0+LOyV9BN2aRPBD+GpiMLQ+qbKYBbcX40L//l4Ed07dEw5o4AtiOXKLw9jtpYGgLNgL1b cU0HoYVekZmQysenFY++F2zlLCmKk5pUkzI6zfxKVod7bINEaP8Ds50Gpq97YY4iq0Jzkf6ooN 8WXzLzBcQ5G5X6W+xnWO20s6kcq04eM86AEsJfCk2mH9WAX+729btYtyyjkugzQ31appuNNjd+ 55A= From: Jiada Wang To: , , , CC: , , , , Subject: [PATCH v4 30/48] Input: atmel_mxt_ts - eliminate data->raw_info_block Date: Tue, 29 Oct 2019 16:19:52 +0900 Message-ID: <20191029072010.8492-31-jiada_wang@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191029072010.8492-1-jiada_wang@mentor.com> References: <20191029072010.8492-1-jiada_wang@mentor.com> MIME-Version: 1.0 Content-Type: text/plain 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 286d5ad6077a..2eb29e9b67d8 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; @@ -2070,9 +2069,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; @@ -2241,7 +2239,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 */ @@ -2292,7 +2290,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, -- 2.17.1