From patchwork Wed Mar 2 15:57:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 603151 X-Patchwork-Delegate: khilman@deeprootsystems.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p22FuMLZ010294 for ; Wed, 2 Mar 2011 15:56:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754708Ab1CBP4V (ORCPT ); Wed, 2 Mar 2011 10:56:21 -0500 Received: from mail-ey0-f174.google.com ([209.85.215.174]:59934 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754327Ab1CBP4U (ORCPT ); Wed, 2 Mar 2011 10:56:20 -0500 Received: by mail-ey0-f174.google.com with SMTP id 24so22036eyx.19 for ; Wed, 02 Mar 2011 07:56:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=m80c3CrxgUT/Ui8y5RjDX+bPYn4CLRYvKTnR4r0Bn8o=; b=b6HRo7WjaJh6Ekn832RXZv+AuaASWPmLh2FzNgc8hZUqla5hP4suOQ4wWCoOZDa4L8 f2urzlVKZfN4406ynBs0H5BNCzIidskkTE1UcgM/5dbHLlIaYEkGoLOrmfswDFh8yzNs Q+VOkNexZYZGs6FVjrZ6/PMYmcEpCocxCVuDY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=X2q4P5Cud5fSafHwONV6DdK4NgYi6Tk4Y+r47I8kyFkBaeiT2O23ToVusDZKMEYwU3 bRpQcqkfC3sm3KYtQCekEifGWGMrbHrY7iq6JSeyZl5PdorL4AK4I8jcXu3yqXiP7E+O CGbm3e5qPf1G8KLKrePlqv6dzQEY8VThpe2ZI= Received: by 10.213.103.4 with SMTP id i4mr300411ebo.37.1299081380052; Wed, 02 Mar 2011 07:56:20 -0800 (PST) Received: from localhost ([194.136.136.46]) by mx.google.com with ESMTPS id t50sm76596eeh.0.2011.03.02.07.56.18 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Mar 2011 07:56:19 -0800 (PST) From: Jarkko Nikula To: linux-omap@vger.kernel.org Cc: Thara Gopinath , Nishanth Menon , Jarkko Nikula Subject: [RFC 2/3] omap3+: sr: Sync sr_stop_vddautocomp implementation with sr_start_vddautocomp Date: Wed, 2 Mar 2011 17:57:24 +0200 Message-Id: <1299081445-27938-3-git-send-email-jhnikula@gmail.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1299081445-27938-1-git-send-email-jhnikula@gmail.com> References: <1299081445-27938-1-git-send-email-jhnikula@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 02 Mar 2011 15:56:22 +0000 (UTC) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index d94894a..11741d8 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -229,6 +229,9 @@ static void sr_start_vddautocomp(struct omap_sr *sr) static void sr_stop_vddautocomp(struct omap_sr *sr) { + if (!sr->autocomp_active) + return; + if (!sr_class || !(sr_class->disable)) { dev_warn(&sr->pdev->dev, "%s: smartreflex class driver not registered\n", @@ -236,10 +239,8 @@ static void sr_stop_vddautocomp(struct omap_sr *sr) return; } - if (sr->autocomp_active) { - sr_class->disable(sr->voltdm, 1); + if (!sr_class->disable(sr->voltdm, 1)) sr->autocomp_active = false; - } } /*