From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752273AbdLLMCl (ORCPT ); Tue, 12 Dec 2017 07:02:41 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:50440 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751507AbdLLMCi (ORCPT ); Tue, 12 Dec 2017 07:02:38 -0500 Date: Tue, 12 Dec 2017 12:02:32 +0000 From: Mark Brown To: "Andrew F. Davis" Cc: Liam Girdwood , Rob Herring , Mark Rutland , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/4] ASoC: codecs: tas5720: add TAS5722 TDM slot width setting support Message-ID: <20171212120232.GI16323@sirena.org.uk> References: <20171211190157.12371-1-afd@ti.com> <20171211190157.12371-4-afd@ti.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="MPkR1dXiUZqK+927" Content-Disposition: inline In-Reply-To: <20171211190157.12371-4-afd@ti.com> X-Cookie: This screen intentionally left blank. User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --MPkR1dXiUZqK+927 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Dec 11, 2017 at 01:01:57PM -0600, Andrew F. Davis wrote: > + /* Configure TDM slot width. This is only applicable to TAS5722. */ > + if (tas5720->devtype == TAS5722) { > + ret = snd_soc_update_bits(codec, TAS5722_DIGITAL_CTRL2_REG, > + TAS5722_TDM_SLOT_16B, > + slot_width == 16 ? > + TAS5722_TDM_SLOT_16B : 0); > + if (ret < 0) > + goto error_snd_soc_update_bits; > + } Use a switch statement, that way additional variants can be handled more sensibly. --MPkR1dXiUZqK+927 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlovxVcACgkQJNaLcl1U h9BFiwf+NTjvX8GnR5vf6yv4h+oyiUSSOVtG36r+wkoh2YeIT9iEnHtd/vhoXbP4 R8idCDMplMYcsz6KBIGi3OL9toKGd5DAvjMF6aUYy65ZRe0rJIgtWswj7f9hu2mT g/urK6BmMUSv9RvPnLCnKzRo4X4eecxL8I9zpqvzWsvOfa2fxG4Ax1HX4yw0Spdi +pqVCvFE3DkTNLEVUwX4/dJf4iXpLALmtWz85N3XnSoAr18J/iBbtJVzlUWP+TgM tL3HTGdcfhi9qFJPFKsVA4XRSu+tn4vvAqb+zRPHIJV3swbGP8ygFttD6qzt2h1G rOBn/k1P2tGHTFwmrB1e1xlofMf0pA== =5BiU -----END PGP SIGNATURE----- --MPkR1dXiUZqK+927--