diff options
author | Antti Palosaari <crope@iki.fi> | 2014-09-26 21:45:36 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-09-28 21:23:42 -0400 |
commit | cf3167cf1e969b17671a4d3d956d22718a8ceb85 (patch) | |
tree | 7837a85a9d9d9db51fa73a50b2837084f5eee14f | |
parent | 214635f94dc3e4069b05817e5d55b58784ba8971 (diff) |
[media] pt3: fix DTV FE I2C driver load error paths
Get rid of 'module_is_live' usage.
on x86_64:
when CONFIG_MODULES is not enabled:
../drivers/media/pci/pt3/pt3.c: In function 'pt3_attach_fe':
../drivers/media/pci/pt3/pt3.c:433:6: error: implicit declaration of function 'module_is_live' [-Werror=implicit-function-declaration]
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Akihiro Tsukada <tskd08@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/pci/pt3/pt3.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/media/pci/pt3/pt3.c b/drivers/media/pci/pt3/pt3.c index 90f86ce7a001..1fdeac11501a 100644 --- a/drivers/media/pci/pt3/pt3.c +++ b/drivers/media/pci/pt3/pt3.c | |||
@@ -393,7 +393,7 @@ static int pt3_attach_fe(struct pt3_board *pt3, int i) | |||
393 | return -ENODEV; | 393 | return -ENODEV; |
394 | pt3->adaps[i]->i2c_demod = cl; | 394 | pt3->adaps[i]->i2c_demod = cl; |
395 | if (!try_module_get(cl->dev.driver->owner)) | 395 | if (!try_module_get(cl->dev.driver->owner)) |
396 | goto err_demod; | 396 | goto err_demod_i2c_unregister_device; |
397 | 397 | ||
398 | if (!strncmp(cl->name, TC90522_I2C_DEV_SAT, sizeof(cl->name))) { | 398 | if (!strncmp(cl->name, TC90522_I2C_DEV_SAT, sizeof(cl->name))) { |
399 | struct qm1d1c0042_config tcfg; | 399 | struct qm1d1c0042_config tcfg; |
@@ -415,28 +415,27 @@ static int pt3_attach_fe(struct pt3_board *pt3, int i) | |||
415 | cl = i2c_new_device(cfg.tuner_i2c, &info); | 415 | cl = i2c_new_device(cfg.tuner_i2c, &info); |
416 | } | 416 | } |
417 | if (!cl || !cl->dev.driver) | 417 | if (!cl || !cl->dev.driver) |
418 | goto err_demod; | 418 | goto err_demod_module_put; |
419 | pt3->adaps[i]->i2c_tuner = cl; | 419 | pt3->adaps[i]->i2c_tuner = cl; |
420 | if (!try_module_get(cl->dev.driver->owner)) | 420 | if (!try_module_get(cl->dev.driver->owner)) |
421 | goto err_tuner; | 421 | goto err_tuner_i2c_unregister_device; |
422 | 422 | ||
423 | dvb_adap = &pt3->adaps[one_adapter ? 0 : i]->dvb_adap; | 423 | dvb_adap = &pt3->adaps[one_adapter ? 0 : i]->dvb_adap; |
424 | ret = dvb_register_frontend(dvb_adap, cfg.fe); | 424 | ret = dvb_register_frontend(dvb_adap, cfg.fe); |
425 | if (ret < 0) | 425 | if (ret < 0) |
426 | goto err_tuner; | 426 | goto err_tuner_module_put; |
427 | pt3->adaps[i]->fe = cfg.fe; | 427 | pt3->adaps[i]->fe = cfg.fe; |
428 | return 0; | 428 | return 0; |
429 | 429 | ||
430 | err_tuner: | 430 | err_tuner_module_put: |
431 | module_put(pt3->adaps[i]->i2c_tuner->dev.driver->owner); | ||
432 | err_tuner_i2c_unregister_device: | ||
431 | i2c_unregister_device(pt3->adaps[i]->i2c_tuner); | 433 | i2c_unregister_device(pt3->adaps[i]->i2c_tuner); |
432 | if (pt3->adaps[i]->i2c_tuner->dev.driver->owner && | 434 | err_demod_module_put: |
433 | module_is_live(pt3->adaps[i]->i2c_tuner->dev.driver->owner)) | 435 | module_put(pt3->adaps[i]->i2c_demod->dev.driver->owner); |
434 | module_put(pt3->adaps[i]->i2c_tuner->dev.driver->owner); | 436 | err_demod_i2c_unregister_device: |
435 | err_demod: | ||
436 | i2c_unregister_device(pt3->adaps[i]->i2c_demod); | 437 | i2c_unregister_device(pt3->adaps[i]->i2c_demod); |
437 | if (pt3->adaps[i]->i2c_demod->dev.driver->owner && | 438 | |
438 | module_is_live(pt3->adaps[i]->i2c_demod->dev.driver->owner)) | ||
439 | module_put(pt3->adaps[i]->i2c_demod->dev.driver->owner); | ||
440 | return ret; | 439 | return ret; |
441 | } | 440 | } |
442 | 441 | ||