Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: Chris Morgan <macroalpha82@gmail.com>,
	linux-iio@vger.kernel.org, andy@kernel.org, nuno.sa@analog.com,
	dlechner@baylibre.com, jean-baptiste.maneyrol@tdk.com,
	linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org,
	heiko@sntech.de, conor+dt@kernel.org, krzk+dt@kernel.org,
	robh@kernel.org, andriy.shevchenko@intel.com,
	Chris Morgan <macromorgan@hotmail.com>
Subject: Re: [PATCH v16 04/10] iio: imu: inv_icm42607: Add inv_icm42607 Core Driver
Date: Fri, 24 Jul 2026 00:15:35 +0100	[thread overview]
Message-ID: <20260724001535.5991853b@jic23-huawei> (raw)
In-Reply-To: <alYoUSf_jGegFP9E@monoceros>

On Tue, 14 Jul 2026 14:18:53 +0200
Uwe Kleine-König <u.kleine-koenig@baylibre.com> wrote:

> Hello,
> 
> On Mon, Jul 13, 2026 at 04:58:34PM -0500, Chris Morgan wrote:
> > +#include <linux/i2c.h>
> > +#include <linux/mod_devicetable.h>  
> 
> Please don't use <linux/mod_devicetable.h>, to get i2c_device_id and
> of_device_id it's enough to have <linux/i2c.h>.
> 
> > +static const struct i2c_device_id inv_icm42607_id[] = {
> > +	{
> > +		.name = "icm42607",
> > +		.driver_data = (kernel_ulong_t)&inv_icm42607_hw_data,
> > +	}, {
> > +		.name = "icm42607p",
> > +		.driver_data = (kernel_ulong_t)&inv_icm42607p_hw_data,
> > +	},
> > +	{ }
> > +};
> > +MODULE_DEVICE_TABLE(i2c, inv_icm42607_id);
> > +
> > +static const struct of_device_id inv_icm42607_of_matches[] = {
> > +	{
> > +		.compatible = "invensense,icm42607",
> > +		.data = &inv_icm42607_hw_data,
> > +	}, {
> > +		.compatible = "invensense,icm42607p",
> > +		.data = &inv_icm42607p_hw_data,
> > +	},
> > +	{ }
> > +};
> > +MODULE_DEVICE_TABLE(of, inv_icm42607_of_matches);  
> 
> It would be enough to provide the driver_data pointers in the
> i2c_device_id array only.
I'd prefer to keep them in both.

The match function tries the of_device_id path first and if we
should ever get a typo or mismatch we can end up with a driver
failing in a way that is annoyingly hard to track down.  
It has happened :(  Now I'd love us to get to the point
where we could just have the of_device_id table (and maybe
ACPI on occasion) but we aren't there today.

This came up in v17 where I asked why they were missing and Chris
mentioned it would be fine to drop them.

Jonathan

> 
> Best regards
> Uwe


  reply	other threads:[~2026-07-23 23:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13 21:58 [PATCH v16 00/10] Add Invensense ICM42607 Chris Morgan
2026-07-13 21:58 ` [PATCH v16 01/10] dt-bindings: iio: imu: icm42600: Add mount-matrix Chris Morgan
2026-07-13 21:58 ` [PATCH v16 02/10] dt-bindings: iio: imu: icm42600: Remove interrupts from required Chris Morgan
2026-07-15  5:52   ` Krzysztof Kozlowski
2026-07-15 14:52     ` Chris Morgan
2026-07-15 18:29       ` Krzysztof Kozlowski
2026-07-15 20:34         ` Chris Morgan
2026-07-18 23:19           ` Jonathan Cameron
2026-07-20 17:16             ` Chris Morgan
2026-07-23 23:02               ` Jonathan Cameron
2026-07-13 21:58 ` [PATCH v16 03/10] dt-bindings: iio: imu: icm42600: Add icm42607 Chris Morgan
2026-07-13 21:58 ` [PATCH v16 04/10] iio: imu: inv_icm42607: Add inv_icm42607 Core Driver Chris Morgan
2026-07-14 10:56   ` Andy Shevchenko
2026-07-14 12:18   ` Uwe Kleine-König
2026-07-23 23:15     ` Jonathan Cameron [this message]
2026-07-13 21:58 ` [PATCH v16 05/10] iio: imu: inv_icm42607: Add SPI For icm42607 Chris Morgan
2026-07-14 11:00   ` Andy Shevchenko
2026-07-13 21:58 ` [PATCH v16 06/10] iio: imu: inv_icm42607: Add PM support for icm42607 Chris Morgan
2026-07-14 11:25   ` Andy Shevchenko
2026-07-13 21:58 ` [PATCH v16 07/10] iio: imu: inv_icm42607: Add Accelerometer " Chris Morgan
2026-07-14 11:20   ` Andy Shevchenko
2026-07-14 11:21     ` Andy Shevchenko
2026-07-13 21:58 ` [PATCH v16 08/10] iio: imu: inv_icm42607: Add Gyroscope to icm42607 Chris Morgan
2026-07-13 21:58 ` [PATCH v16 09/10] iio: imu: inv_icm42607: Add Temp Support in icm42607 Chris Morgan
2026-07-13 21:58 ` [PATCH v16 10/10] arm64: dts: rockchip: Add icm42607p IMU for RG-DS Chris Morgan

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=20260724001535.5991853b@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=heiko@sntech.de \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=macroalpha82@gmail.com \
    --cc=macromorgan@hotmail.com \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=u.kleine-koenig@baylibre.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