From f6c316d761d2686a153d7de7a83118c35b7cb494 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 11 Jan 2009 13:04:30 -0200 Subject: zoran: Fix a few CodingStyle issues rised by the previous patch From: Mauro Carvalho Chehab Priority: normal Signed-off-by: Mauro Carvalho Chehab CC: Jean Delvare CC: Trent Piepho --- linux/drivers/media/video/zoran/zoran_card.c | 67 +++++++++++++++++----------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/linux/drivers/media/video/zoran/zoran_card.c b/linux/drivers/media/video/zoran/zoran_card.c index 84edad6a7..925737e8f 100644 --- a/linux/drivers/media/video/zoran/zoran_card.c +++ b/linux/drivers/media/video/zoran/zoran_card.c @@ -1335,7 +1335,7 @@ static int __devinit zoran_probe(struct pci_dev *pdev, KERN_DEBUG "%s: find_zr36057() - trying to autodetect card type\n", ZR_DEVNAME(zr)); - for (i=0;icard.video_codec != 0 && - (codec_name = codecid_to_modulename(zr->card.video_codec)) != NULL) { - if ((result = request_module(codec_name)) < 0) { - dprintk(1, - KERN_ERR - "%s: failed to load modules %s: %d\n", - ZR_DEVNAME(zr), codec_name, result); + if (zr->card.video_codec) { + codec_name = codecid_to_modulename(zr->card.video_codec); + if (codec_name) { + result = request_module(codec_name); + if (result) { + dprintk(1, + KERN_ERR + "%s: failed to load modules %s: %d\n", + ZR_DEVNAME(zr), codec_name, result); + } } } - if (zr->card.video_vfe != 0 && - (vfe_name = codecid_to_modulename(zr->card.video_vfe)) != NULL) { - if ((result = request_module(vfe_name)) < 0) { - dprintk(1, - KERN_ERR - "%s: failed to load modules %s: %d\n", - ZR_DEVNAME(zr), vfe_name, result); + if (zr->card.video_vfe) { + vfe_name = codecid_to_modulename(zr->card.video_vfe); + if (vfe_name) { + result = request_module(vfe_name); + if (result < 0) { + dprintk(1, + KERN_ERR + "%s: failed to load modules %s: %d\n", + ZR_DEVNAME(zr), vfe_name, result); + } } } @@ -1557,23 +1565,30 @@ static int __devinit zoran_probe(struct pci_dev *pdev, return 0; - // Init errors - zr_detach_vfe: + /* Init errors */ +zr_detach_vfe: videocodec_detach(zr->vfe); - zr_free_vfe: + +zr_free_vfe: kfree(master_vfe); - zr_detach_codec: + +zr_detach_codec: videocodec_detach(zr->codec); - zr_free_codec: + +zr_free_codec: kfree(master_codec); - zr_unreg_i2c: + +zr_unreg_i2c: zoran_unregister_i2c(zr); - zr_free_irq: + +zr_free_irq: btwrite(0, ZR36057_SPGPPCR); free_irq(zr->pci_dev->irq, zr); - zr_unmap: + +zr_unmap: iounmap(zr->zr36057_mem); - zr_free_mem: + +zr_free_mem: kfree(zr); return -ENODEV; -- cgit v1.2.3