public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	Andi Shyti <andi.shyti@kernel.org>, Jan Dabros <jsd@semihalf.com>
Subject: Re: [PATCH v1 2/2] i2c: designware: Use device_is_compatible() instead of custom approach
Date: Thu, 15 Jan 2026 06:39:59 +0100	[thread overview]
Message-ID: <20260115053959.GD2275908@black.igk.intel.com> (raw)
In-Reply-To: <aWe_pcSm3tJZhNxw@smile.fi.intel.com>

On Wed, Jan 14, 2026 at 06:09:09PM +0200, Andy Shevchenko wrote:
> On Wed, Jan 14, 2026 at 12:53:04PM +0100, Mika Westerberg wrote:
> > On Wed, Jan 14, 2026 at 09:17:51AM +0100, Andy Shevchenko wrote:
> > > We use MODEL_MSCC_OCELOT effectively is a flag for comparing against
> > 
> > as a flag?
> 
> Yes, sorry for the typo.
> 
> > > "compatible" property. Use device_is_compatible() directly to make it
> > > clear.
> > 
> > Okay but if something else ever needs this same quirk then we would need to
> > add new entry here and also to the IDs list.
> 
> Yes, that's how DT works and there are, of course, examples all over
> the kernel, first that comes to my mind: drivers/mmc/host/sdhci-pltfm.c.
> 
> > With the flag you can have the IDs in a single place not all over the
> > driver.
> 
> Makes the reality harder to read. If I know that the same quirk is used by
> different platform (in terms of compatible string) I will see it immediately
> from the code. Flag is meaningless.

Well with the flag you get the help from the compiler if you typo it but
with the string comparison you are on your own. Therefore I prefer the flag
and as I said it also avoid duplicating the compatible string.

  reply	other threads:[~2026-01-15  5:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14  8:17 [PATCH v1 0/2] i2c: designware: Clean up MODEL_* definitions Andy Shevchenko
2026-01-14  8:17 ` [PATCH v1 1/2] i2c: designware: Remove not-going-to-be-supported code for Baikal SoC Andy Shevchenko
2026-01-14 11:50   ` Mika Westerberg
2026-01-15 15:23   ` Andi Shyti
2026-01-14  8:17 ` [PATCH v1 2/2] i2c: designware: Use device_is_compatible() instead of custom approach Andy Shevchenko
2026-01-14 11:53   ` Mika Westerberg
2026-01-14 16:09     ` Andy Shevchenko
2026-01-15  5:39       ` Mika Westerberg [this message]
2026-01-15  7:41         ` Andy Shevchenko
2026-01-15 10:06           ` Mika Westerberg
2026-01-22 11:10   ` Andi Shyti
2026-01-22 11:49     ` 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=20260115053959.GD2275908@black.igk.intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=jsd@semihalf.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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