From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA987C433ED for ; Thu, 15 Apr 2021 15:16:38 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6BCAB61131 for ; Thu, 15 Apr 2021 15:16:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6BCAB61131 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8Arhs8NhebhUPCsxyEQuzOZfd9EZzMf3NydryfOe9cA=; b=FfVtvUawQmE9Jz36c8wxoSxEY nyXoVR1m3FeHNtQbsxwRc+4gEqyb/Gn2XrZwyXiol48z7mqKhmMtJhv+PpNjvv4ay4J1mz2KZag/H oXMTA38onXrwOcxUT78v/UZIL94yEOTYmlgJXlDD41UjSQ/Zu98AEJs7rP0a4XRZik7dPetdvXlPA QRteF+J6p+4WnZEWPcuu8Hm5Cn20NTR4dqRCLY0wWj8y6o2F1xxofRqSExOimtlsNAbPGZ82WtJ0t BYSQHxaMc4DZKhFcdJHowaujpGQlNsYNnIxUkM4c5q5szdhi5sKieKwtOD/lBGjQeXUP6W7zD2Dvz 4u/vPoHSA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lX3hi-00GYxV-Mx; Thu, 15 Apr 2021 15:14:51 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lX3hf-00GYw7-0r for linux-arm-kernel@desiato.infradead.org; Thu, 15 Apr 2021 15:14:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Ax39KJeRsWzONrhn+72TkNapDpAhRxhVHYcwUNfI7/8=; b=oOO31XuCG6OFro5Tir4ve5Tf32 9MHjaz1AWbNrCIBmdZ97/gQQJE21MZ9uxIpe6zAxv8qAkKAy7jj6SnAvn/tBshIHu7dBJX8YvPMvY Izi3EzfR6q7X5kUPycxoFUxKfwtk5HjEzrUVPgK65O3NoB1CTzMm7oLGMLja2d6IL2ZL/KGWi9mUX JHORR0RbzyZr3HOasEnnSPKUqowudDhlp6LjMvLNCKWNS1FQ7eREA8B5TSE8qZeUB4zRNP05mwqTU pgUbSxifbj4csPZ/81mwznQW4p/AjwSoZ1LXgjrnNLO4YrN6E6A4vG9NLceNd4EH3AhP9JfW9QtkC 9syaEBQw==; Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lX3hc-008h5y-KJ for linux-arm-kernel@lists.infradead.org; Thu, 15 Apr 2021 15:14:45 +0000 Received: by mail-pg1-x52e.google.com with SMTP id f29so17117665pgm.8 for ; Thu, 15 Apr 2021 08:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Ax39KJeRsWzONrhn+72TkNapDpAhRxhVHYcwUNfI7/8=; b=dZXTlmwxnwELuSG5gVg7O/1XlkljIXnmaZxoSsrmXYAif0qd0cS2nLBV31LseGwAww 08AZo0PIV9odOFgEtGAoQWBGVis/cpRaldCoMSgWx0i8u3k4eVdGECk2soddkRtwXr8W goG25yIsWtbaRs4263s3TAzPuDz4xEVthaSwE0PSnmyj2wnXsT4D3uqzUe74laAsfCR3 MQSfG5xqP9CGq5I/QyeX62oZhM24rciIbTqtir2WC5A6knnDxSt7RtEd+shZndTNr08p mpUHl+Wi+PbhhT5515odVLZx/3VzDUQWi+fZApvrNtlCzuIaZIE/IU4atSpxhtB0XLJd qUNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Ax39KJeRsWzONrhn+72TkNapDpAhRxhVHYcwUNfI7/8=; b=j+EjhhOPNYvIlQSiE4Vjjmp2i5x9VvRpclO0OF0cLPx99ZnCaY6rOQviR+jYN2u8Tp 4rQUhjOkzHAgk7aP5cLR6XMxJvRhYCkMMIlRbfjL8Fp6bKwpHGiYsuMCAwrYj1+l8X39 qCJJf8ltROVtzkdVREETIjcbwXgJg5L2odRThwbeVZppYt+hjHLqi9BoUu6Rim2+eQc7 6ui/mBmhGCgWkHbafD66eJ2AMH8stfdeXjBLIsHyVPoGC5NGhj25szITZBtNcJXooKJi CEw8+hg59eZbhyUyLQ39aWwMm5CkbRMP5XFYM2kROG6JzZCXWojIrF1y9lG/inWVpgLU OW8g== X-Gm-Message-State: AOAM531aDJhDl4v8rrm7wlC6PTIB2m8pFTKSdDNj2gKfqafbRMeKSRpw /9O3g/slyA9rfo+tIU1NLrs= X-Google-Smtp-Source: ABdhPJy7h45A/JGY8V4v3PNXukYZA8GUaHq8q5XZTPvNARGrwJyJ1oIa8vavVXfsZ1NSqZbWbAyD3Q== X-Received: by 2002:aa7:864d:0:b029:24b:dd03:edec with SMTP id a13-20020aa7864d0000b029024bdd03edecmr3764464pfo.18.1618499683934; Thu, 15 Apr 2021 08:14:43 -0700 (PDT) Received: from syed ([2401:4900:2eec:4193:f802:b600:e94c:55c4]) by smtp.gmail.com with ESMTPSA id u5sm684396pfn.155.2021.04.15.08.14.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Apr 2021 08:14:42 -0700 (PDT) Date: Thu, 15 Apr 2021 20:44:31 +0530 From: Syed Nayyar Waris To: William Breathitt Gray Cc: jic23@kernel.org, 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, patrick.havelange@essensium.com, fabrice.gasnier@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, o.rempel@pengutronix.de Subject: Re: [PATCH v10 04/33] counter: 104-quad-8: Return error when invalid mode during ceiling_write Message-ID: <20210415151431.GB8933@syed> References: <98676f9a2e9cf991d7a002b3b264cca774e5b3c8.1616150619.git.vilhelm.gray@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <98676f9a2e9cf991d7a002b3b264cca774e5b3c8.1616150619.git.vilhelm.gray@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210415_081444_688596_7BACF888 X-CRM114-Status: GOOD ( 17.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Mar 19, 2021 at 08:00:23PM +0900, William Breathitt Gray wrote: > The 104-QUAD-8 only has two count modes where a ceiling value makes > sense: Range Limit and Modulo-N. Outside of these two modes, setting a > ceiling value is an invalid operation -- so let's report it as such by > returning -EINVAL. > > Fixes: fc069262261c ("counter: 104-quad-8: Add lock guards - generic interface") > Cc: Syed Nayyar Waris > Signed-off-by: William Breathitt Gray > --- > drivers/counter/104-quad-8.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/counter/104-quad-8.c b/drivers/counter/104-quad-8.c > index 4bb9abffae48..233a3acc1377 100644 > --- a/drivers/counter/104-quad-8.c > +++ b/drivers/counter/104-quad-8.c > @@ -714,13 +714,14 @@ static ssize_t quad8_count_ceiling_write(struct counter_device *counter, > switch (priv->count_mode[count->id]) { > case 1: > case 3: > + mutex_unlock(&priv->lock); > quad8_preset_register_set(priv, count->id, ceiling); > - break; > + return len; > } > > mutex_unlock(&priv->lock); > > - return len; > + return -EINVAL; > } > > static ssize_t quad8_count_preset_enable_read(struct counter_device *counter, > -- > 2.30.2 > Acked-by: Syed Nayyar Waris _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel