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>
Subject: [PATCH 03/10] hwmon: (g762) Drop platform data support
Date: Tue, 10 Nov 2026 10:34:26 -0800	[thread overview]
Message-ID: <20261110183434.181711-4-linux@roeck-us.net> (raw)
In-Reply-To: <20261110183434.181711-1-linux@roeck-us.net>

There are no in-tree users of g762_platform_data. All hardware
parameters configurable through platform data (input clock, fan gear
mode, PWM polarity, and fan startup voltage) are already configurable
via devicetree properties.

Drop platform data support and the now-unnecessary CONFIG_OF guards from
the driver, remove the unused platform_data header file, and update the
driver documentation.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 Documentation/hwmon/g762.rst       |  4 +--
 drivers/hwmon/g762.c               | 50 ++----------------------------
 include/linux/platform_data/g762.h | 24 --------------
 3 files changed, 3 insertions(+), 75 deletions(-)
 delete mode 100644 include/linux/platform_data/g762.h

diff --git a/Documentation/hwmon/g762.rst b/Documentation/hwmon/g762.rst
index f224552a2d3c..6c95040870b6 100644
--- a/Documentation/hwmon/g762.rst
+++ b/Documentation/hwmon/g762.rst
@@ -17,9 +17,7 @@ done via a userland daemon like fancontrol.
 Note that those entries do not provide ways to setup the specific
 hardware characteristics of the system (reference clock, pulses per
 fan revolution, ...); Those can be modified via devicetree bindings
-documented in Documentation/devicetree/bindings/hwmon/gmt,g762.yaml or
-using a specific platform_data structure in board initialization
-file (see include/linux/platform_data/g762.h).
+documented in Documentation/devicetree/bindings/hwmon/gmt,g762.yaml.
 
   fan1_target:
 	    set desired fan speed. This only makes sense in closed-loop
diff --git a/drivers/hwmon/g762.c b/drivers/hwmon/g762.c
index 1a4aeb6db7d4..26ab00f4d130 100644
--- a/drivers/hwmon/g762.c
+++ b/drivers/hwmon/g762.c
@@ -39,7 +39,6 @@
 #include <linux/kernel.h>
 #include <linux/clk.h>
 #include <linux/of.h>
-#include <linux/platform_data/g762.h>
 
 #define DRVNAME "g762"
 
@@ -568,7 +567,6 @@ static int do_set_fan_startv(struct device *dev, unsigned long val)
  * those to the chip.
  */
 
-#ifdef CONFIG_OF
 static const struct of_device_id g762_dt_match[] = {
 	{ .compatible = "gmt,g761" },
 	{ .compatible = "gmt,g762" },
@@ -695,46 +693,6 @@ static int g762_of_prop_import(struct i2c_client *client)
 				       do_set_fan_startv);
 }
 
-#else
-static int g762_of_prop_import(struct i2c_client *client)
-{
-	return 0;
-}
-
-static int g762_of_clock_enable(struct i2c_client *client)
-{
-	return 0;
-}
-#endif
-
-/*
- * Helper to import hardware characteristics from .dts file and push
- * those to the chip.
- */
-
-static int g762_pdata_prop_import(struct i2c_client *client)
-{
-	struct g762_platform_data *pdata = dev_get_platdata(&client->dev);
-	int ret;
-
-	if (!pdata)
-		return 0;
-
-	ret = do_set_fan_gear_mode(&client->dev, pdata->fan_gear_mode);
-	if (ret)
-		return ret;
-
-	ret = do_set_pwm_polarity(&client->dev, pdata->pwm_polarity);
-	if (ret)
-		return ret;
-
-	ret = do_set_fan_startv(&client->dev, pdata->fan_startv);
-	if (ret)
-		return ret;
-
-	return do_set_clk_freq(&client->dev, pdata->clk_freq);
-}
-
 /*
  * sysfs attributes
  */
@@ -1085,7 +1043,7 @@ static int g762_probe(struct i2c_client *client)
 	data->client = client;
 	mutex_init(&data->update_lock);
 
-	/* Get configuration via DT ... */
+	/* Get configuration via DT */
 	ret = g762_of_clock_enable(client);
 	if (ret)
 		return ret;
@@ -1096,10 +1054,6 @@ static int g762_probe(struct i2c_client *client)
 		return ret;
 
 	ret = g762_of_prop_import(client);
-	if (ret)
-		return ret;
-	/* ... or platform_data */
-	ret = g762_pdata_prop_import(client);
 	if (ret)
 		return ret;
 
@@ -1111,7 +1065,7 @@ static int g762_probe(struct i2c_client *client)
 static struct i2c_driver g762_driver = {
 	.driver = {
 		.name = DRVNAME,
-		.of_match_table = of_match_ptr(g762_dt_match),
+		.of_match_table = g762_dt_match,
 	},
 	.probe = g762_probe,
 	.id_table = g762_id,
diff --git a/include/linux/platform_data/g762.h b/include/linux/platform_data/g762.h
deleted file mode 100644
index 249257ee2132..000000000000
--- a/include/linux/platform_data/g762.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Platform data structure for g762 fan controller driver
- *
- * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
- */
-#ifndef __LINUX_PLATFORM_DATA_G762_H__
-#define __LINUX_PLATFORM_DATA_G762_H__
-
-/*
- * Following structure can be used to set g762 driver platform specific data
- * during board init. Note that passing a sparse structure is possible but
- * will result in non-specified attributes to be set to default value, hence
- * overloading those installed during boot (e.g. by u-boot).
- */
-
-struct g762_platform_data {
-	u32 fan_startv;
-	u32 fan_gear_mode;
-	u32 pwm_polarity;
-	u32 clk_freq;
-};
-
-#endif /* __LINUX_PLATFORM_DATA_G762_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 ` Guenter Roeck [this message]
2026-11-10 19:09   ` [PATCH 03/10] hwmon: (g762) " 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 ` [PATCH 05/10] hwmon: (ltc4245) " Guenter Roeck
2026-11-10 18:58   ` 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-4-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=arnd@arndb.de \
    --cc=linux-hwmon@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