From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
Cc: Shenghao Ding <shenghao-ding@ti.com>, Kevin Lu <kevin-lu@ti.com>,
Baojun Xu <x1077012@ti.com>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
"linux-renesas-soc@vger.kernel.org"
<linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH] ASoC: tlv320aic32x4-i2c: Simplify probe()
Date: Mon, 28 Aug 2023 15:53:01 +0300 [thread overview]
Message-ID: <ZOyYrVRkzmd3+W9a@smile.fi.intel.com> (raw)
In-Reply-To: <OS0PR01MB5922E9E9F406EF8F60C2A8C486E0A@OS0PR01MB5922.jpnprd01.prod.outlook.com>
On Mon, Aug 28, 2023 at 11:48:28AM +0000, Biju Das wrote:
> > On Sun, Aug 27, 2023 at 10:45:36AM +0100, Biju Das wrote:
...
> > > + dev_set_drvdata(&i2c->dev, (void *)i2c_get_match_data(i2c));
> >
> > You (potentially) drop const qualifier here. It's not good and it's not
> > explained in the commit message why.
>
> dev_set_drvdata() needs non-const void*, otherwise I get warning.
> The original code also use this cast. That is the reason it is not
> explained in commit message.
Maybe it shouldn't use this pointer directly then?
aic32x4_probe() has these lines
aic32x4->type = (uintptr_t)dev_get_drvdata(dev);
dev_set_drvdata(dev, aic32x4);
Dragging data like this makes a little sense to me. What you should do is to
have a precursor patch that adds a third parameter to ->probe().
Also it makes sense to all your improvements for -i2c.c do similar to all
-spi.c cases where it applies.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2023-08-28 12:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-27 9:45 [PATCH] ASoC: tlv320aic32x4-i2c: Simplify probe() Biju Das
2023-08-28 11:13 ` Andy Shevchenko
2023-08-28 11:48 ` Biju Das
2023-08-28 12:53 ` Andy Shevchenko [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=ZOyYrVRkzmd3+W9a@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=biju.das.jz@bp.renesas.com \
--cc=broonie@kernel.org \
--cc=geert+renesas@glider.be \
--cc=kevin-lu@ti.com \
--cc=lgirdwood@gmail.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=perex@perex.cz \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=shenghao-ding@ti.com \
--cc=tiwai@suse.com \
--cc=x1077012@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox