Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2893735pxb; Fri, 12 Feb 2021 04:19:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXgsFGbHFgmp6ZoVzeLINlQbqtQpQ15aG1r4iu0GrbxLFf0xWnttgaSm89liIAMkC7fW/c X-Received: by 2002:a17:906:d19b:: with SMTP id c27mr2772377ejz.234.1613132368893; Fri, 12 Feb 2021 04:19:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613132368; cv=none; d=google.com; s=arc-20160816; b=R7u5nyG4I2UB2LRknRgYu1aEzsk1evib3vCEAV/KpnnN/3FWk62NI40h8BLvmYZd0U idom9FqWsVBvF9f5GarSDuDcbxOmK5dxqHkuA3cTro8zn4Fsqd4MK3XXAzFdbvtf/ZEz UbaQr/co61gk6cVtQDL+WJ/H9Xv8ejGz4Tmc4Pn5Vf05FE3PBCvZ5rL7EB+dgCoF5+Wv hY0vNjMHCBZeYwbhV6srjdtJsk6ZuV7noNUdFD4Iri2w1oHllRKrNPzaPI8quIwh1qxd 1LEbt2mTPiBUcPSMqbvoOn+xOAGnMltKz9N6zkpXqR67MEBv2T+6s5bhk7RG6B2yhdoi GRHA== 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=MnlUu3Tk/hyUiFfnaLgwz3t3gB2IBisXktiaiDTWf5Y=; b=rPNb/kNnO9QOF+nEfeDX7Qd/Ilvk17elsJmJ4kpusQn3YO7oJwnNdjC1n/CKOpg57a t6/ABZM71ENLHO3l1GD4Qx/+alPFgDwUgXKpWgmSRAqREF6qeuBN38WkzQV6gqqf9jGr CCAwjTVRumQ7vqcuQaKSknS3UZOurKGsC5xgYIHgL3X3EioM6cJkiT7XxWk7VtVAt9mz UYQebVhDb0iNQ2iYAlj1GHe/f0wgb7vnRwak9javMMGAuPY4oU0lxUR6a4IWEuiXDqnq Q7O2n2ZiBYUKvAT9/NTdrXkMrwNVRRwFBjyWzfQWzMwW1mll34VE5+aJnLqumrESNycm CJug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="C7lE/raf"; 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 h24si6572387ejt.11.2021.02.12.04.19.05; Fri, 12 Feb 2021 04:19:28 -0800 (PST) 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="C7lE/raf"; 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 S230201AbhBLMRj (ORCPT + 99 others); Fri, 12 Feb 2021 07:17:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230291AbhBLMP6 (ORCPT ); Fri, 12 Feb 2021 07:15:58 -0500 Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com [IPv6:2607:f8b0:4864:20::72a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A516C061793; Fri, 12 Feb 2021 04:15:04 -0800 (PST) Received: by mail-qk1-x72a.google.com with SMTP id r77so8383919qka.12; Fri, 12 Feb 2021 04:15:04 -0800 (PST) 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=MnlUu3Tk/hyUiFfnaLgwz3t3gB2IBisXktiaiDTWf5Y=; b=C7lE/rafYmfDqJJNT7httP8daiATDxlEe3cxsOgc+Da+spbleBZxoTyrfAqh6XvSYe 0NmbseBUHViIH/TyQC2Lbh+QyxlamzUx1lrjrE86MMoUjgd92K3xcuM2wFfQmZm18+EM HURjZ5s+QiDpgO/WZCezXQTQPVI1vBcstw6Pf21fhMF5K6bwwwkPRN57PFaD+TAb7Jns sUul1bCiONu8HJ7T26saAKZRH0i4mqFMyPNfdZwv3Lc6BMU7a2GvDtkKnTK/UHnwGhMw pYKDZCmB6csNZOQtyGLIgQEc4zdWbznfm7okTNGFdz3K9WMmSWttLztPSQaaZAtagq2U ruFA== 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=MnlUu3Tk/hyUiFfnaLgwz3t3gB2IBisXktiaiDTWf5Y=; b=JvBKj8FMPtrEF52bCZhV9+/9AZMyfr3taXL1UUXDJape6ot9hEMXl0GRJbLMHOnOUi GkJUutJeFeKz3v/We+Ae8o8xqFfSuJmRxPzca/Eec6mGdpaAtICqVPTKTNsuGnu7nsJi ZjQEP+goQRmpOA32JGeLoyGaNJ/pNT61BuQgtKq0cNtIjYeYTAuJu43OyAm+CdMli1SA CjNlME+YIH+MMMfLj0lHGES+kGKbjwkJvwTabHViyi1Ug9/e+inuMP1vVpw7ScY4fV72 j1I7XsmxSRDAhYF1y4S4WF/CKJq8FWNE7IopHTydgKDorNAJcOzjs78MmNkr4BfijLHu nsjg== X-Gm-Message-State: AOAM532LFAtt/jwVtScoiTBBtQUMgP6z74vHbjV5RXdmINs14bxlMTV4 Nk060xUz68fiLPHeO9RQxGs= X-Received: by 2002:a37:9183:: with SMTP id t125mr2309829qkd.262.1613132103830; Fri, 12 Feb 2021 04:15:03 -0800 (PST) Received: from localhost.localdomain ([193.27.12.132]) by smtp.gmail.com with ESMTPSA id y135sm6278534qkb.14.2021.02.12.04.14.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Feb 2021 04:15:03 -0800 (PST) From: William Breathitt Gray To: jic23@kernel.org Cc: kernel@pengutronix.de, linux-stm32@st-md-mailman.stormreply.com, 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, William Breathitt Gray Subject: [PATCH v8 11/22] counter: Rename counter_signal_value to counter_signal_level Date: Fri, 12 Feb 2021 21:13:35 +0900 Message-Id: X-Mailer: git-send-email 2.30.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: Syed Nayyar Waris Cc: Kamel Bouhara Signed-off-by: William Breathitt Gray --- drivers/counter/104-quad-8.c | 5 +++-- drivers/counter/counter.c | 12 ++++++------ drivers/counter/microchip-tcb-capture.c | 4 ++-- include/linux/counter.h | 12 ++++++------ 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/counter/104-quad-8.c b/drivers/counter/104-quad-8.c index a2cabb028db0..ead0eeb6c846 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/microchip-tcb-capture.c b/drivers/counter/microchip-tcb-capture.c index ee979b011012..f56c4e328018 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.30.0