Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3613608pxv; Mon, 5 Jul 2021 01:21:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPE5P/Xfq686nyGLlm6HOzCYWpQ0kHgIzy20QnJmJAVSyx308sqvgXaEYBbkUc89ZP4X8q X-Received: by 2002:aa7:d982:: with SMTP id u2mr14601030eds.230.1625473282177; Mon, 05 Jul 2021 01:21:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625473282; cv=none; d=google.com; s=arc-20160816; b=U+yMcc4qabU/+QWPBt3+y22owY0EzltMdGV8JF3HPPS81obYoCFvmmaFezQk34PErE MRAQbLPuExsAqtEVwpGlswNlOxtzwogIyobAmbNWoYoDBdJ17kl0PlrjAUdtsFe3KJTG 75AOVL5UYCaadpSDCKpINF8HcqXeT97jNHmsZhluuDg1tYI02EeK4xc5duRkiCTDQKHf 6I7HeahpHQcD3tEPd9cLph/3BEhzJsc2GRQo5MpvamzMe0m5ni/UhW1BQD9jgmCO3Fjg tU7x3A9X0PYImHq5ezTG2XB0JLbUpQyXH2RqucY2DbZX06EhpuoV/YCgKnZn7V8QaQBS oFag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TLjqZWQe/YbRhTdSUAIfqvZl6++obXP7V1QPjhbJF6E=; b=WCZ2/OL6QTSy4eALArsflrrrfSI+hDeNjgr+kzPa/wcGIhkNm6HUlUStWK/pUCtOe1 y3cnszbiN6UQI4Gw4rmyYcKRSMqAWHkblMrcyPC/5uxxp4gbzRFP2cJAa/l68oheXQtf rsFgpOt9CiOHv1esI1n/D11whJkBI5jr/wV53w6Jw03ruDq7tPJ56/4IKwkPwaqK3r5y tGCn+W/pSCk70BEV9tBhlJdxNfJL9QjXQI0ibgAP3ODtc0041vqkMQxZzBN8ixVmX1Fl 6NJyexLikglvDl5JUggkHBPdsaOGdKU9TCx3LzMPp5mxx44FQK9e5F61aL+3S791XKYB Zoxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OuwD8OQh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qa14si6564178ejc.445.2021.07.05.01.20.58; Mon, 05 Jul 2021 01:21:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OuwD8OQh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230169AbhGEIWW (ORCPT + 99 others); Mon, 5 Jul 2021 04:22:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230038AbhGEIWW (ORCPT ); Mon, 5 Jul 2021 04:22:22 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3F99C061574; Mon, 5 Jul 2021 01:19:44 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id f11so9883577plg.0; Mon, 05 Jul 2021 01:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TLjqZWQe/YbRhTdSUAIfqvZl6++obXP7V1QPjhbJF6E=; b=OuwD8OQhTm0+i0QMnu9LTr5hAe4C6oSyIhDZLdZuLDAMvMtZbqrTU2LefLISiPTMnp dJbjtszD7slUcbFPSjvetjP3J1rs+VuAlJdM2mX9VFEQ8tk+vOvzy0JBY082JCBGJWc4 AXVaEBsWCyFMGXBD38+bddCcslBcLKFbwiR6H0x2tz6ptGrtITmb/Iq/HtkVBz2uUmok e09Rt3alkgsYXZX0w+NpYtmcRS6hUSsgnhCQS0RkxHRMWwvIeCEMYvMQGrnm5H2rtMpj 4ybOxIwiex0klgyhz18VGTxfJbwjyxKnqjiQ490zf3FcJ7JO0fOaYPhaZKkyxT8qRf9d xdJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TLjqZWQe/YbRhTdSUAIfqvZl6++obXP7V1QPjhbJF6E=; b=Swl/4N5kbqjXP95VmF3ESQfjG7BVq1bW7UeD5iqAPuMFVqEf+pj43YqfyINxWjCni9 ephFh6F2Pup5l6IGULjtYjQAAAhVmJ4ZAvJl6lXrCk+4Qi2CKVW5yq+HJRxxIXSGkLOO JODQLWb0Vo0za3Z+6DrJ7nySijaE1Gy3QFGnC1zlx0IXDe55lewL91F60muW+Kw/NCnU KWnfcnWtDe9A4DDsHd6JOO/Li9e1yCH9d6M1Hj5z/DwRIkejwBhXiei0ctqvXBmSqWxM zAFoiucSZVHNDpY50WuXKrl/0ngVcwxnbfDtuMimL3JtvlGURs2suZnCaB9XCdFSeVvq TiPA== X-Gm-Message-State: AOAM531dKxWKZLW7Rz2LehJiWyeDSme201tMSCVPZ6Tpg+Hrh9nmUvun wlsfZIPyqOgah/CaZMuGgSM= X-Received: by 2002:a17:90a:c484:: with SMTP id j4mr11159190pjt.218.1625473184433; Mon, 05 Jul 2021 01:19:44 -0700 (PDT) Received: from localhost.localdomain ([156.146.35.76]) by smtp.gmail.com with ESMTPSA id y11sm12209986pfo.160.2021.07.05.01.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 01:19:44 -0700 (PDT) From: William Breathitt Gray To: jic23@kernel.org Cc: linux-stm32@st-md-mailman.stormreply.com, kernel@pengutronix.de, a.fatoum@pengutronix.de, kamel.bouhara@bootlin.com, gwendal@chromium.org, alexandre.belloni@bootlin.com, david@lechnology.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, syednwaris@gmail.com, patrick.havelange@essensium.com, fabrice.gasnier@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, o.rempel@pengutronix.de, jarkko.nikula@linux.intel.com, William Breathitt Gray Subject: [PATCH v12 04/17] counter: Rename counter_signal_value to counter_signal_level Date: Mon, 5 Jul 2021 17:18:52 +0900 Message-Id: <65d237358e9e50ab10b8bc74202eddd2bbb8050a.1625471640.git.vilhelm.gray@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signal values will always be levels so let's be explicit it about it to make the intent of the code clear. Cc: Oleksij Rempel Cc: Kamel Bouhara Acked-by: Syed Nayyar Waris Reviewed-by: David Lechner Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 5 +++-- drivers/counter/counter.c | 12 ++++++------ drivers/counter/interrupt-cnt.c | 4 ++-- drivers/counter/microchip-tcb-capture.c | 4 ++-- include/linux/counter.h | 12 ++++++------ 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/drivers/counter/104-quad-8.c b/drivers/counter/104-quad-8.c index d54efdb8d393..b4dd07cf51eb 100644 --- a/drivers/counter/104-quad-8.c +++ b/drivers/counter/104-quad-8.c @@ -97,7 +97,8 @@ struct quad8 { #define QUAD8_CMR_QUADRATURE_X4 0x18 static int quad8_signal_read(struct counter_device *counter, - struct counter_signal *signal, enum counter_signal_value *val) + struct counter_signal *signal, + enum counter_signal_level *level) { const struct quad8 *const priv = counter->priv; unsigned int state; @@ -109,7 +110,7 @@ static int quad8_signal_read(struct counter_device *counter, state = inb(priv->base + QUAD8_REG_INDEX_INPUT_LEVELS) & BIT(signal->id - 16); - *val = (state) ? COUNTER_SIGNAL_HIGH : COUNTER_SIGNAL_LOW; + *level = (state) ? COUNTER_SIGNAL_LEVEL_HIGH : COUNTER_SIGNAL_LEVEL_LOW; return 0; } diff --git a/drivers/counter/counter.c b/drivers/counter/counter.c index 6a683d086008..cb92673552b5 100644 --- a/drivers/counter/counter.c +++ b/drivers/counter/counter.c @@ -289,9 +289,9 @@ struct counter_signal_unit { struct counter_signal *signal; }; -static const char *const counter_signal_value_str[] = { - [COUNTER_SIGNAL_LOW] = "low", - [COUNTER_SIGNAL_HIGH] = "high" +static const char *const counter_signal_level_str[] = { + [COUNTER_SIGNAL_LEVEL_LOW] = "low", + [COUNTER_SIGNAL_LEVEL_HIGH] = "high" }; static ssize_t counter_signal_show(struct device *dev, @@ -302,13 +302,13 @@ static ssize_t counter_signal_show(struct device *dev, const struct counter_signal_unit *const component = devattr->component; struct counter_signal *const signal = component->signal; int err; - enum counter_signal_value val; + enum counter_signal_level level; - err = counter->ops->signal_read(counter, signal, &val); + err = counter->ops->signal_read(counter, signal, &level); if (err) return err; - return sprintf(buf, "%s\n", counter_signal_value_str[val]); + return sprintf(buf, "%s\n", counter_signal_level_str[level]); } struct counter_name_unit { diff --git a/drivers/counter/interrupt-cnt.c b/drivers/counter/interrupt-cnt.c index 66cac4900327..d06367bef8f0 100644 --- a/drivers/counter/interrupt-cnt.c +++ b/drivers/counter/interrupt-cnt.c @@ -130,7 +130,7 @@ static int interrupt_cnt_function_get(struct counter_device *counter, static int interrupt_cnt_signal_read(struct counter_device *counter, struct counter_signal *signal, - enum counter_signal_value *val) + enum counter_signal_level *level) { struct interrupt_cnt_priv *priv = counter->priv; int ret; @@ -142,7 +142,7 @@ static int interrupt_cnt_signal_read(struct counter_device *counter, if (ret < 0) return ret; - *val = ret ? COUNTER_SIGNAL_HIGH : COUNTER_SIGNAL_LOW; + *level = ret ? COUNTER_SIGNAL_LEVEL_HIGH : COUNTER_SIGNAL_LEVEL_LOW; return 0; } diff --git a/drivers/counter/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c index 0c9a61962911..6be3adf74114 100644 --- a/drivers/counter/microchip-tcb-capture.c +++ b/drivers/counter/microchip-tcb-capture.c @@ -158,7 +158,7 @@ static int mchp_tc_count_function_set(struct counter_device *counter, static int mchp_tc_count_signal_read(struct counter_device *counter, struct counter_signal *signal, - enum counter_signal_value *val) + enum counter_signal_level *lvl) { struct mchp_tc_data *const priv = counter->priv; bool sigstatus; @@ -171,7 +171,7 @@ static int mchp_tc_count_signal_read(struct counter_device *counter, else sigstatus = (sr & ATMEL_TC_MTIOA); - *val = sigstatus ? COUNTER_SIGNAL_HIGH : COUNTER_SIGNAL_LOW; + *lvl = sigstatus ? COUNTER_SIGNAL_LEVEL_HIGH : COUNTER_SIGNAL_LEVEL_LOW; return 0; } diff --git a/include/linux/counter.h b/include/linux/counter.h index 9dbd5df4cd34..79f5dcaf6ba0 100644 --- a/include/linux/counter.h +++ b/include/linux/counter.h @@ -290,16 +290,16 @@ struct counter_device_state { const struct attribute_group **groups; }; -enum counter_signal_value { - COUNTER_SIGNAL_LOW = 0, - COUNTER_SIGNAL_HIGH +enum counter_signal_level { + COUNTER_SIGNAL_LEVEL_LOW, + COUNTER_SIGNAL_LEVEL_HIGH, }; /** * struct counter_ops - Callbacks from driver * @signal_read: optional read callback for Signal attribute. The read - * value of the respective Signal should be passed back via - * the val parameter. + * level of the respective Signal should be passed back via + * the level parameter. * @count_read: optional read callback for Count attribute. The read * value of the respective Count should be passed back via * the val parameter. @@ -324,7 +324,7 @@ enum counter_signal_value { struct counter_ops { int (*signal_read)(struct counter_device *counter, struct counter_signal *signal, - enum counter_signal_value *val); + enum counter_signal_level *level); int (*count_read)(struct counter_device *counter, struct counter_count *count, unsigned long *val); int (*count_write)(struct counter_device *counter, -- 2.32.0