From patchwork Fri Sep 28 07:01:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 11833 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 710C323E57 for ; Fri, 28 Sep 2012 07:05:31 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id E7346A18C9D for ; Fri, 28 Sep 2012 07:05:30 +0000 (UTC) Received: by ieje10 with SMTP id e10so6219282iej.11 for ; Fri, 28 Sep 2012 00:05:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=zJP9YaOXjaf8meVOc9lckQpimGTLer0eA6iArbD6J/Y=; b=i+ps09nFfZVXa8USbQmOyb3wPICvFJvgCOj9FpUgWVFtc5lmaCrpekN8EqJdQW/w1+ E1efcxgMjx+VWx+NFA5iagGZDFzvTKtFEsDyMS3oX4q9mwR44koGmq26HOolRYI5mg2V POeY89QtqtZX51ly1YfGTkUa3l/05gh6DmxgeWPGe6wcoIL+I+6HDlqxY5RgMie34xBE eufNZDXeYYQ1TvzpQ722NmmTCMTWaCoSaZtvU1u62g1Wjt0hpodUlDUHiXuFz7Ckj+z7 o82cVTJI6FzGtrc1lJhonSrZ0QFtKkCxrgvobEwozg4UkgDmOhjiIGA+c+qV4iMPEVkd Ug7g== Received: by 10.50.0.193 with SMTP id 1mr832414igg.0.1348815930360; Fri, 28 Sep 2012 00:05:30 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp455730igc; Fri, 28 Sep 2012 00:05:29 -0700 (PDT) Received: by 10.66.85.202 with SMTP id j10mr11345256paz.27.1348815929451; Fri, 28 Sep 2012 00:05:29 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id pv1si9749518pbb.269.2012.09.28.00.05.21 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 28 Sep 2012 00:05:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by pbcmd4 with SMTP id md4so2374827pbc.37 for ; Fri, 28 Sep 2012 00:05:21 -0700 (PDT) Received: by 10.68.232.131 with SMTP id to3mr18209407pbc.58.1348815921556; Fri, 28 Sep 2012 00:05:21 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id gf8sm5137370pbc.52.2012.09.28.00.05.18 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 28 Sep 2012 00:05:20 -0700 (PDT) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: k.debski@samsung.com, s.nawrocki@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH] [media] s5p-mfc: Fix misplaced return statement in s5p_mfc_suspend() Date: Fri, 28 Sep 2012 12:31:35 +0530 Message-Id: <1348815695-8216-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQm9Cf6y281ZtbtBjSGJZ69TOCHdc3Fz7NlkK/qkTR7z9ur/G/3Xce7ud+OIniDqSVXBmW7G return statement was wrongly placed before a code that needs to be executed. Moved the return statement to the end of the function. Tested suspend/resume on SMDK4412 board using 3.5-rc6 kernel. Signed-off-by: Sachin Kamat Acked-by: Kamil Debski --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index e3e616d..e913a1c 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1148,7 +1148,7 @@ static int s5p_mfc_suspend(struct device *dev) if (m_dev->num_inst == 0) return 0; - return s5p_mfc_sleep(m_dev); + if (test_and_set_bit(0, &m_dev->enter_suspend) != 0) { mfc_err("Error: going to suspend for a second time\n"); return -EIO; @@ -1167,7 +1167,8 @@ static int s5p_mfc_suspend(struct device *dev) return -EIO; } } - return 0; + + return s5p_mfc_sleep(m_dev); } static int s5p_mfc_resume(struct device *dev)