usb: charger: assign specific number for enum value

To work properly on every architectures and compilers, the enum value
needs to be specific numbers.

Suggested-by: Greg KH <gregkh@linuxfoundation.org>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Link: https://lore.kernel.org/r/1580537624-10179-1-git-send-email-peter.chen@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Peter Chen 2020-02-01 14:13:44 +08:00 committed by Greg Kroah-Hartman
parent 3e99862c05
commit ca4b43c14c
1 changed files with 8 additions and 8 deletions

View File

@ -14,18 +14,18 @@
* ACA (Accessory Charger Adapters) * ACA (Accessory Charger Adapters)
*/ */
enum usb_charger_type { enum usb_charger_type {
UNKNOWN_TYPE, UNKNOWN_TYPE = 0,
SDP_TYPE, SDP_TYPE = 1,
DCP_TYPE, DCP_TYPE = 2,
CDP_TYPE, CDP_TYPE = 3,
ACA_TYPE, ACA_TYPE = 4,
}; };
/* USB charger state */ /* USB charger state */
enum usb_charger_state { enum usb_charger_state {
USB_CHARGER_DEFAULT, USB_CHARGER_DEFAULT = 0,
USB_CHARGER_PRESENT, USB_CHARGER_PRESENT = 1,
USB_CHARGER_ABSENT, USB_CHARGER_ABSENT = 2,
}; };
#endif /* _UAPI__LINUX_USB_CHARGER_H */ #endif /* _UAPI__LINUX_USB_CHARGER_H */