[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1a2f24a8-6365-cd56-caaf-ff3dbadbd8e7@users.sourceforge.net>
Date: Fri, 15 Sep 2017 09:56:31 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-media@...r.kernel.org, Andi Shyti <andi.shyti@...sung.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Arvind Yadav <arvind.yadav.cs@...il.com>,
Bhumika Goyal <bhumirks@...il.com>,
Christophe Jaillet <christophe.jaillet@...adoo.fr>,
David Härdeman <david@...deman.nu>,
Hans Verkuil <hans.verkuil@...co.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Santosh Kumar Singh <kumar.san1093@...il.com>,
Sean Young <sean@...s.org>,
Wei Yongjun <weiyongjun1@...wei.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 6/9] [media] tm6000: Use common error handling code in
tm6000_cards_setup()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Thu, 14 Sep 2017 16:26:42 +0200
Add a jump target so that a bit of exception handling can be better reused
in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/media/usb/tm6000/tm6000-cards.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/media/usb/tm6000/tm6000-cards.c b/drivers/media/usb/tm6000/tm6000-cards.c
index 72dd6b80394f..502e0b38b7f1 100644
--- a/drivers/media/usb/tm6000/tm6000-cards.c
+++ b/drivers/media/usb/tm6000/tm6000-cards.c
@@ -872,15 +872,14 @@ int tm6000_cards_setup(struct tm6000_core *dev)
for (i = 0; i < 2; i++) {
rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
dev->gpio.tuner_reset, 0x00);
- if (rc < 0) {
- printk(KERN_ERR "Error %i doing tuner reset\n", rc);
- return rc;
- }
+ if (rc < 0)
+ goto report_failure;
msleep(10); /* Just to be conservative */
rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
dev->gpio.tuner_reset, 0x01);
if (rc < 0) {
+report_failure:
printk(KERN_ERR "Error %i doing tuner reset\n", rc);
return rc;
}
--
2.14.1
Powered by blists - more mailing lists