Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3028294ybc; Mon, 18 Nov 2019 08:24:51 -0800 (PST) X-Google-Smtp-Source: APXvYqxpzNj6Bio57Fms4p9dzq48oYzyFRjYdOS5lCIUQZ9Z5fAes6645Y98WOABpwlIQhcsEV1+ X-Received: by 2002:a7b:c10e:: with SMTP id w14mr9635576wmi.40.1574094291364; Mon, 18 Nov 2019 08:24:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574094291; cv=none; d=google.com; s=arc-20160816; b=1Cbb9sEr44dR8pFnqb6jYpC6boPeGAq2X4KKNQMrYZwahrkwLv8agAfBbXGtVnDg9U 2AYaLrZwDE/Sip4iZrZnp35k146wAlZUCDHY5bX/HmpmspBSrZnF25lxzXL5edzR8IYu p2Odxq8DFVuLP0zMDF+wBjhNFzsJFdGrZxNltSRtKSKzbhtmgb4reqf5jgjXy7IAiUPu lSo2/UAOhdmLQMPE2WWfo7l9KJHhhPD6muBXA1CvuJZJcJijLiqs1BBh6OQ7hFcPewZ0 ctPLP7+BtAo72WUWoHGJzIOmedYmqV/0d18oW/yjjdeJBoMKP6oFH68gSv+BW47VBK6F O0wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=dH3GiDllH7/Jo2y/VbNSAfI7efB8J9rmCwOYbfO+yKU=; b=sUvpVgDsX44MvJGGcHIkKcuk+hzc43VgtcGk3kKnsn6vFiiCj4hFTQMWqkoxuTQFln EjOKlg0nv1hhvNrvnptAO1yucm1D1PzMjuPMQ2zizHlNQWjM/sbpOY3BNj7y5Rfid37f bgDlwz+n1O5hulJupVHq4sb0WL+qM/jl+LnaUEpCKrTn5oWyLvjn3Vb02AjlBgnZ+lls EKFudpbglEaWxTWkifzPyykEtFNpi0q+pq67ovyfVwrm2qhudZ9XYxLu74nYgpzKxXuz Osny3421YlpQjY3wkQ/3jVLXAyvGLnVRFKcCVzyRtoUi9YUrvKSfc/XBczPsbP1Tg1MS Enug== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 s38si12640067edd.351.2019.11.18.08.24.27; Mon, 18 Nov 2019 08:24:51 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726912AbfKRQUg (ORCPT + 99 others); Mon, 18 Nov 2019 11:20:36 -0500 Received: from foss.arm.com ([217.140.110.172]:36694 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbfKRQUf (ORCPT ); Mon, 18 Nov 2019 11:20:35 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BC2861FB; Mon, 18 Nov 2019 08:20:34 -0800 (PST) Received: from localhost (unknown [10.37.6.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2ADEB3F703; Mon, 18 Nov 2019 08:20:34 -0800 (PST) Date: Mon, 18 Nov 2019 16:20:32 +0000 From: Mark Brown To: Matti Vaittinen Cc: mazziesaccount@gmail.com, Lee Jones , Jacek Anaszewski , Pavel Machek , Dan Murphy , Rob Herring , Mark Rutland , Liam Girdwood , Jonathan Corbet , Michael Turquette , Stephen Boyd , Linus Walleij , Bartosz Golaszewski , Alessandro Zummo , Alexandre Belloni , Mauro Carvalho Chehab , Jeff Kirsher , Wolfram Sang , Marek Szyprowski , Heiner Kallweit , Nicholas Mc Guire , Phil Edworthy , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-rtc@vger.kernel.org Subject: Re: [PATCH v5 09/16] regulator: bd71828: Basic support for ROHM bd71828 PMIC regulators Message-ID: <20191118162032.GI9761@sirena.org.uk> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BWWlCdgt6QLN7tv3" Content-Disposition: inline In-Reply-To: X-Cookie: no maintenance: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --BWWlCdgt6QLN7tv3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Nov 18, 2019 at 08:57:57AM +0200, Matti Vaittinen wrote: > +static int ramp_delay_supported(struct regulator_dev *rdev) > +{ > + switch (rdev->desc->id) { > + case BD71828_BUCK1: > + case BD71828_BUCK2: > + case BD71828_BUCK6: > + case BD71828_BUCK7: > + return 1; > + default: > + break; > + } > + return 0; > +} > + > +static int bd71828_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay) > +{ > + unsigned int val; > + > + if (!ramp_delay_supported(rdev)) { > + dev_err(&rdev->dev, "%s: can't set ramp-delay\n", > + rdev->desc->name); > + return -EINVAL; Rather than doing this it's better to just not provide the operation for devices that don't support it, that makes the handling in the core easier. --BWWlCdgt6QLN7tv3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAl3SxM8ACgkQJNaLcl1U h9Aq0QgAgjb3+2lEoadTP4w8qi9OfeekF/Te3BOzBoRw/N3CEI0LRdBuZ0f+Co++ QefQkzBXUOq8Pu7bNj+3h6eZiOVqwzPGej79fhswkmFiZGzPNHGJEegNAIQQm0Gt FxLz5qVqIfx2orOMrYbVMIYffkH3hHE5twc3PoUf6lTpyUoErQ1miskrOfiKdqe3 WBlMS73mAzeN65q87QNESqie94xl+DxAY0caeTePuvbEA06Hgf6ZgHvv0uxb/38q 7lI/AzRptAy7HJqHYy6onIRxd12cBoKYa8SsoOlghgepja3prAwDE0eQ0iXo260q kJTWfpuB6S3o/I5A6W0SUuKwiktIEw== =/GhS -----END PGP SIGNATURE----- --BWWlCdgt6QLN7tv3--