[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260115053959.GD2275908@black.igk.intel.com>
Date: Thu, 15 Jan 2026 06:39:59 +0100
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
Andi Shyti <andi.shyti@...nel.org>, Jan Dabros <jsd@...ihalf.com>
Subject: Re: [PATCH v1 2/2] i2c: designware: Use device_is_compatible()
instead of custom approach
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.
Powered by blists - more mailing lists