From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bartosz Golaszewski Subject: Re: [PATCH 08/13] regulator: max77650: add regulator support Date: Fri, 18 Jan 2019 19:13:38 +0100 Message-ID: References: <20190118134244.22253-1-brgl@bgdev.pl> <20190118134244.22253-9-brgl@bgdev.pl> <20190118180148.GD6260@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20190118180148.GD6260@sirena.org.uk> Sender: linux-kernel-owner@vger.kernel.org To: Mark Brown Cc: Bartosz Golaszewski , Rob Herring , Mark Rutland , Linus Walleij , Dmitry Torokhov , Jacek Anaszewski , Pavel Machek , Lee Jones , Sebastian Reichel , Liam Girdwood , Greg Kroah-Hartman , LKML , linux-gpio , linux-devicetree , linux-input@vger.kernel.org, linux-leds@vger.kernel.org, linux-pm List-Id: linux-leds@vger.kernel.org pt., 18 sty 2019 o 19:01 Mark Brown napisa=C5=82(a): > > On Fri, Jan 18, 2019 at 02:42:39PM +0100, Bartosz Golaszewski wrote: > > > Add regulator support for max77650. We support all four variants of thi= s > > PMIC including non-linear voltage table for max77651 SBB1 rail. > > Looks good, the ramping stuff might be a candidate for core (TBH I was > sure we'd got that implemented already but we don't seem to) but that > can be done later and the more complex one with non-linear steps does > feel like it might have to stay in the driver anyway. > > A couple of small nits: > > > +++ b/drivers/regulator/max77650-regulator.c > > @@ -0,0 +1,537 @@ > > +// SPDX-License-Identifier: GPL-2.0 > > +/* > > + * Copyright (C) 2018 BayLibre SAS > > + * Author: Bartosz Golaszewski > > Please make the entire header C++ style so it looks more intentional. > Seems like there are more files in the kernel source using the mixed comment style for the SPDX identifier and I also prefer it over C++ only. Would you mind if it stayed that way? > > + for_each_child_of_node(dev->of_node, child) { > > + if (!of_node_name_eq(child, rdesc->desc.name)) > > + continue; > > + > > + init_data =3D of_get_regulator_init_data(dev, chi= ld, > > + &rdesc->de= sc); > > + if (!init_data) > > + return -ENOMEM; > > + > > + config.of_node =3D child; > > + config.init_data =3D init_data; > > + } > > You don't need to do this, the core will do it for you (it will actually > still do it even with the above, it'll only fall back to using > config->init_data if it's own lookup fails). I added this loop specifically because the core would not pick up the init data from DT. What did I miss (some specific variable to assign)? I just noticed some other drivers do the same and thought it's the right thing to do. Thanks, Bart