Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: linux-hwmon@vger.kernel.org
Cc: "Arnd Bergmann" <arnd@arndb.de>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Nuno Sá" <nuno.sa@analog.com>
Subject: [PATCH 05/10] hwmon: (ltc4245) Drop platform data support
Date: Tue, 10 Nov 2026 10:34:28 -0800	[thread overview]
Message-ID: <20261110183434.181711-6-linux@roeck-us.net> (raw)
In-Reply-To: <20261110183434.181711-1-linux@roeck-us.net>

There are no in-tree users of ltc4245_platform_data. Sampling all GPIO
pins as analog voltages is already configurable via the
"ltc4245,use-extra-gpios" devicetree property.

Drop platform data support from the driver, remove the unused
platform_data header file, and update the driver documentation.

Cc: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 Documentation/hwmon/ltc4245.rst       |  6 ++----
 drivers/hwmon/ltc4245.c               | 21 +++------------------
 include/linux/platform_data/ltc4245.h | 17 -----------------
 3 files changed, 5 insertions(+), 39 deletions(-)
 delete mode 100644 include/linux/platform_data/ltc4245.h

diff --git a/Documentation/hwmon/ltc4245.rst b/Documentation/hwmon/ltc4245.rst
index 3dafd08a4e87..0c3b823169b9 100644
--- a/Documentation/hwmon/ltc4245.rst
+++ b/Documentation/hwmon/ltc4245.rst
@@ -103,9 +103,7 @@ then they will be sampled in round-robin fashion. If userspace reads too
 slowly, -EAGAIN will be returned when you read the sysfs attribute containing
 the sensor reading.
 
-The LTC4245 chip can be configured to sample all GPIO pins with two methods:
-
-1) platform data -- see include/linux/platform_data/ltc4245.h
-2) OF device tree -- add the "ltc4245,use-extra-gpios" property to each chip
+The LTC4245 chip can be configured to sample all GPIO pins by adding the
+"ltc4245,use-extra-gpios" OF device tree property to each chip.
 
 The default mode of operation is to sample a single GPIO pin.
diff --git a/drivers/hwmon/ltc4245.c b/drivers/hwmon/ltc4245.c
index e7fcf607a05e..7425c801cfe5 100644
--- a/drivers/hwmon/ltc4245.c
+++ b/drivers/hwmon/ltc4245.c
@@ -19,7 +19,7 @@
 #include <linux/i2c.h>
 #include <linux/hwmon.h>
 #include <linux/jiffies.h>
-#include <linux/platform_data/ltc4245.h>
+#include <linux/of.h>
 
 /* Here are names of the chip's registers (a.k.a. commands) */
 enum ltc4245_cmd {
@@ -418,22 +418,6 @@ static const struct hwmon_chip_info ltc4245_chip_info = {
 	.info = ltc4245_info,
 };
 
-static bool ltc4245_use_extra_gpios(struct i2c_client *client)
-{
-	struct ltc4245_platform_data *pdata = dev_get_platdata(&client->dev);
-	struct device_node *np = client->dev.of_node;
-
-	/* prefer platform data */
-	if (pdata)
-		return pdata->use_extra_gpios;
-
-	/* fallback on OF */
-	if (of_property_read_bool(np, "ltc4245,use-extra-gpios"))
-		return true;
-
-	return false;
-}
-
 static int ltc4245_probe(struct i2c_client *client)
 {
 	struct i2c_adapter *adapter = client->adapter;
@@ -448,7 +432,8 @@ static int ltc4245_probe(struct i2c_client *client)
 		return -ENOMEM;
 
 	data->client = client;
-	data->use_extra_gpios = ltc4245_use_extra_gpios(client);
+	data->use_extra_gpios = of_property_read_bool(client->dev.of_node,
+						      "ltc4245,use-extra-gpios");
 
 	/* Initialize the LTC4245 chip */
 	i2c_smbus_write_byte_data(client, LTC4245_FAULT1, 0x00);
diff --git a/include/linux/platform_data/ltc4245.h b/include/linux/platform_data/ltc4245.h
deleted file mode 100644
index f07fa05ea6c4..000000000000
--- a/include/linux/platform_data/ltc4245.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Platform Data for LTC4245 hardware monitor chip
- *
- * Copyright (c) 2010 Ira W. Snyder <iws@ovro.caltech.edu>
- */
-
-#ifndef LINUX_LTC4245_H
-#define LINUX_LTC4245_H
-
-#include <linux/types.h>
-
-struct ltc4245_platform_data {
-	bool use_extra_gpios;
-};
-
-#endif /* LINUX_LTC4245_H */
-- 
2.45.2


  parent reply	other threads:[~2026-11-10 18:34 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 18:34 [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Guenter Roeck
2026-11-10 18:34 ` [PATCH 01/10] hwmon: (ads7828) Drop platform data support Guenter Roeck
2026-11-10 18:45   ` Arnd Bergmann
2026-11-10 19:40     ` Guenter Roeck
2026-11-10 19:49       ` Arnd Bergmann
2026-11-12 18:25     ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 02/10] hwmon: (emc2305) " Guenter Roeck
2026-11-10 18:56   ` Arnd Bergmann
2026-11-12 19:06     ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 03/10] hwmon: (g762) " Guenter Roeck
2026-11-10 19:09   ` Arnd Bergmann
2026-11-12 19:08     ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 04/10] hwmon: (gsc-hwmon) " Guenter Roeck
2026-11-10 19:11   ` Arnd Bergmann
2026-11-12 19:09     ` Guenter Roeck
2026-11-10 18:34 ` Guenter Roeck [this message]
2026-11-10 18:58   ` [PATCH 05/10] hwmon: (ltc4245) " Arnd Bergmann
2026-11-12 19:11     ` Guenter Roeck
2026-11-11  9:54   ` Nuno Sá
2026-11-10 18:34 ` [PATCH 06/10] hwmon: (mcp3021) " Guenter Roeck
2026-11-10 19:12   ` Arnd Bergmann
2026-11-12 19:14     ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 07/10] hwmon: (shtc1) " Guenter Roeck
2026-11-10 19:00   ` Arnd Bergmann
2026-11-12 19:18     ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 08/10] hwmon: (max197) Remove driver Guenter Roeck
2026-11-10 19:02   ` Arnd Bergmann
2026-11-12 19:22     ` Guenter Roeck
2026-11-11  9:49   ` Nuno Sá
2026-11-10 18:34 ` [PATCH 09/10] hwmon: (f75375s) Drop platform data support Guenter Roeck
2026-11-10 19:18   ` Arnd Bergmann
2026-11-10 19:43     ` Guenter Roeck
2026-11-12 19:25     ` Guenter Roeck
2026-11-10 18:34 ` [PATCH 10/10] hwmon: (ds620) " Guenter Roeck
2026-11-10 19:07   ` Arnd Bergmann
2026-11-10 19:41     ` Guenter Roeck
2026-11-12 19:29     ` Guenter Roeck
2026-11-11  9:56   ` Nuno Sá
2026-11-10 19:24 ` [PATCH 00/10] hwmon: Drop unused platform data support and max197 driver Arnd Bergmann
2026-11-10 19:50   ` Guenter Roeck
2026-11-10 20:31     ` Arnd Bergmann
2026-11-12 19:31   ` Guenter Roeck

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=20261110183434.181711-6-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=arnd@arndb.de \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=nuno.sa@analog.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