Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932184Ab1CXLmP (ORCPT ); Thu, 24 Mar 2011 07:42:15 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:39452 "EHLO opensource2.wolfsonmicro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751726Ab1CXLmO (ORCPT ); Thu, 24 Mar 2011 07:42:14 -0400 Date: Thu, 24 Mar 2011 11:42:11 +0000 From: Dimitris Papastamos To: Peter Hsiang Cc: Jaroslav Kysela , Takashi Iwai , Liam Girdwood , Mark Brown , Jarkko Nikula , Lars-Peter Clausen , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" Subject: Re: [alsa-devel] [PATCH] ASoC: Add max98095 CODEC driver Message-ID: <20110324114211.GA26636@opensource.wolfsonmicro.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1123 Lines: 37 On Wed, Mar 23, 2011 at 08:57:41PM -0700, Peter Hsiang wrote: > +static inline int rate_value(int rate, u8 *value) > +{ > + int i; > + > + for (i = 0; i < ARRAY_SIZE(rate_table); i++) { > + if (rate_table[i].rate >= rate) { > + *value = rate_table[i].sr; > + return 0; > + } > + } > + *value = rate_table[0].sr; > + return -EINVAL; > +} Not too clear as to why this is an inline function? > +static int max98095_probe(struct snd_soc_codec *codec) > +{ > + struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); > + struct max98095_cdata *cdata; > + int ret = 0; > + > + codec->cache_sync = 1; > + memcpy(codec->reg_cache, max98095_reg, sizeof(max98095_reg)); Keeping your own copy of the cache is rather deprecated. As Mark mentioned, you can let the ASoC cache manage your register cache as well as use snd_soc_cache_sync() for syncing. Thanks, Dimitris -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/