Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp665793ybh; Sat, 7 Mar 2020 07:21:16 -0800 (PST) X-Google-Smtp-Source: ADFU+vtUjaiYW0lfLUhH2hPAPkhoy9hjwp4GMO9Utyj9LvjjBx5xyb5DVfqC/Vu512xTEwsGuapk X-Received: by 2002:a05:6808:1cf:: with SMTP id x15mr6333690oic.44.1583594476584; Sat, 07 Mar 2020 07:21:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583594476; cv=none; d=google.com; s=arc-20160816; b=yDY830RXwxyvmSfm0IxoXnY06QwVQPT8qP6Jnn/Hl4HntP+Z49y1CxiEPYA0zWCche vC2j2ZVPXxvGCozJLaF+aNSoBerfDlBUxD0KYfUHrg6pEZ+L4h/SjveyfvrwMl5TYIpX iPftR+NJxhhvqsovNIHkAhQzCGhSLIRAbmMxWzTfSIZ4PrsoXj6a1xvmFZsh2qKyluL8 ilwXLd7Kn+X+f7DW8j/YubA6cWaXH+dIbM77jLmhjIf5j46fZCZhi1q+6fb9i9FMMVF5 2e8cej16upAEaDj92fxh+ZDmIdisgsE8fodAoe7Sl5+RPqbmPft4dOY2zYdNbBMIKhUL S4dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9066c5FfjgjYtebHmIFT3u78PJScOfMd/xGGL2AcMSI=; b=gv+9rHHQslKISQvM9RCINucWrWR/S3yYCjYk2Bk8Vn6n2BLtlFomUVekA3/7ilt/OZ uui/sR2qAdGXVbROVb372QPwX68kqzA6Lzdr0VimO429DH9iUBvpkU+f5ng8uP6UNAul Ln23KyE8x1UVVpkaF3KKNk06B70EWiK+85RYyJZCfclrIXNsfx0TajI7romGbugoWIa0 bQRT5ov00Eg4oZXZ5Ws1ra9sEmQ7zHC9Ca1eWjKcAKm76c6Y60iGJmPzFhqpE2bBG/eW 3fZGN+MoAniYKceHJJEwHVHMOK3XNEEuPLduSH52e045Tyubz+dqO4joF63CQJrv0nx/ WYLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FV+tBomb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q16si3519048otm.231.2020.03.07.07.21.04; Sat, 07 Mar 2020 07:21:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FV+tBomb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726269AbgCGPUk (ORCPT + 99 others); Sat, 7 Mar 2020 10:20:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:52536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726116AbgCGPUk (ORCPT ); Sat, 7 Mar 2020 10:20:40 -0500 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9FC6D20674; Sat, 7 Mar 2020 15:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583594439; bh=WXObIi33XmoyMwmcEZvaU65yLjmbN66OToWMCu6nPyE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FV+tBombC10mD94wQu/owOffP+3osxZtdkbQHT2q9THGErYc3/8iSvySgWfc89yyw NoiEst1cjF1D/c+/yUYQQt5IIACUVC++KmwWImLlyNWgkWnOBcppBH6CsloyMsVl73 G9iYUgHc4YxqVoeAFFl6RGOgoc9z+8Umw5WMSdFw= Date: Sat, 7 Mar 2020 15:20:34 +0000 From: Jonathan Cameron To: Fabrice Gasnier Cc: , , , , , , , , , , Subject: Re: [PATCH 1/2] iio: trigger: stm32-timer: rename enabled flag Message-ID: <20200307152034.0d7e01a5@archlinux> In-Reply-To: <1583247585-16698-2-git-send-email-fabrice.gasnier@st.com> References: <1583247585-16698-1-git-send-email-fabrice.gasnier@st.com> <1583247585-16698-2-git-send-email-fabrice.gasnier@st.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 3 Mar 2020 15:59:44 +0100 Fabrice Gasnier wrote: > "clk_enabled" flag reflects enabled state of the timer, for master mode, > slave mode or trigger (with sampling_frequency). So rename it to "enabled". > > Signed-off-by: Fabrice Gasnier Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > drivers/iio/trigger/stm32-timer-trigger.c | 28 ++++++++++++++-------------- > 1 file changed, 14 insertions(+), 14 deletions(-) > > diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c > index 16a3b6b..32e1249 100644 > --- a/drivers/iio/trigger/stm32-timer-trigger.c > +++ b/drivers/iio/trigger/stm32-timer-trigger.c > @@ -79,7 +79,7 @@ struct stm32_timer_trigger { > struct device *dev; > struct regmap *regmap; > struct clk *clk; > - bool clk_enabled; > + bool enabled; > u32 max_arr; > const void *triggers; > const void *valids; > @@ -140,8 +140,8 @@ static int stm32_timer_start(struct stm32_timer_trigger *priv, > return -EBUSY; > > mutex_lock(&priv->lock); > - if (!priv->clk_enabled) { > - priv->clk_enabled = true; > + if (!priv->enabled) { > + priv->enabled = true; > clk_enable(priv->clk); > } > > @@ -185,8 +185,8 @@ static void stm32_timer_stop(struct stm32_timer_trigger *priv) > /* Make sure that registers are updated */ > regmap_update_bits(priv->regmap, TIM_EGR, TIM_EGR_UG, TIM_EGR_UG); > > - if (priv->clk_enabled) { > - priv->clk_enabled = false; > + if (priv->enabled) { > + priv->enabled = false; > clk_disable(priv->clk); > } > mutex_unlock(&priv->lock); > @@ -305,9 +305,9 @@ static ssize_t stm32_tt_store_master_mode(struct device *dev, > if (!strncmp(master_mode_table[i], buf, > strlen(master_mode_table[i]))) { > mutex_lock(&priv->lock); > - if (!priv->clk_enabled) { > + if (!priv->enabled) { > /* Clock should be enabled first */ > - priv->clk_enabled = true; > + priv->enabled = true; > clk_enable(priv->clk); > } > regmap_update_bits(priv->regmap, TIM_CR2, mask, > @@ -476,8 +476,8 @@ static int stm32_counter_write_raw(struct iio_dev *indio_dev, > case IIO_CHAN_INFO_ENABLE: > mutex_lock(&priv->lock); > if (val) { > - if (!priv->clk_enabled) { > - priv->clk_enabled = true; > + if (!priv->enabled) { > + priv->enabled = true; > clk_enable(priv->clk); > } > regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, > @@ -485,8 +485,8 @@ static int stm32_counter_write_raw(struct iio_dev *indio_dev, > } else { > regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, > 0); > - if (priv->clk_enabled) { > - priv->clk_enabled = false; > + if (priv->enabled) { > + priv->enabled = false; > clk_disable(priv->clk); > } > } > @@ -594,9 +594,9 @@ static int stm32_set_enable_mode(struct iio_dev *indio_dev, > * enable counter clock, so it can use it. Keeps it in sync with CEN. > */ > mutex_lock(&priv->lock); > - if (sms == 6 && !priv->clk_enabled) { > + if (sms == 6 && !priv->enabled) { > clk_enable(priv->clk); > - priv->clk_enabled = true; > + priv->enabled = true; > } > mutex_unlock(&priv->lock); > > @@ -806,7 +806,7 @@ static int stm32_timer_trigger_remove(struct platform_device *pdev) > if (!(val & TIM_CCER_CCXE)) > regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0); > > - if (priv->clk_enabled) > + if (priv->enabled) > clk_disable(priv->clk); > > return 0;