From patchwork Thu May 26 07:52:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Petter Selasky X-Patchwork-Id: 819882 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4Q7rs4T011184 for ; Thu, 26 May 2011 07:53:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756152Ab1EZHxw (ORCPT ); Thu, 26 May 2011 03:53:52 -0400 Received: from mailfe02.c2i.net ([212.247.154.34]:39674 "EHLO swip.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755787Ab1EZHxv convert rfc822-to-8bit (ORCPT ); Thu, 26 May 2011 03:53:51 -0400 X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=oR3+9dOmPeF3nZCt5Gxyvf/bIpfj8bfjGZkkfp/xES8= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=nD85LqFg1t8A:10 a=WQU8e4WWZSUA:10 a=kj9zAlcOel0A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=8kQB0OdkAAAA:8 a=q3ztxBkoP5dqqE2UMo0A:9 a=CjuIK1q_8ugA:10 a=9aOQ2cSd83gA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe02.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 131997512 for linux-media@vger.kernel.org; Thu, 26 May 2011 09:53:49 +0200 From: Hans Petter Selasky To: "linux-media@vger.kernel.org" Subject: [PATCH v2] Correct error code from -ENOMEM to -EINVAL. Make sure the return value is set in all cases. Date: Thu, 26 May 2011 09:52:33 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?utf-8?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?utf-8?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Message-Id: <201105260952.33551.hselasky@c2i.net> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 26 May 2011 07:53:54 +0000 (UTC) From 9b38a5c9878b5e4be2899ae291c4524f5f5fc218 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Thu, 26 May 2011 09:49:52 +0200 Subject: [PATCH] Correct error code from -ENOMEM to -EINVAL. Make sure the return value is set in all cases. Signed-off-by: Hans Petter Selasky --- drivers/media/video/sr030pc30.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/sr030pc30.c b/drivers/media/video/sr030pc30.c index c901721..8afb0e8 100644 --- a/drivers/media/video/sr030pc30.c +++ b/drivers/media/video/sr030pc30.c @@ -726,8 +726,10 @@ static int sr030pc30_s_power(struct v4l2_subdev *sd, int on) const struct sr030pc30_platform_data *pdata = info->pdata; int ret; - if (WARN(pdata == NULL, "No platform data!\n")) - return -ENOMEM; + if (pdata == NULL) { + WARN(1, "No platform data!\n"); + return -EINVAL; + } /* * Put sensor into power sleep mode before switching off @@ -746,6 +748,7 @@ static int sr030pc30_s_power(struct v4l2_subdev *sd, int on) if (on) { ret = sr030pc30_base_config(sd); } else { + ret = 0; info->curr_win = NULL; info->curr_fmt = NULL; }