Commit e9785250 authored by Jean Delvare's avatar Jean Delvare Committed by Mauro Carvalho Chehab

V4L/DVB (11723): Link firmware to physical device

Use the physical device rather than the i2c adapter as the reference
device when loading firmwares. This will prevent the sysfs name
collision with i2c-dev that has been reported many times.

I may have missed other drivers which need the same fix.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f8eaaf4f
...@@ -272,7 +272,7 @@ static int load_all_firmwares(struct dvb_frontend *fe) ...@@ -272,7 +272,7 @@ static int load_all_firmwares(struct dvb_frontend *fe)
fname = firmware_name; fname = firmware_name;
tuner_dbg("Reading firmware %s\n", fname); tuner_dbg("Reading firmware %s\n", fname);
rc = request_firmware(&fw, fname, &priv->i2c_props.adap->dev); rc = request_firmware(&fw, fname, priv->i2c_props.adap->dev.parent);
if (rc < 0) { if (rc < 0) {
if (rc == -ENOENT) if (rc == -ENOENT)
tuner_err("Error: firmware %s not found.\n", tuner_err("Error: firmware %s not found.\n",
......
...@@ -575,7 +575,7 @@ static int xc5000_fwupload(struct dvb_frontend *fe) ...@@ -575,7 +575,7 @@ static int xc5000_fwupload(struct dvb_frontend *fe)
XC5000_DEFAULT_FIRMWARE); XC5000_DEFAULT_FIRMWARE);
ret = request_firmware(&fw, XC5000_DEFAULT_FIRMWARE, ret = request_firmware(&fw, XC5000_DEFAULT_FIRMWARE,
&priv->i2c_props.adap->dev); priv->i2c_props.adap->dev.parent);
if (ret) { if (ret) {
printk(KERN_ERR "xc5000: Upload failed. (file not found?)\n"); printk(KERN_ERR "xc5000: Upload failed. (file not found?)\n");
ret = XC_RESULT_RESET_FAILURE; ret = XC_RESULT_RESET_FAILURE;
......
...@@ -1455,7 +1455,7 @@ static int af9013_download_firmware(struct af9013_state *state) ...@@ -1455,7 +1455,7 @@ static int af9013_download_firmware(struct af9013_state *state)
af9013_ops.info.name); af9013_ops.info.name);
/* request the firmware, this will block and timeout */ /* request the firmware, this will block and timeout */
ret = request_firmware(&fw, fw_file, &state->i2c->dev); ret = request_firmware(&fw, fw_file, state->i2c->dev.parent);
if (ret) { if (ret) {
err("did not find the firmware file. (%s) " err("did not find the firmware file. (%s) "
"Please see linux/Documentation/dvb/ for more details" \ "Please see linux/Documentation/dvb/ for more details" \
......
...@@ -492,7 +492,7 @@ static int cx24116_firmware_ondemand(struct dvb_frontend *fe) ...@@ -492,7 +492,7 @@ static int cx24116_firmware_ondemand(struct dvb_frontend *fe)
printk(KERN_INFO "%s: Waiting for firmware upload (%s)...\n", printk(KERN_INFO "%s: Waiting for firmware upload (%s)...\n",
__func__, CX24116_DEFAULT_FIRMWARE); __func__, CX24116_DEFAULT_FIRMWARE);
ret = request_firmware(&fw, CX24116_DEFAULT_FIRMWARE, ret = request_firmware(&fw, CX24116_DEFAULT_FIRMWARE,
&state->i2c->dev); state->i2c->dev.parent);
printk(KERN_INFO "%s: Waiting for firmware upload(2)...\n", printk(KERN_INFO "%s: Waiting for firmware upload(2)...\n",
__func__); __func__);
if (ret) { if (ret) {
......
...@@ -123,10 +123,10 @@ static int drx_load_fw(struct drx397xD_state *s, enum fw_ix ix) ...@@ -123,10 +123,10 @@ static int drx_load_fw(struct drx397xD_state *s, enum fw_ix ix)
} }
memset(&fw[ix].data[0], 0, sizeof(fw[0].data)); memset(&fw[ix].data[0], 0, sizeof(fw[0].data));
if (request_firmware(&fw[ix].file, fw[ix].name, &s->i2c->dev) != 0) { rc = request_firmware(&fw[ix].file, fw[ix].name, s->i2c->dev.parent);
if (rc != 0) {
printk(KERN_ERR "%s: Firmware \"%s\" not available\n", printk(KERN_ERR "%s: Firmware \"%s\" not available\n",
mod_name, fw[ix].name); mod_name, fw[ix].name);
rc = -ENOENT;
goto exit_err; goto exit_err;
} }
......
...@@ -879,7 +879,8 @@ static int nxt2002_init(struct dvb_frontend* fe) ...@@ -879,7 +879,8 @@ static int nxt2002_init(struct dvb_frontend* fe)
/* request the firmware, this will block until someone uploads it */ /* request the firmware, this will block until someone uploads it */
printk("nxt2002: Waiting for firmware upload (%s)...\n", NXT2002_DEFAULT_FIRMWARE); printk("nxt2002: Waiting for firmware upload (%s)...\n", NXT2002_DEFAULT_FIRMWARE);
ret = request_firmware(&fw, NXT2002_DEFAULT_FIRMWARE, &state->i2c->dev); ret = request_firmware(&fw, NXT2002_DEFAULT_FIRMWARE,
state->i2c->dev.parent);
printk("nxt2002: Waiting for firmware upload(2)...\n"); printk("nxt2002: Waiting for firmware upload(2)...\n");
if (ret) { if (ret) {
printk("nxt2002: No firmware uploaded (timeout or file not found?)\n"); printk("nxt2002: No firmware uploaded (timeout or file not found?)\n");
...@@ -943,7 +944,8 @@ static int nxt2004_init(struct dvb_frontend* fe) ...@@ -943,7 +944,8 @@ static int nxt2004_init(struct dvb_frontend* fe)
/* request the firmware, this will block until someone uploads it */ /* request the firmware, this will block until someone uploads it */
printk("nxt2004: Waiting for firmware upload (%s)...\n", NXT2004_DEFAULT_FIRMWARE); printk("nxt2004: Waiting for firmware upload (%s)...\n", NXT2004_DEFAULT_FIRMWARE);
ret = request_firmware(&fw, NXT2004_DEFAULT_FIRMWARE, &state->i2c->dev); ret = request_firmware(&fw, NXT2004_DEFAULT_FIRMWARE,
state->i2c->dev.parent);
printk("nxt2004: Waiting for firmware upload(2)...\n"); printk("nxt2004: Waiting for firmware upload(2)...\n");
if (ret) { if (ret) {
printk("nxt2004: No firmware uploaded (timeout or file not found?)\n"); printk("nxt2004: No firmware uploaded (timeout or file not found?)\n");
......
...@@ -340,7 +340,7 @@ static int or51132_set_parameters(struct dvb_frontend* fe, ...@@ -340,7 +340,7 @@ static int or51132_set_parameters(struct dvb_frontend* fe,
} }
printk("or51132: Waiting for firmware upload(%s)...\n", printk("or51132: Waiting for firmware upload(%s)...\n",
fwname); fwname);
ret = request_firmware(&fw, fwname, &state->i2c->dev); ret = request_firmware(&fw, fwname, state->i2c->dev.parent);
if (ret) { if (ret) {
printk(KERN_WARNING "or51132: No firmware up" printk(KERN_WARNING "or51132: No firmware up"
"loaded(timeout or file not found?)\n"); "loaded(timeout or file not found?)\n");
......
...@@ -492,7 +492,7 @@ static int tda10048_firmware_upload(struct dvb_frontend *fe) ...@@ -492,7 +492,7 @@ static int tda10048_firmware_upload(struct dvb_frontend *fe)
TDA10048_DEFAULT_FIRMWARE); TDA10048_DEFAULT_FIRMWARE);
ret = request_firmware(&fw, TDA10048_DEFAULT_FIRMWARE, ret = request_firmware(&fw, TDA10048_DEFAULT_FIRMWARE,
&state->i2c->dev); state->i2c->dev.parent);
if (ret) { if (ret) {
printk(KERN_ERR "%s: Upload failed. (file not found?)\n", printk(KERN_ERR "%s: Upload failed. (file not found?)\n",
__func__); __func__);
......
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