From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48522CD5BB9 for ; Tue, 19 Sep 2023 13:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231598AbjISNIR (ORCPT ); Tue, 19 Sep 2023 09:08:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231947AbjISNIN (ORCPT ); Tue, 19 Sep 2023 09:08:13 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B75C4F0; Tue, 19 Sep 2023 06:08:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695128887; x=1726664887; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=eHGLPuJLnfYPHZJ2U5imVvNKpQ7YRooOfvMe9p3pXJc=; b=hELsZW+QV+e2yDOnc8rCyX/3K9AEIRdxPpBQmpgvtnzNpbpBhSrgCeH+ ETN3vAKdAbFWJwPfk5b7mitK1z4fSdmK9pBecwfuOk81BAirA+P8xCUmJ iOvCmIkVX7j/NCpiKFW+Yf1fTHxO4KupalVI345J/Jzn40ZVDSb+4TMqd UbPiXd8yN1jN2P7FnnoeVa4dLIbuaiXBsBBlzCxhN7rMLv66MtmDxZd/R COV+xBVMlgl10avTPOP5dWIag5ngJorWQZIBn9sAn4KVMtGEQDBYZdj17 t0DF/1qq0h3iEr1616Bqt4dqupGAZscwETY8xnmWUfVvUsveShKLSNSmd g==; X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="370249839" X-IronPort-AV: E=Sophos;i="6.02,159,1688454000"; d="scan'208";a="370249839" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 06:08:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10838"; a="861538519" X-IronPort-AV: E=Sophos;i="6.02,159,1688454000"; d="scan'208";a="861538519" Received: from lwatts-mobl1.amr.corp.intel.com (HELO [10.212.5.115]) ([10.212.5.115]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Sep 2023 06:08:04 -0700 Message-ID: Date: Tue, 19 Sep 2023 08:42:29 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.15.1 Subject: Re: [PATCH v2 2/2] ASoC: codecs: Add Richtek rtq9128audio amplifier support To: cy_huang@richtek.com, Mark Brown , Krzysztof Kozlowski , Conor Dooley Cc: Liam Girdwood , Rob Herring , Jaroslav Kysela , Takashi Iwai , Allen Lin , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <1695086301-10376-1-git-send-email-cy_huang@richtek.com> <1695086301-10376-3-git-send-email-cy_huang@richtek.com> Content-Language: en-US From: Pierre-Louis Bossart In-Reply-To: <1695086301-10376-3-git-send-email-cy_huang@richtek.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static int rtq9128_i2c_write(void *context, const void *data, size_t count) > +{ > + struct device *dev = context; > + struct i2c_client *i2c = to_i2c_client(dev); > + u8 reg = *(u8 *)data; > + int rg_size; > + > + BUG_ON(count != 5); is this really necessary? Just log and error and return? same comments for other functions > + rg_size = rtq9128_get_reg_size(reg); > + return i2c_smbus_write_i2c_block_data(i2c, reg, rg_size, data + count - rg_size); > +}