X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Fextcon%2Fextcon-usb-gpio.c;h=14da94cb57faa58aaa6fb6a5900f3ad8a0912b58;hb=2a9de9c0f08d61fbe3764a21d22d0b72df97d6ae;hp=900744b978fc795f9d5217204db8406ce9555dec;hpb=35eed7a0768886e2f66db3cdbf3faf6435275e6b;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c index 900744b978fc..14da94cb57fa 100644 --- a/drivers/extcon/extcon-usb-gpio.c +++ b/drivers/extcon/extcon-usb-gpio.c @@ -39,18 +39,10 @@ struct usb_extcon_info { struct delayed_work wq_detcable; }; -/* List of detectable cables */ -enum { - EXTCON_CABLE_USB = 0, - EXTCON_CABLE_USB_HOST, - - EXTCON_CABLE_END, -}; - -static const char *usb_extcon_cable[] = { - [EXTCON_CABLE_USB] = "USB", - [EXTCON_CABLE_USB_HOST] = "USB-HOST", - NULL, +static const enum extcon usb_extcon_cable[] = { + EXTCON_USB, + EXTCON_USB_HOST, + EXTCON_NONE, }; static void usb_extcon_detect_cable(struct work_struct *work) @@ -68,24 +60,16 @@ static void usb_extcon_detect_cable(struct work_struct *work) * As we don't have event for USB peripheral cable attached, * we simulate USB peripheral attach here. */ - extcon_set_cable_state(info->edev, - usb_extcon_cable[EXTCON_CABLE_USB_HOST], - false); - extcon_set_cable_state(info->edev, - usb_extcon_cable[EXTCON_CABLE_USB], - true); + extcon_set_cable_state_(info->edev, EXTCON_USB_HOST, false); + extcon_set_cable_state_(info->edev, EXTCON_USB, true); } else { /* * ID = 0 means USB HOST cable attached. * As we don't have event for USB peripheral cable detached, * we simulate USB peripheral detach here. */ - extcon_set_cable_state(info->edev, - usb_extcon_cable[EXTCON_CABLE_USB], - false); - extcon_set_cable_state(info->edev, - usb_extcon_cable[EXTCON_CABLE_USB_HOST], - true); + extcon_set_cable_state_(info->edev, EXTCON_USB, false); + extcon_set_cable_state_(info->edev, EXTCON_USB_HOST, true); } }