Commit 504febc3 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

Revert "[media] lmed04: add missing breaks"

According with Malcolm, the missing breaks are intentional.

So, let's revert commit d442b15f,
add some comments to document it and fix the two smatch warnings:

drivers/media/usb/dvb-usb-v2/lmedm04.c:828 lme_firmware_switch() warn: missing break? reassigning 'st->dvb_usb_lme2510_firmware'
drivers/media/usb/dvb-usb-v2/lmedm04.c:850 lme_firmware_switch() warn: missing break? reassigning 'st->dvb_usb_lme2510_firmware'

using a different strategy to avoid reassign values to
st->dvb_usb_lme2510_firmware.
Acked-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 6b281d83
...@@ -817,21 +817,22 @@ static const char *lme_firmware_switch(struct dvb_usb_device *d, int cold) ...@@ -817,21 +817,22 @@ static const char *lme_firmware_switch(struct dvb_usb_device *d, int cold)
case 0x1122: case 0x1122:
switch (st->dvb_usb_lme2510_firmware) { switch (st->dvb_usb_lme2510_firmware) {
default: default:
st->dvb_usb_lme2510_firmware = TUNER_S0194;
case TUNER_S0194: case TUNER_S0194:
fw_lme = fw_s0194; fw_lme = fw_s0194;
ret = request_firmware(&fw, fw_lme, &udev->dev); ret = request_firmware(&fw, fw_lme, &udev->dev);
if (ret == 0) { if (ret == 0) {
st->dvb_usb_lme2510_firmware = TUNER_S0194;
cold = 0; cold = 0;
break; break;
} }
st->dvb_usb_lme2510_firmware = TUNER_LG; /* fall through */
break;
case TUNER_LG: case TUNER_LG:
fw_lme = fw_lg; fw_lme = fw_lg;
ret = request_firmware(&fw, fw_lme, &udev->dev); ret = request_firmware(&fw, fw_lme, &udev->dev);
if (ret == 0) if (ret == 0) {
st->dvb_usb_lme2510_firmware = TUNER_LG;
break; break;
}
st->dvb_usb_lme2510_firmware = TUNER_DEFAULT; st->dvb_usb_lme2510_firmware = TUNER_DEFAULT;
break; break;
} }
...@@ -839,27 +840,30 @@ static const char *lme_firmware_switch(struct dvb_usb_device *d, int cold) ...@@ -839,27 +840,30 @@ static const char *lme_firmware_switch(struct dvb_usb_device *d, int cold)
case 0x1120: case 0x1120:
switch (st->dvb_usb_lme2510_firmware) { switch (st->dvb_usb_lme2510_firmware) {
default: default:
st->dvb_usb_lme2510_firmware = TUNER_S7395;
case TUNER_S7395: case TUNER_S7395:
fw_lme = fw_c_s7395; fw_lme = fw_c_s7395;
ret = request_firmware(&fw, fw_lme, &udev->dev); ret = request_firmware(&fw, fw_lme, &udev->dev);
if (ret == 0) { if (ret == 0) {
st->dvb_usb_lme2510_firmware = TUNER_S7395;
cold = 0; cold = 0;
break; break;
} }
st->dvb_usb_lme2510_firmware = TUNER_LG; /* fall through */
break;
case TUNER_LG: case TUNER_LG:
fw_lme = fw_c_lg; fw_lme = fw_c_lg;
ret = request_firmware(&fw, fw_lme, &udev->dev); ret = request_firmware(&fw, fw_lme, &udev->dev);
if (ret == 0) if (ret == 0) {
st->dvb_usb_lme2510_firmware = TUNER_LG;
break; break;
st->dvb_usb_lme2510_firmware = TUNER_S0194; }
/* fall through */
case TUNER_S0194: case TUNER_S0194:
fw_lme = fw_c_s0194; fw_lme = fw_c_s0194;
ret = request_firmware(&fw, fw_lme, &udev->dev); ret = request_firmware(&fw, fw_lme, &udev->dev);
if (ret == 0) if (ret == 0) {
st->dvb_usb_lme2510_firmware = TUNER_S0194;
break; break;
}
st->dvb_usb_lme2510_firmware = TUNER_DEFAULT; st->dvb_usb_lme2510_firmware = TUNER_DEFAULT;
cold = 0; cold = 0;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment