From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755201AbbKCP6l (ORCPT ); Tue, 3 Nov 2015 10:58:41 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:42841 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932469AbbKCP6E (ORCPT ); Tue, 3 Nov 2015 10:58:04 -0500 Subject: Re: [PATCH v2 5/6] regulator: tps65086: Add regulator driver for the TPS65086 PMIC To: Mark Brown References: <1446244904-29315-1-git-send-email-afd@ti.com> <1446244904-29315-6-git-send-email-afd@ti.com> <20151101023735.GE28319@sirena.org.uk> CC: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Linus Walleij , Alexandre Courbot , Samuel Ortiz , Lee Jones , Liam Girdwood , , , From: "Andrew F. Davis" Message-ID: <5638D97A.8040306@ti.com> Date: Tue, 3 Nov 2015 09:57:46 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151101023735.GE28319@sirena.org.uk> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/31/2015 09:37 PM, Mark Brown wrote: > On Fri, Oct 30, 2015 at 05:41:43PM -0500, Andrew F. Davis wrote: > >> +struct tps65086_regulator { >> + struct regulator_desc desc; >> + unsigned int decay_reg; >> + unsigned int decay_mask; > > The decay_reg and decay_mask fields appear to be entirely write only, > why are they present? > Not sure what you mean, they are written to differently for each regulator, and read when setting the decay mode in _probe. >> + ret = of_regulator_match(&pdev->dev, pdev->dev.of_node, >> + tps65086_matches, >> + ARRAY_SIZE(tps65086_matches)); >> + if (ret < 0) { >> + dev_err(tps->dev, "Error parsing regulator init data\n"); >> + return ret; >> + } > > Please match regulators using the fields in the regulator_desc rather > than open coding. > I need to match to get the driver specific information for each regulator, if I let regulator_register do it I never get a chance to process the match, unless there is a callback or something I'm missing.