From: ChiYuan Huang <cy_huang@richtek.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Allen Lin <allen_lin@richtek.com>, <alsa-devel@alsa-project.org>,
<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] ASoC: codecs: Add Richtek rtq9128audio amplifier support
Date: Wed, 20 Sep 2023 11:43:19 +0800 [thread overview]
Message-ID: <20230920034319.GA4446@linuxcarl2.richtek.com> (raw)
In-Reply-To: <eae67380-4eb5-b5b2-d010-ce1f80bc91f9@linux.intel.com>
On Tue, Sep 19, 2023 at 08:42:29AM -0400, Pierre-Louis Bossart wrote:
>
> > +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
>
Yap, it can be removed. Originally, just use it to check regmap core really
follow the declared regmap config.
I think this check may still needed. I'll change the BUG_ON to if/err/return
following by your suggestion in v3.
> > + rg_size = rtq9128_get_reg_size(reg);
> > + return i2c_smbus_write_i2c_block_data(i2c, reg, rg_size, data + count - rg_size);
> > +}
>
prev parent reply other threads:[~2023-09-21 13:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-19 1:18 [PATCH v2 0/2] ASoC: Add rtq9128 audio amplifier cy_huang
2023-09-19 1:18 ` [PATCH v2 1/2] ASoC: dt-bindings: Add Richtek " cy_huang
2023-09-19 12:29 ` Krzysztof Kozlowski
2023-09-19 1:18 ` [PATCH v2 2/2] ASoC: codecs: Add Richtek rtq9128audio amplifier support cy_huang
2023-09-19 2:03 ` ChiYuan Huang
2023-09-19 12:00 ` Mark Brown
2023-09-19 12:42 ` Pierre-Louis Bossart
2023-09-20 3:43 ` ChiYuan Huang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230920034319.GA4446@linuxcarl2.richtek.com \
--to=cy_huang@richtek.com \
--cc=allen_lin@richtek.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=robh+dt@kernel.org \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.