Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

extcon: cht-wc: Return from default case to avoid warnings

When we have first case to fall through it's not enough to put
single comment there to satisfy compiler. Instead of doing that,
return fall back value directly from default case.

This to avoid following warnings:

drivers/extcon/extcon-intel-cht-wc.c: In function ‘cht_wc_extcon_get_charger’:
include/linux/device.h:1420:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
_dev_warn(dev, dev_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/extcon/extcon-intel-cht-wc.c:148:3: note: in expansion of macro ‘dev_warn’
dev_warn(ext->dev,
^~~~~~~~
drivers/extcon/extcon-intel-cht-wc.c:152:2: note: here
case CHT_WC_USBSRC_TYPE_SDP:
^~~~

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Andy Shevchenko and committed by
Chanwoo Choi
962341b5 69f75a4f

+1 -1
+1 -1
drivers/extcon/extcon-intel-cht-wc.c
··· 156 156 dev_warn(ext->dev, 157 157 "Unhandled charger type %d, defaulting to SDP\n", 158 158 ret); 159 - /* Fall through, treat as SDP */ 159 + return EXTCON_CHG_USB_SDP; 160 160 case CHT_WC_USBSRC_TYPE_SDP: 161 161 case CHT_WC_USBSRC_TYPE_FLOAT_DP_DN: 162 162 case CHT_WC_USBSRC_TYPE_OTHER: