All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Jean Delvare <jdelvare@suse.com>, Wolfram Sang <wsa@kernel.org>
Cc: "linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Subject: [PATCH v3] i2c: i801: Improve handling platform data for tco device
Date: Mon, 29 Nov 2021 20:53:14 +0100	[thread overview]
Message-ID: <85361e7d-f2fd-6199-71f3-3f7a749b1677@gmail.com> (raw)
In-Reply-To: <e46ac7c1-1bb0-2caf-58e6-2fcaa89d30ae@gmail.com>

The platform data structures are used in the respective i801_add_tco
functions only. Therefore we can make the definitions local to these
functions.

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
v3:
- rebased
---
 drivers/i2c/busses/i2c-i801.c | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 8c0695956..cb6e55758 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -1463,15 +1463,14 @@ static inline unsigned int i801_get_adapter_class(struct i801_priv *priv)
 }
 #endif
 
-static const struct itco_wdt_platform_data spt_tco_platform_data = {
-	.name = "Intel PCH",
-	.version = 4,
-};
-
 static struct platform_device *
 i801_add_tco_spt(struct i801_priv *priv, struct pci_dev *pci_dev,
 		 struct resource *tco_res)
 {
+	static const struct itco_wdt_platform_data pldata = {
+		.name = "Intel PCH",
+		.version = 4,
+	};
 	struct resource *res;
 	unsigned int devfn;
 	u64 base64_addr;
@@ -1514,22 +1513,20 @@ i801_add_tco_spt(struct i801_priv *priv, struct pci_dev *pci_dev,
 	res->flags = IORESOURCE_MEM;
 
 	return platform_device_register_resndata(&pci_dev->dev, "iTCO_wdt", -1,
-					tco_res, 2, &spt_tco_platform_data,
-					sizeof(spt_tco_platform_data));
+					tco_res, 2, &pldata, sizeof(pldata));
 }
 
-static const struct itco_wdt_platform_data cnl_tco_platform_data = {
-	.name = "Intel PCH",
-	.version = 6,
-};
-
 static struct platform_device *
 i801_add_tco_cnl(struct i801_priv *priv, struct pci_dev *pci_dev,
 		 struct resource *tco_res)
 {
-	return platform_device_register_resndata(&pci_dev->dev,
-			"iTCO_wdt", -1, tco_res, 1, &cnl_tco_platform_data,
-			sizeof(cnl_tco_platform_data));
+	static const struct itco_wdt_platform_data pldata = {
+		.name = "Intel PCH",
+		.version = 6,
+	};
+
+	return platform_device_register_resndata(&pci_dev->dev, "iTCO_wdt", -1,
+						 tco_res, 1, &pldata, sizeof(pldata));
 }
 
 static void i801_add_tco(struct i801_priv *priv)
-- 
2.34.1


      parent reply	other threads:[~2021-11-29 22:18 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 21:10 [PATCH v2 0/9] i2c: i801: Series with improvements Heiner Kallweit
2021-08-06 21:12 ` [PATCH v2 1/9] i2c: i801: Improve disabling runtime pm Heiner Kallweit
2021-08-10 20:37   ` Wolfram Sang
2021-08-11 15:41   ` Andy Shevchenko
2021-08-11 20:03     ` Heiner Kallweit
2021-08-12  9:48       ` Andy Shevchenko
2021-08-17 20:15         ` Wolfram Sang
2021-08-26 14:00           ` Jean Delvare
2021-08-26 14:34             ` Andy Shevchenko
2021-08-31  6:05             ` Heiner Kallweit
2021-08-31 11:26               ` Jean Delvare
2021-08-31 20:43                 ` Heiner Kallweit
2021-09-01  6:22                   ` Heiner Kallweit
2021-08-06 21:13 ` [PATCH v2 2/9] i2c: i801: make p2sb_spinlock a mutex Heiner Kallweit
2021-08-10 20:38   ` Wolfram Sang
2021-08-11 15:43   ` Andy Shevchenko
2021-08-11 20:27     ` Heiner Kallweit
2021-08-12  9:53       ` Andy Shevchenko
2021-08-06 21:14 ` [PATCH v2 3/9] i2c: i801: Remove not needed debug message Heiner Kallweit
2021-08-10 20:39   ` Wolfram Sang
2021-08-06 21:15 ` [PATCH v2 4/9] i2c: i801: Improve is_dell_system_with_lis3lv02d Heiner Kallweit
2021-08-11 15:45   ` Andy Shevchenko
2021-08-11 20:28     ` Heiner Kallweit
2021-08-12  9:55       ` Andy Shevchenko
2021-08-26 14:19         ` Jean Delvare
2021-08-26 13:21   ` Jean Delvare
2021-09-29 19:38   ` Wolfram Sang
2021-08-06 21:15 ` [PATCH v2 5/9] i2c: i801: Remove not needed check for PCI_COMMAND_INTX_DISABLE Heiner Kallweit
2021-08-11 15:46   ` Andy Shevchenko
2021-08-26 15:18   ` Jean Delvare
2021-09-29 19:38   ` Wolfram Sang
2021-08-06 21:16 ` [PATCH v2 6/9] i2c: i801: Improve i801_acpi_probe/remove functions Heiner Kallweit
2021-09-29 19:38   ` Wolfram Sang
2021-08-06 21:17 ` [PATCH v2 7/9] i2c: i801: Improve i801_add_mux Heiner Kallweit
2021-09-29 19:38   ` Wolfram Sang
2021-08-06 21:18 ` [PATCH v2 8/9] i2c: i801: Improve register_dell_lis3lv02d_i2c_device Heiner Kallweit
2021-08-11 15:52   ` Andy Shevchenko
2021-08-11 21:05     ` Heiner Kallweit
2021-08-12  9:57       ` Andy Shevchenko
2021-08-27 16:21       ` Jean Delvare
2021-09-29 20:11         ` Wolfram Sang
2021-10-01 11:46           ` Jean Delvare
2021-08-06 21:18 ` [PATCH v2 9/9] i2c: i801: Improve handling platform data for tco device Heiner Kallweit
2021-08-11 15:53   ` Andy Shevchenko
2021-10-02  7:44   ` Wolfram Sang
2021-11-29  8:58     ` Wolfram Sang
2021-11-29 19:54       ` Heiner Kallweit
2021-11-29 19:53 ` Heiner Kallweit [this message]

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=85361e7d-f2fd-6199-71f3-3f7a749b1677@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=wsa@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.