From patchwork Wed Feb 11 14:19:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Mc Guire X-Patchwork-Id: 28198 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1YLYCw-0007Nl-3C; Wed, 11 Feb 2015 15:24:02 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-5) with esmtp id 1YLYCt-0007pC-93; Wed, 11 Feb 2015 15:24:01 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752766AbbBKOXp (ORCPT + 1 other); Wed, 11 Feb 2015 09:23:45 -0500 Received: from www.osadl.org ([62.245.132.105]:33023 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752500AbbBKOXo (ORCPT ); Wed, 11 Feb 2015 09:23:44 -0500 Received: from debian.hofrr.at (92-243-35-153.adsl.nanet.at [92.243.35.153] (may be forged)) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id t1BEN2ZR001042; Wed, 11 Feb 2015 15:23:03 +0100 From: Nicholas Mc Guire To: Hans Verkuil Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] [media] si470x: fixup wait_for_completion_timeout return handling Date: Wed, 11 Feb 2015 09:19:01 -0500 Message-Id: <1423664341-7327-1-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 1.7.10.4 X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KHOP_SC_TOP_CIDR8, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on www.osadl.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2015.2.11.141519 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, FROM_NAME_PHRASE 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS ' return type of wait_for_completion_timeout is unsigned long not int. A appropriately named variable of type unsigned long is added and the assignments fixed up. Signed-off-by: Nicholas Mc Guire --- Patch was only compile tested with Patch is against 3.19.0 (localversion-next is -next-20150211) drivers/media/radio/si470x/radio-si470x-common.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c index 909c3f9..1d827ad 100644 --- a/drivers/media/radio/si470x/radio-si470x-common.c +++ b/drivers/media/radio/si470x/radio-si470x-common.c @@ -208,6 +208,7 @@ static int si470x_set_band(struct si470x_device *radio, int band) static int si470x_set_chan(struct si470x_device *radio, unsigned short chan) { int retval; + unsigned long time_left; bool timed_out = false; /* start tuning */ @@ -219,9 +220,9 @@ static int si470x_set_chan(struct si470x_device *radio, unsigned short chan) /* wait till tune operation has completed */ reinit_completion(&radio->completion); - retval = wait_for_completion_timeout(&radio->completion, - msecs_to_jiffies(tune_timeout)); - if (!retval) + time_left = wait_for_completion_timeout(&radio->completion, + msecs_to_jiffies(tune_timeout)); + if (time_left == 0) timed_out = true; if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0) @@ -301,6 +302,7 @@ static int si470x_set_seek(struct si470x_device *radio, int band, retval; unsigned int freq; bool timed_out = false; + unsigned long time_left; /* set band */ if (seek->rangelow || seek->rangehigh) { @@ -342,9 +344,9 @@ static int si470x_set_seek(struct si470x_device *radio, /* wait till tune operation has completed */ reinit_completion(&radio->completion); - retval = wait_for_completion_timeout(&radio->completion, - msecs_to_jiffies(seek_timeout)); - if (!retval) + time_left = wait_for_completion_timeout(&radio->completion, + msecs_to_jiffies(seek_timeout)); + if (time_left == 0) timed_out = true; if ((radio->registers[STATUSRSSI] & STATUSRSSI_STC) == 0)