Skip to contentSkip to conversation

extcon: fix phy-tahvo driver for extcon API change

PATCH In review Arnd Bergmann 2 participants 2 messages May 21, 2015 – May 22, 2015 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 extcon: fix phy-tahvo driver for extcon API change

Today, the API for the extcon drivers was changed, along with all drivers in drivers/extcon. However, one extcon driver instead lives in drivers/usb/phy/ and did not get change.

Gcc warns about the now incorrect API usage:

drivers/usb/phy/phy-tahvo.c: In function 'tahvo_usb_probe':
drivers/usb/phy/phy-tahvo.c:368:29: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
tu->extcon.supported_cable = tahvo_cable;

This changes the API in the same way as the other drivers.

Fixes 17cd440c9acc ("extcon: Update the prototype of extcon_register_notifier() with enum extcon")

---
As the API change is only present in the extcon tree, this patch should get merged there as well, not in the usb-phy tree.

If possible, please fold into the original commit.

drivers/usb/phy/phy-tahvo.c +5 -4
index 845f658276b1..1d1bb9ad8ccf 100644
@@ -60,10 +60,11 @@ struct tahvo_usb {
 	struct extcon_dev	extcon;
 };
 
-static const char *tahvo_cable[] = {
-	"USB-HOST",
-	"USB",
-	NULL,
+static const enum extcon tahvo_cable[] = {
+	EXTCON_USB,
+	EXTCON_USB_HOST,
+
+	EXTCON_NONE,
 };
 
 static ssize_t vbus_state_show(struct device *device,
#1 lore raw

Dear Felipe,

If you review this patch, I'll apply it on extcon tree.

Best Regards,
Chanwoo Choi

Quoted 42 lines · Arnd Bergmann

Today, the API for the extcon drivers was changed, along with all drivers in drivers/extcon. However, one extcon driver instead lives in drivers/usb/phy/ and did not get change.

Gcc warns about the now incorrect API usage:

drivers/usb/phy/phy-tahvo.c: In function 'tahvo_usb_probe':
drivers/usb/phy/phy-tahvo.c:368:29: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
tu->extcon.supported_cable = tahvo_cable;

This changes the API in the same way as the other drivers.

Fixes 17cd440c9acc ("extcon: Update the prototype of extcon_register_notifier() with enum extcon")

---
As the API change is only present in the extcon tree, this patch should get merged there as well, not in the usb-phy tree.

If possible, please fold into the original commit.

drivers/usb/phy/phy-tahvo.c +5 -4
index 845f658276b1..1d1bb9ad8ccf 100644
@@ -60,10 +60,11 @@ struct tahvo_usb {
 	struct extcon_dev	extcon;
 };
 
-static const char *tahvo_cable[] = {
-	"USB-HOST",
-	"USB",
-	NULL,
+static const enum extcon tahvo_cable[] = {
+	EXTCON_USB,
+	EXTCON_USB_HOST,
+
+	EXTCON_NONE,
 };
 
 static ssize_t vbus_state_show(struct device *device,