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: 1517121 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5EF843FC71 for ; Fri, 28 Sep 2012 07:05:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753529Ab2I1HFW (ORCPT ); Fri, 28 Sep 2012 03:05:22 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:39175 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753330Ab2I1HFV (ORCPT ); Fri, 28 Sep 2012 03:05:21 -0400 Received: by pbbrr4 with SMTP id rr4so4725078pbb.19 for ; Fri, 28 Sep 2012 00:05:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=zJP9YaOXjaf8meVOc9lckQpimGTLer0eA6iArbD6J/Y=; b=oCApDyzfwKo37BxBIiPTqPl9CtpgOA1vwYN2soKOSqK9DysJMTO+X18yeoO/RBPRcD Af1ELgqwbEHn7OXepiDpM7UeATHdcYvz/EZLbVCRPijCDtawAPXTGvwHf4XAnv8XvSFk WPWh3ZT8twUmHsb+YJNNgX341zAbHP30DoQzNC31fQdQQwszKLXo2BDjOksfhDyRioI3 PAS+0/d13K9tfhd0tiMFqkWvxscMCKR6G84UGOMJZqnw4lNG0BYOBkoy5jgQGho8fc4r 9+9H/zWoQM7O0H841C0CCj9TeNTramGMwzEnsJ40i5QPlLlQnIa7LQNVjCd/9AMqE2aZ f6eg== 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: ALoCoQmg2q1zy8/kV2kaIu4yBtP2mNCUFmMaEuhOy6GAlqFfj0SSwCnLBWxF8c2SBYcCfqgQZSRd Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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)