Linux driver-core infrastructure
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Danilo Krummrich <dakr@kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Mark Brown <broonie@kernel.org>,
	driver-core@lists.linux.dev, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	linux-spi@vger.kernel.org
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>
Subject: [PATCH v1 4/4] iio: imu: inv_icm42600: Suppress driver_override sysfs attribute
Date: Fri,  8 May 2026 11:42:42 +0200	[thread overview]
Message-ID: <20260508095224.1275645-5-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20260508095224.1275645-1-andriy.shevchenko@linux.intel.com>

The driver makes no sense for the devices without associated driver data.
Instead of checking for absence of it, disable driver_override feature
and drop the no more required check.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c
index 13e2e7d38638..cb8c501d86c3 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_spi.c
@@ -50,20 +50,15 @@ static int inv_icm42600_spi_bus_setup(struct inv_icm42600_state *st)
 
 static int inv_icm42600_probe(struct spi_device *spi)
 {
-	const void *match;
 	enum inv_icm42600_chip chip;
 	struct regmap *regmap;
 
-	match = device_get_match_data(&spi->dev);
-	if (!match)
-		return -EINVAL;
-	chip = (uintptr_t)match;
-
 	/* use SPI specific regmap */
 	regmap = devm_regmap_init_spi(spi, &inv_icm42600_spi_regmap_config);
 	if (IS_ERR(regmap))
 		return PTR_ERR(regmap);
 
+	chip = (uintptr_t)device_get_match_data(&spi->dev);
 	return inv_icm42600_core_probe(regmap, chip, inv_icm42600_spi_bus_setup);
 }
 
@@ -115,6 +110,7 @@ static struct spi_driver inv_icm42600_driver = {
 		.name = "inv-icm42600-spi",
 		.of_match_table = inv_icm42600_of_matches,
 		.pm = pm_ptr(&inv_icm42600_pm_ops),
+		.suppress_override_attrs = true,
 	},
 	.id_table = inv_icm42600_id,
 	.probe = inv_icm42600_probe,
-- 
2.50.1


  parent reply	other threads:[~2026-05-08  9:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08  9:42 [PATCH v1 0/4] driver core, iio: suppress driver_override Andy Shevchenko
2026-05-08  9:42 ` [PATCH v1 1/4] driver core: allow certain drivers prohibit override via sysfs Andy Shevchenko
2026-05-08 15:18   ` Danilo Krummrich
2026-05-08  9:42 ` [PATCH v1 2/4] spi: Support suppress_override_attrs flag Andy Shevchenko
2026-05-08 13:53   ` Mark Brown
2026-05-08 15:28   ` Danilo Krummrich
2026-05-08  9:42 ` [PATCH v1 3/4] iio: imu: inv_mpu6050: Suppress driver_override sysfs attribute Andy Shevchenko
2026-05-08  9:42 ` Andy Shevchenko [this message]
2026-05-08 12:22 ` [PATCH v1 0/4] driver core, iio: suppress driver_override Jonathan Cameron

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=20260508095224.1275645-5-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=broonie@kernel.org \
    --cc=corbet@lwn.net \
    --cc=dakr@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=jic23@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=rafael@kernel.org \
    --cc=skhan@linuxfoundation.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