From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756162AbcIFKdr (ORCPT ); Tue, 6 Sep 2016 06:33:47 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:34876 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756143AbcIFKdo (ORCPT ); Tue, 6 Sep 2016 06:33:44 -0400 Date: Tue, 6 Sep 2016 11:28:14 +0100 From: Mark Brown To: Danny Milosavljevic Cc: Maxime Ripard , Chen-Yu Tsai , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Jaroslav Kysela , Takashi Iwai , Liam Girdwood , linux-sunxi@googlegroups.com Message-ID: <20160906102814.GG3950@sirena.org.uk> References: <20160905192404.13871-1-dannym@scratchpost.org> <20160905192404.13871-2-dannym@scratchpost.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="A1+ljxmNgwU2bK8G" Content-Disposition: inline In-Reply-To: <20160905192404.13871-2-dannym@scratchpost.org> X-Cookie: FEELINGS are cascading over me!!! User-Agent: Mutt/1.6.0 (2016-04-01) X-SA-Exim-Connect-IP: 188.29.165.166 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH] ASoC: sun4i-codec: Distinguish sun4i from sun7i X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: No (on mezzanine.sirena.org.uk); Unknown failure Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --A1+ljxmNgwU2bK8G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Sep 05, 2016 at 09:24:04PM +0200, Danny Milosavljevic wrote: > -static const struct snd_kcontrol_new sun4i_codec_widgets[] = { > - SOC_SINGLE_TLV("Power Amplifier Volume", SUN4I_CODEC_DAC_ACTL, > - SUN4I_CODEC_DAC_ACTL_PA_VOL, 0x3F, 0, > - sun4i_codec_pa_volume_scale), > +#define SUN4I_COMMON_CODEC_CONTROLS \ > + SOC_SINGLE_TLV("Power Amplifier Volume", SUN4I_CODEC_DAC_ACTL,\ > + SUN4I_CODEC_DAC_ACTL_PA_VOL, 0x3F, 0,\ > + sun4i_codec_pa_volume_scale) > + > +static const struct snd_kcontrol_new sun4i_codec_controls[] = { > + SUN4I_COMMON_CODEC_CONTROLS, > +}; No, please don't do this - macros like this just make the code harder to work with. Do what everything else that handles multiple devices in one driver does and have several different tables of controls, registering the ones that are appropriate for the current device at runtime. --A1+ljxmNgwU2bK8G Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXzpo9AAoJECTWi3JdVIfQ8Y4H/1eJac+deW70yGXvlRnXR47T hrzSJZEKdAWzgb9YCJ5FD27cR9XGrbZZTo4iE+cvy73vko3JdDbEznz/48Q9InrS zErePk5dLSSmZg8Ibg7LfljXkG1TJ5DCOu21oYf1g3Yir86p98i7vRl15MZwJwh8 1fJs60cnYn/G2yttxeg8FHhFWTPWYLYqh1WPdTT2EoG9WEskSwBif1hSoT4j31s6 tENaNVJ3Jsi7AnvECFEbmC0jRSPlNpf0tsnukpG5UDlTHPj+KIpCYbt5Vb+cvCZj YkeCKbPuJ/0r/e7/orf/E6UXDaN9JieuYcAS9vpuaYa+ir0Kk9G7GyB5PqFFWkc= =U/KG -----END PGP SIGNATURE----- --A1+ljxmNgwU2bK8G--