[PATCH v2 2/2] Input: exc3000 - Drop enum eeti_dev_id and split exc3000_info[]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Drop enum eeti_dev_id and split the array exc3000_info[] as individual
variables, and make lines shorter by referring to e.g. &exc3000_info
instead of &exc3000_info[EETI_EXC3000].

Suggested-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
---
v2:
 * New patch.
---
 drivers/input/touchscreen/exc3000.c | 42 +++++++++++++----------------
 1 file changed, 18 insertions(+), 24 deletions(-)

diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c
index 8b65b4e2aa50..b124a64f8164 100644
--- a/drivers/input/touchscreen/exc3000.c
+++ b/drivers/input/touchscreen/exc3000.c
@@ -47,25 +47,19 @@ struct eeti_dev_info {
 	int max_xy;
 };
 
-enum eeti_dev_id {
-	EETI_EXC3000,
-	EETI_EXC80H60,
-	EETI_EXC80H84,
+static const struct eeti_dev_info exc3000_info = {
+	.name = "EETI EXC3000 Touch Screen",
+	.max_xy = SZ_4K - 1
 };
 
-static struct eeti_dev_info exc3000_info[] = {
-	[EETI_EXC3000] = {
-		.name = "EETI EXC3000 Touch Screen",
-		.max_xy = SZ_4K - 1,
-	},
-	[EETI_EXC80H60] = {
-		.name = "EETI EXC80H60 Touch Screen",
-		.max_xy = SZ_16K - 1,
-	},
-	[EETI_EXC80H84] = {
-		.name = "EETI EXC80H84 Touch Screen",
-		.max_xy = SZ_16K - 1,
-	},
+static const struct eeti_dev_info exc80h60_info = {
+	.name = "EETI EXC80H60 Touch Screen",
+	.max_xy = SZ_16K - 1
+};
+
+static const struct eeti_dev_info exc80h84_info = {
+	.name = "EETI EXC80H84 Touch Screen",
+	.max_xy = SZ_16K - 1
 };
 
 struct exc3000_data {
@@ -441,18 +435,18 @@ static int exc3000_probe(struct i2c_client *client)
 }
 
 static const struct i2c_device_id exc3000_id[] = {
-	{ "exc3000", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC3000] },
-	{ "exc80h60", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H60] },
-	{ "exc80h84", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H84] },
+	{ "exc3000", .driver_data = (kernel_ulong_t)&exc3000_info },
+	{ "exc80h60", .driver_data = (kernel_ulong_t)&exc80h60_info },
+	{ "exc80h84", .driver_data = (kernel_ulong_t)&exc80h84_info },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, exc3000_id);
 
 #ifdef CONFIG_OF
 static const struct of_device_id exc3000_of_match[] = {
-	{ .compatible = "eeti,exc3000", .data = &exc3000_info[EETI_EXC3000] },
-	{ .compatible = "eeti,exc80h60", .data = &exc3000_info[EETI_EXC80H60] },
-	{ .compatible = "eeti,exc80h84", .data = &exc3000_info[EETI_EXC80H84] },
+	{ .compatible = "eeti,exc3000", .data = &exc3000_info },
+	{ .compatible = "eeti,exc80h60", .data = &exc80h60_info },
+	{ .compatible = "eeti,exc80h84", .data = &exc80h84_info },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, exc3000_of_match);
@@ -460,7 +454,7 @@ MODULE_DEVICE_TABLE(of, exc3000_of_match);
 
 #ifdef CONFIG_ACPI
 static const struct acpi_device_id exc3000_acpi_match[] = {
-	{ "EGA00001", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H60] },
+	{ "EGA00001", .driver_data = (kernel_ulong_t)&exc80h60_info },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, exc3000_acpi_match);
-- 
2.25.1




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux