Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	Oder Chiou <oder_chiou@realtek.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>
Subject: Re: [PATCH v1 2/3] ASoC: rt5677: Use device_get_match_data()
Date: Thu, 29 Jun 2023 14:09:06 +0300	[thread overview]
Message-ID: <ZJ1mUmI7wOhp710M@smile.fi.intel.com> (raw)
In-Reply-To: <33d3ba54-e391-454f-942c-67f498711078@sirena.org.uk>

On Thu, Jun 29, 2023 at 11:56:10AM +0100, Mark Brown wrote:
> On Thu, Jun 29, 2023 at 01:46:02PM +0300, Andy Shevchenko wrote:

...

> > +	rt5677->type = (enum rt5677_type)(uintptr_t)device_get_match_data(dev);

> Double casts, always a sign of a successful simplification! :P

Unfortunate of the C language and use of plain numbers when
pointers are required. :-( I feel your pain.

> > +	if (rt5677->type == 0)
> >  		return -EINVAL;
> > -	}

I would prefer to see in the ID table something like

	.compatible = "foo", .data = &codec[RT5677],

but in this driver it seems it will require quite a refactoring.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-06-29 11:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 10:46 [PATCH v1 0/3] ASoC: rt5677: Refactor to use device_get_match_data() Andy Shevchenko
2023-06-29 10:46 ` [PATCH v1 1/3] ASoC: rt5677: Use agnostic irq_domain_create_linear() Andy Shevchenko
2023-06-29 14:44   ` Andy Shevchenko
2023-06-29 17:55   ` kernel test robot
2023-06-29 10:46 ` [PATCH v1 2/3] ASoC: rt5677: Use device_get_match_data() Andy Shevchenko
2023-06-29 10:56   ` Mark Brown
2023-06-29 11:09     ` Andy Shevchenko [this message]
2023-06-29 10:46 ` [PATCH v1 3/3] ASoC: rt5677: Sort headers alphabetically Andy Shevchenko

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=ZJ1mUmI7wOhp710M@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=perex@perex.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox