Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp1144374lqb; Thu, 30 May 2024 01:14:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWNj7TznRjiCklYShLJD9Jd4L+UlkG6Oarw4M2FhdqwDVaKOHCuMreB1n09RF4m4r5aT0+rzbZecBlUy4OLqyvaq7GGzZwHtQ6P1qpsAg== X-Google-Smtp-Source: AGHT+IFoIVwoZX0cU/Issg7PhTe/QQ/bM1+poW3wiqIuzZfx5r0u2nRnGbQzY7ljvKrGP/GtF/Jr X-Received: by 2002:a50:9554:0:b0:574:d009:cb3c with SMTP id 4fb4d7f45d1cf-57a1a313e06mr912443a12.18.1717056886245; Thu, 30 May 2024 01:14:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717056886; cv=pass; d=google.com; s=arc-20160816; b=FGBzSVdc161BTbWPV5rQPa/4sneg5ZIxAyuyntgQBgZWWYm9+zM+TV06WMnn6Oq2my SToMcB3pXbOARk57SjHUp25zZC6jW8zxOLvBjSQw3LRFvg6xwaRgtqKcGEncTqbX6cvH EDz91cI0h9riSu0oZgSGUSMLkorSuzsbp9P8rjTXSGpfc7Y3rJOmmv4JXbMSFFnFAH9D scNtlrcHJgYlslgkFIZc7o+VE0DmrPQC8yfEHF/lEUJb+HIUH9W6HcD0+CYbP8BjeGkA cnqxWf/kutmEie/ABqyfeK8bHByNrlWHi11/5E4Hsf1UDXbMexThR0kRDzbpga0XWHSl kyig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SxtLpZGjVMAE0kqWZoUDh9yB0yllqPicR1hk6vIi91M=; fh=KUuPOpw0IyM8pbeqiieZ62jf/DwruDIjwoIl6lgdu1o=; b=punvbL4+wqBUaOXP+7gkQkv0iD2QwpHWgoco+uSTE2W5ThtvWzIJYUJoQvBb07Ppqn OSJfP5Vy1AvaJysHOLFLrF1HPGzTBLBWvp9o8jP05tVSpzlg8qZaK0gCn7FThdmMguQt 6mnMrmWC+vj/T//5Bcsiyk3PdoSpxKcS7wplJ0EK4xPPeAz0fm+IdFm2iq+Wy6KdtjOI K5gmBjEVK0idODuJ8aMoHET77/MGX4jTI//owE/Qrej8ZXC6OxGF3/tiCzFA9O8i/NoK TDDYmy/T5hhA1tZx5YO+u+wvhJPlWMEW5nHyyw+MJ0atn4jyEucBHSS9PS2O3bkzbrTX HhXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AEdmSyO6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-195048-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195048-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-579cfa75cdasi4740395a12.388.2024.05.30.01.14.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 01:14:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195048-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AEdmSyO6; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-195048-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195048-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id F0E2E1F2310F for ; Thu, 30 May 2024 08:14:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFB2714A618; Thu, 30 May 2024 08:14:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AEdmSyO6" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECE814D8CC; Thu, 30 May 2024 08:14:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717056877; cv=none; b=jfPF/kq2JOOvNCskp87PFMctwRzjKo2SFozT9iPSJQ294iA64CyJX6ksL0/BpvzrAUgMo7uvsTTZqSQ1d/vnjOTMZVIN3fx8VFvRowt/dum+yf4S2bwUzk3EqMCw9DfmSIgNuAZaSCAnmIkY2yw/f54F/qyzVSXtjNfq4QgrBAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717056877; c=relaxed/simple; bh=IuCxL1dIUocrZee96DyADSyIZgW2fonyjZS+wAJ7ZwQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=f5uvo/MtQ/Bg4YyYIytq+MZIV8pJL6W66Mog0ebPxxFL4EHo3HQ+6VxEi+35aIPn+3FeoHQMpl7atsTvvCMNwSts0xSbA1ptFOA+jCZpg4AQDYI5olo64GAb1m9GU0IYAHoNpb2Jb4mJsjw3386GJR/hktEtajIgEb2mfZhT3x4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AEdmSyO6; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BBC6C2BBFC; Thu, 30 May 2024 08:14:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717056876; bh=IuCxL1dIUocrZee96DyADSyIZgW2fonyjZS+wAJ7ZwQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AEdmSyO61BFA3SHGW3/av0rYeWj3HwGB152s0JqxVbY6809pwohZGW4yYy/IS+L5O H+cnk/adtKPevdBW55xHeW42fOt8B49YXz3QvvBHT8PHUck2CuC2Bo45PWT6p+byv1 57FfeNBK7e3dnz2/kEgjS+JzKjEdBKcUevKSz+ljT8XHQxbJCs5IvhsNFgFxBuP4ik x/L7cY60Hljfds60Lib+YCWMNcZiOvWp3D71tpIxZXs1P7Psmvf3rSIlvPZNqXfkKe d5w1ZQAh/KQUT+ILZmDl4Nu4rVcTvjygMzCMzVI5A/D5BdIETAyuCfSRAyDIq5806J qxCMzzGyTmipg== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1sCavk-0000000046d-1uUd; Thu, 30 May 2024 10:14:36 +0200 Date: Thu, 30 May 2024 10:14:36 +0200 From: Johan Hovold To: Andy Shevchenko Cc: Johan Hovold , Lee Jones , Mark Brown , Linus Walleij , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Liam Girdwood , Das Srinagesh , Satya Priya Kakitapalli , Stephen Boyd , Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Subject: Re: [PATCH v2 13/14] regulator: add pm8008 pmic regulator driver Message-ID: References: <20240529162958.18081-1-johan+linaro@kernel.org> <20240529162958.18081-14-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, May 29, 2024 at 11:02:57PM +0300, Andy Shevchenko wrote: > On Wed, May 29, 2024 at 7:30 PM Johan Hovold wrote: > > +#include > > +#include > > +#include > > +#include > > +#include > > > +#include > > +#include > > +#include > > +#include > > + types.h This one is already pulled in indirectly and I'm not going to respin for this. > + asm/byteorder.h Already explicitly included in the code you left out. > > +static int pm8008_regulator_set_voltage_sel(struct regulator_dev *rdev, unsigned int sel) > > +{ > > + struct pm8008_regulator *preg = rdev_get_drvdata(rdev); > > + unsigned int mV; > > + __le16 val; > > + int ret; > > + > > + ret = regulator_list_voltage_linear_range(rdev, sel); > > + if (ret < 0) > > + return ret; > > + > > + mV = DIV_ROUND_UP(ret, 1000); > > MILLI from units.h ? Nah. > > + val = cpu_to_le16(mV); > > > + ret = regmap_bulk_write(preg->regmap, preg->base + LDO_VSET_LB_REG, > > + &val, sizeof(val)); > > + if (ret < 0) > > + return ret; > > + > > + return 0; > > May be written as > > return regmap_bulk_write(...); I obviously prefer it the way I wrote it. > > + rdev = devm_regulator_register(dev, desc, &config); > > + if (IS_ERR(rdev)) { > > + ret = PTR_ERR(rdev); > > + dev_err(dev, "failed to register regulator %s: %d\n", > > + desc->name, ret); > > + return ret; > > It's possible to use > > return dev_err_probe(...); > > even for non-probe functions. This is a probe function(), but as I've told you repeatedly I'm not going to use dev_err_probe() here. Johan