Skip to content

Commit ca4b43c

Browse files
Peter Chengregkh
authored andcommitted
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>
1 parent 3e99862 commit ca4b43c

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

‎include/uapi/linux/usb/charger.h‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414
* ACA (Accessory Charger Adapters)
1515
*/
1616
enum usb_charger_type {
17-
UNKNOWN_TYPE,
18-
SDP_TYPE,
19-
DCP_TYPE,
20-
CDP_TYPE,
21-
ACA_TYPE,
17+
UNKNOWN_TYPE = 0,
18+
SDP_TYPE = 1,
19+
DCP_TYPE = 2,
20+
CDP_TYPE = 3,
21+
ACA_TYPE = 4,
2222
};
2323

2424
/* USB charger state */
2525
enum usb_charger_state {
26-
USB_CHARGER_DEFAULT,
27-
USB_CHARGER_PRESENT,
28-
USB_CHARGER_ABSENT,
26+
USB_CHARGER_DEFAULT = 0,
27+
USB_CHARGER_PRESENT = 1,
28+
USB_CHARGER_ABSENT = 2,
2929
};
3030

3131
#endif /* _UAPI__LINUX_USB_CHARGER_H */

0 commit comments

Comments
 (0)