Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366623
b: refs/heads/master
c: e584f9d
h: refs/heads/master
i:
  366621: 6b9ff53
  366619: 3004880
  366615: 5c98352
  366607: ee338ea
  366591: 93d68ee
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed Mar 21, 2013
1 parent cceff06 commit d62349f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9711a8a600a12d2895c18f31be1fc5b3c4d9b209
refs/heads/master: e584f9d61ea0aefa81ddd3faf53100536ba4057e
33 changes: 5 additions & 28 deletions trunk/drivers/media/common/siano/smscoreapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ static int smscore_load_firmware_family2(struct smscore_device_t *coredev,


static char *smscore_get_fw_filename(struct smscore_device_t *coredev,
int mode, int lookup);
int mode);

/**
* loads specified firmware into a buffer and calls device loadfirmware_handler
Expand All @@ -1061,15 +1061,15 @@ static char *smscore_get_fw_filename(struct smscore_device_t *coredev,
* @return 0 on success, <0 on error.
*/
static int smscore_load_firmware_from_file(struct smscore_device_t *coredev,
int mode, int lookup,
int mode,
loadfirmware_t loadfirmware_handler)
{
int rc = -ENOENT;
u8 *fw_buf;
u32 fw_buf_size;
const struct firmware *fw;

char *fw_filename = smscore_get_fw_filename(coredev, mode, lookup);
char *fw_filename = smscore_get_fw_filename(coredev, mode);
if (!fw_filename) {
sms_info("mode %d not supported on this device", mode);
return -ENOENT;
Expand Down Expand Up @@ -1268,7 +1268,7 @@ static char *smscore_fw_lkup[][DEVICE_MODE_MAX] = {
* @return 0 on success, <0 on error.
*/
static char *smscore_get_fw_filename(struct smscore_device_t *coredev,
int mode, int lookup)
int mode)
{
char **fw;
int board_id = smscore_get_board_id(coredev);
Expand All @@ -1282,12 +1282,6 @@ static char *smscore_get_fw_filename(struct smscore_device_t *coredev,
if (mode <= DEVICE_MODE_NONE || mode >= DEVICE_MODE_MAX)
return NULL;

if ((board_id == SMS_BOARD_UNKNOWN) || (lookup == 1)) {
sms_debug("trying to get fw name from lookup table mode %d type %d",
mode, type);
return smscore_fw_lkup[type][mode];
}

sms_debug("trying to get fw name from sms_boards board_id %d mode %d",
board_id, mode);
fw = sms_get_board(board_id)->fw;
Expand Down Expand Up @@ -1373,24 +1367,7 @@ int smscore_set_device_mode(struct smscore_device_t *coredev, int mode)

if (!(coredev->modes_supported & (1 << mode))) {
rc = smscore_load_firmware_from_file(coredev,
mode, 0, NULL);

/*
* try again with the default firmware -
* get the fw filename from look-up table
*/
if (rc < 0) {
sms_debug("error %d loading firmware, trying again with default firmware",
rc);
rc = smscore_load_firmware_from_file(coredev,
mode, 1,
NULL);
if (rc < 0) {
sms_debug("error %d loading firmware",
rc);
return rc;
}
}
mode, NULL);
if (rc >= 0)
sms_info("firmware download success");
} else {
Expand Down

0 comments on commit d62349f

Please sign in to comment.