Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758203Ab3DAHfj (ORCPT ); Mon, 1 Apr 2013 03:35:39 -0400 Received: from mail-oa0-f53.google.com ([209.85.219.53]:38506 "EHLO mail-oa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758168Ab3DAHfi (ORCPT ); Mon, 1 Apr 2013 03:35:38 -0400 MIME-Version: 1.0 In-Reply-To: References: <1364741987.3834.2.camel@phoenix> <1364742271.3834.7.camel@phoenix> From: Eric Miao Date: Mon, 1 Apr 2013 15:35:17 +0800 Message-ID: Subject: Re: [PATCH 3/3] pwm: pxa: Remove clk_enabled field from struct pxa_pwm_chip To: Axel Lin Cc: Thierry Reding , linux-kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1890 Lines: 51 On Mon, Apr 1, 2013 at 3:32 PM, Axel Lin wrote: > 2013/4/1 Eric Miao : >> On Sun, Mar 31, 2013 at 11:04 PM, Axel Lin wrote: >>> clk_enable/clk_disable maintain an enable_count, clk_prepare and clk_unprepare >>> also maintain a prepare_count. These APIs will do prepare/enable when the first >>> user calling these APIs, and do disable/unprepare when the corresponding counter >>> reach 0. Thus We don't need to maintain a clk_enabled counter here. >> >> The original intention is to keep a paired clk enable counter no matter >> how the user calls pwm_enable()/pwm_disable() in pair or not, if that's >> no longer the case. > > We don't need to worry that case: > In pwm core, both pwm_enable() and pwm_disable() will always check > PWMF_ENABLED flag. That's good then, this part of the code was dated before the pwm core, looks like this has been carefully handled. Have my ack on this one then: Acked-by: Eric Miao > > > /** > * pwm_enable() - start a PWM output toggling > * @pwm: PWM device > */ > int pwm_enable(struct pwm_device *pwm) > { > if (pwm && !test_and_set_bit(PWMF_ENABLED, &pwm->flags)) > return pwm->chip->ops->enable(pwm->chip, pwm); > > return pwm ? 0 : -EINVAL; > } > EXPORT_SYMBOL_GPL(pwm_enable); > > /** > * pwm_disable() - stop a PWM output toggling > * @pwm: PWM device > */ > void pwm_disable(struct pwm_device *pwm) > { > if (pwm && test_and_clear_bit(PWMF_ENABLED, &pwm->flags)) > pwm->chip->ops->disable(pwm->chip, pwm); > } > EXPORT_SYMBOL_GPL(pwm_disable); -- 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/