[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190816083451.18947-4-jiada_wang@mentor.com>
Date: Fri, 16 Aug 2019 17:34:21 +0900
From: Jiada Wang <jiada_wang@...tor.com>
To: <nick@...anahar.org>, <dmitry.torokhov@...il.com>
CC: <linux-input@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<jiada_wang@...tor.com>, <george_davis@...tor.com>
Subject: [PATCH v1 33/63] Input: atmel_mxt_ts - eliminate data->raw_info_block
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 <jiada_wang@...tor.com>
Signed-off-by: George G. Davis <george_davis@...tor.com>
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@...tor.com>
---
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 e185d10c2cac..248d4b239bf6 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;
@@ -2060,9 +2059,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;
@@ -2231,7 +2229,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 */
@@ -2282,7 +2280,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.19.2
Powered by blists - more mailing lists