Skip to contentSkip to conversation

extcon: Fix wrong index in max8997_extcon_cable[]

PATCH In review Axel Lin 2 participants 2 messages Jun 16, 2012 External connector subsystem (extcon)

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 extcon: Fix wrong index in max8997_extcon_cable[]

Currently, the index of "Dock-desk" and "Dock-card" are the same. Thus the latter one overrides the first one.
Then we have problem when calling extcon_find_cable_index() because edev->supported_cable[7] only matches "Dock-card".

---
 drivers/extcon/extcon-max8997.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/extcon/extcon-max8997.c +2 -2
index 23416e4..5ecf176 100644
@@ -116,8 +116,8 @@ const char *max8997_extcon_cable[] = {
 	[5] = "Charge-downstream",
 	[6] = "MHL",
 	[7] = "Dock-desk",
-	[7] = "Dock-card",
-	[8] = "JIG",
+	[8] = "Dock-card",
+	[9] = "JIG",
 
 	NULL,
 };
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw

Nice catch!

Quoted 37 lines · Axel Lin

Currently, the index of "Dock-desk" and "Dock-card" are the same. Thus the latter one overrides the first one.
Then we have problem when calling extcon_find_cable_index() because edev->supported_cable[7] only matches "Dock-card".

---
 drivers/extcon/extcon-max8997.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/extcon/extcon-max8997.c +2 -3
index 23416e4..5ecf176 100644
@@ -116,8 +116,8 @@ const char *max8997_extcon_cable[] = {
 	[5] = "Charge-downstream",
 	[6] = "MHL",
 	[7] = "Dock-desk",
-	[7] = "Dock-card",
-	[8] = "JIG",
+	[8] = "Dock-card",
+	[9] = "JIG",
 
 	NULL,
 };
--

1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/