Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp443479pxb; Sat, 20 Feb 2021 08:50:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfG9B/ZCtShk/FqAlngHV10WwFMoOsYD9UslfWzex0epMpmK+CvcdpsPzkqpiKoK/o8HD3 X-Received: by 2002:a17:906:dff4:: with SMTP id lc20mr13673949ejc.290.1613839827976; Sat, 20 Feb 2021 08:50:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613839827; cv=none; d=google.com; s=arc-20160816; b=aM5DMVD2XNaaEA5CgoNbLZLZgtnwrfcF3Jqs8obMfrH5dNUVXe3mx+rc7u5J9Ohk3S BVSV5x/zD3tEgWH+nOw0uW08pvvmwm5v6g3VNxel4TQRWgpCJWDCDMFKiHyN4Cb8gzVY EIA/By5Cm8TdBo81mesRe4iiZx5Vqm95FfU4OpJmt7HBXeVIYYJ3UGxQrpDRBEmy/bhA XcecZhP5d2xXAjCc9AYQmExrfY32MFL+vdfQhQxAGQ5iQD4BhKYQrLzdViUKvUkgwrrF bZv34oTVqryp5vc7yJuAbtC0rPs9HTRjkSQsYVLD40URf5hRxXEsiG68XFPOuQHZDOc1 Ki1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=o3fnr0AasHCE7sOwqG9i6QL4f96T64yKsXZXUPNym00=; b=BzSOzOqizty52DvsPCpvXFXwe9rlhiONBvB4m9yv7ZY8DZ/kaJYe2QH7yH3KqbXuhU 7nKDTnrxP2HIBLbfBZK8YIkMashhz6QbY7pQfpBF8vpLWpJUvgAft4yrhz2mMKyYIyvz WHh0oc53HVb9OhOKqnLraCFbqmtHsujaO+ugaWqKGec7JRr2sqfa/GrrHCHjLiWfkRjB kd70TwR6EQDAXS9Bs/8pteKQ/omZkAtyZswDFpvIEWvwYtqhO1k9Wj0HoBhVFq1mLmsv nR4qA+aEsG/5T7j3oY9ruCeH1Vtlobjehjg5v84F/NXpI0cBMckUFKfmmZI6tGiUelVY Pbkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lechnology.com header.s=default header.b=iCNOfWxw; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a13si8366361edn.209.2021.02.20.08.49.50; Sat, 20 Feb 2021 08:50:27 -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=fail header.i=@lechnology.com header.s=default header.b=iCNOfWxw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229812AbhBTQnx (ORCPT + 99 others); Sat, 20 Feb 2021 11:43:53 -0500 Received: from vern.gendns.com ([98.142.107.122]:60918 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbhBTQnw (ORCPT ); Sat, 20 Feb 2021 11:43:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=o3fnr0AasHCE7sOwqG9i6QL4f96T64yKsXZXUPNym00=; b=iCNOfWxwVMacI+svobG9eYt1IX LB7VgPct+zMzjh2R8iWeOvTjVargOr/IpoVln1/HAj6XSOYIcalDvL8hq5+ewE1QaLXBwvp/l2Jzg GAC3oCPV0XDjBONGV3QBDpdzHk7VzNvejKRFNSeCs1xYPKEe7rWcYsuVMrffR5LIK7O/DDYRM8w4G Im3CAhBBPurg4McI20rjFeO4mC7Y8T4++kJ8vt07xZhKihDsdBUkx0hLZiOA8snA3fR3CgHo6Y1cb tRQRpF/yCa+wzLms/Hn2mH3+RY2/NzaR3HtxkLCmJerxk3F+Lm0Dmu835190r4Dr3oFmqc9snBawE c0G/JZFA==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:57598 helo=[192.168.0.134]) by vern.gendns.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lDVLY-0001ki-9S; Sat, 20 Feb 2021 11:43:08 -0500 Subject: Re: [PATCH v8 09/22] counter: Return error code on invalid modes To: William Breathitt Gray , 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, 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 References: <58e7c59bb7c7bb94c8655903308842d9d9e9907a.1613131238.git.vilhelm.gray@gmail.com> From: David Lechner Message-ID: Date: Sat, 20 Feb 2021 10:43:06 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <58e7c59bb7c7bb94c8655903308842d9d9e9907a.1613131238.git.vilhelm.gray@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/12/21 6:13 AM, William Breathitt Gray wrote: > Only a select set of modes (function, action, etc.) are valid for a > given device configuration. This patch ensures that invalid modes result > in a return -EINVAL. Such a situation should never occur in reality, but > it's good to define a default switch cases for the sake of making the > intent of the code clear. > > Cc: Syed Nayyar Waris > Cc: Kamel Bouhara > Cc: Fabrice Gasnier > Cc: Maxime Coquelin > Cc: Alexandre Torgue > Cc: David Lechner > Signed-off-by: William Breathitt Gray > --- Reviewed-by: David Lechner (In response to Jonathan's comment, I think this is fine rather than adding more churn to change all of the breaks to returns - but will keep that in mind for future changes.)