[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1414485650.24949.10.camel@AMDC1943>
Date: Tue, 28 Oct 2014 09:40:50 +0100
From: Krzysztof Kozlowski <k.kozlowski@...sung.com>
To: Mark Brown <broonie@...nel.org>
Cc: Samuel Ortiz <sameo@...ux.intel.com>,
Lee Jones <lee.jones@...aro.org>,
Liam Girdwood <lgirdwood@...il.com>,
linux-kernel@...r.kernel.org, Ben Dooks <ben-linux@...ff.org>,
Kukjin Kim <kgene.kim@...sung.com>,
Russell King <linux@....linux.org.uk>,
linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, devicetree@...r.kernel.org,
Kyungmin Park <kyungmin.park@...sung.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Javier Martinez Canillas <javier.martinez@...labora.co.uk>,
Chanwoo Choi <cw00.choi@...sung.com>
Subject: Re: [PATCH 2/8] regulator: max77686: Remove support for board files
On wto, 2014-10-28 at 00:37 +0000, Mark Brown wrote:
> On Mon, Oct 27, 2014 at 04:03:40PM +0100, Krzysztof Kozlowski wrote:
> > The driver is used only on Exynos4 based boards with DTS support.
> > Convert the driver to DTS-only version.
>
> This doesn't seem like a particularly persuasive reason honestly and if
> you're going to mess around with this stuff please fix it properly...
>
> > struct max77686_data {
> > + struct max77686_regulator_data *regulators;
> > + int num_regulators;
> > +
>
> ...the only reason for this array and the specification of the number of
> regulators is to make platform data easier to do...
>
> > - pdata->num_regulators = ARRAY_SIZE(regulators);
> > + max77686->num_regulators = ARRAY_SIZE(regulators);
>
> ...and indeed we wind up with a constant here anyway. At the very least
> it'd be better to pull the parsing into the registration, right now we
> have the code still laid out for platform data so it's hard to see it as
> a win in cleanup terms. If we're not translating into platform data we
> shouldn't need to keep this stuff around outside of the probe function.
>
> What would be even better would be to convert to use the standard DT
> parsing with regulators_node and of_match specified in the descriptor
> and then delete most of this code entirely.
You're right, there's a lot to clean in this driver.
The only caveat is that I can't test the max77802 regulator so I
refrained from doing intrusive changes to it. I'll try to clean up both
drivers and make max77802 as RFT.
Best regards,
Krzysztof
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists