Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756960Ab0KJQhf (ORCPT ); Wed, 10 Nov 2010 11:37:35 -0500 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:57375 "EHLO opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756824Ab0KJQhe (ORCPT ); Wed, 10 Nov 2010 11:37:34 -0500 Date: Wed, 10 Nov 2010 16:37:32 +0000 From: Mark Brown To: Bengt Jonsson Cc: Liam Girdwood , linux-kernel@vger.kernel.org, Linus Walleij , Mattias Wallin Subject: Re: [PATCH] regulator: enable supply regulator only when use count is zero Message-ID: <20101110163732.GB6052@rakim.wolfsonmicro.main> References: <1289383582-10183-1-git-send-email-bengt.g.jonsson@stericsson.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1289383582-10183-1-git-send-email-bengt.g.jonsson@stericsson.com> X-Cookie: Nihilism should commence with oneself. User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 852 Lines: 21 On Wed, Nov 10, 2010 at 11:06:22AM +0100, Bengt Jonsson wrote: > Supply regulators are disabled only when the last > reference count is removed on the child regulator > (the use count goes from 1 to 0). This patch changes > the behaviour of enable so the supply regulator is > enabled only when the use count of the child > regulator goes from 0 to 1. Acked-by: Mark Brown > + if (rdev->use_count == 0) { > + /* do we need to enable the supply regulator first */ > + if (rdev->supply) { This'd be a bit neater (and less invasive) as a single if statement with &&. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/