From mboxrd@z Thu Jan 1 00:00:00 1970 From: Quentin Schulz Subject: Re: [PATCH v5 3/6] power: supply: axp20x_battery: use data struct for variant specific code Date: Fri, 9 Mar 2018 18:04:22 +0100 Message-ID: <20180309170422.svf2covhrtxgnj5o@qschulz> References: <20180309160825.fde2am6jo6qs6vp6@earth.universe> Reply-To: quentin.schulz-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qghohmptoyiqutrd" Return-path: Sender: linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Content-Disposition: inline In-Reply-To: <20180309160825.fde2am6jo6qs6vp6-SfvFxonMDyemK9LvCR3Hrw@public.gmane.org> List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , To: Sebastian Reichel Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, wens-jdAy2FN1RRM@public.gmane.org, maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org, lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, thomas.petazzoni-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org, linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-Id: linux-pm@vger.kernel.org --qghohmptoyiqutrd Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Hi Sebastian, On Fri, Mar 09, 2018 at 05:08:25PM +0100, Sebastian Reichel wrote: > Hi Quentin, > > On Wed, Feb 28, 2018 at 11:35:58AM +0100, Quentin Schulz wrote: > > We used to use IDs to select a function or a feature depending on the > > variant. It's easier to maintain the code by adding data structure > > storing the few differences between variants so that we don't add a pile > > of if conditions. > > > > Let's use this data structure and update the code to use it. > > > > Signed-off-by: Quentin Schulz > > Reviewed-by: Chen-Yu Tsai > > --- > > I applied this, but modified the patch slightly, so that > it actually calls your new set_max_voltage() callback in > axp20x_battery_set_prop(). Please check that the resulting > patch looks correct to you: > > https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git/commit/?h=for-next&id=648badd797c762a713b48afc3b67d56abdd0073b > You actually fixed an error in this patch while doing so, so thank you :) Looks good to me. Quentin --qghohmptoyiqutrd--