Skip to contentSkip to conversation

watchdog: intel-mid_wdt: header and code cleanups

PATCH In review Andy Shevchenko 2 participants 7 messages Mar 5, 2024

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/3 watchdog: intel-mid_wdt: Remove unused intel-mid.h

In reply to Andy Shevchenko

intel-mid.h is providing some core parts of the South Complex PM, which are usually are not used by individual drivers. In particular, this driver doesn't use it, so simply remove the unused header.

---
 drivers/watchdog/intel-mid_wdt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/watchdog/intel-mid_wdt.c +0 -1
index fb7fae750181..b41c45582aa4 100644
@@ -17,7 +17,6 @@
 #include <linux/platform_data/intel-mid_wdt.h>
 
 #include <asm/intel_scu_ipc.h>
-#include <asm/intel-mid.h>
 
 #define IPC_WATCHDOG 0xf8
 
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#3 lore raw

PATCH 2/3 watchdog: intel-mid_wdt: Don't use "proxy" headers

In reply to Andy Shevchenko

Update header inclusions to follow IWYU (Include What You Use) principle.

---
 drivers/watchdog/intel-mid_wdt.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/watchdog/intel-mid_wdt.c +7 -1
index b41c45582aa4..06d5d207a065 100644
@@ -9,11 +9,17 @@
  *      Contact: David Cohen <[email protected]>
  */
 
+#include <linux/bitops.h>
+#include <linux/device.h>
+#include <linux/errno.h>
 #include <linux/interrupt.h>
+#include <linux/math.h>
 #include <linux/module.h>
-#include <linux/nmi.h>
+#include <linux/panic.h>
 #include <linux/platform_device.h>
+#include <linux/types.h>
 #include <linux/watchdog.h>
+
 #include <linux/platform_data/intel-mid_wdt.h>
 
 #include <asm/intel_scu_ipc.h>
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#0 lore raw

cover watchdog: intel-mid_wdt: header and code cleanups

A few cleanups against the driver, mostly making an order in the header inclusions.

Andy Shevchenko (3):
watchdog: intel-mid_wdt: Remove unused intel-mid.h
watchdog: intel-mid_wdt: Don't use "proxy" headers
watchdog: intel-mid_wdt: Get platform data via dev_get_platdata()

 drivers/watchdog/intel-mid_wdt.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
#5 lore raw

PATCH 3/3 watchdog: intel-mid_wdt: Get platform data via dev_get_platdata()

Access to platform data via dev_get_platdata() getter to make code cleaner.

---
 drivers/watchdog/intel-mid_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/intel-mid_wdt.c +1 -1
index 06d5d207a065..8d71f6a2236b 100644
@@ -127,7 +127,7 @@ static int mid_wdt_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct watchdog_device *wdt_dev;
-	struct intel_mid_wdt_pdata *pdata = dev->platform_data;
+	struct intel_mid_wdt_pdata *pdata = dev_get_platdata(dev);
 	struct mid_wdt *mid;
 	int ret;
 
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
maintainer Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH v1 1/3] watchdog: intel-mid_wdt: Remove unused intel-mid.h

In reply to Andy Shevchenko
Quoted 5 lines · Andy Shevchenko

intel-mid.h is providing some core parts of the South Complex PM, which are usually are not used by individual drivers. In particular, this driver doesn't use it, so simply remove the unused header.

Quoted 19 lines
---
 drivers/watchdog/intel-mid_wdt.c | 1 -
 1 file changed, 1 deletion(-)
drivers/watchdog/intel-mid_wdt.c +0 -1
index fb7fae750181..b41c45582aa4 100644
@@ -17,7 +17,6 @@
 #include <linux/platform_data/intel-mid_wdt.h>
 
 #include <asm/intel_scu_ipc.h>
-#include <asm/intel-mid.h>
 
 #define IPC_WATCHDOG 0xf8
 
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
maintainer Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH v1 2/3] watchdog: intel-mid_wdt: Don't use "proxy" headers

In reply to Andy Shevchenko
Quoted 4 lines · Andy Shevchenko

Update header inclusions to follow IWYU (Include What You Use) principle.

Quoted 30 lines
---
 drivers/watchdog/intel-mid_wdt.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/watchdog/intel-mid_wdt.c +7 -1
index b41c45582aa4..06d5d207a065 100644
@@ -9,11 +9,17 @@
  *      Contact: David Cohen <[email protected]>
  */
 
+#include <linux/bitops.h>
+#include <linux/device.h>
+#include <linux/errno.h>
 #include <linux/interrupt.h>
+#include <linux/math.h>
 #include <linux/module.h>
-#include <linux/nmi.h>
+#include <linux/panic.h>
 #include <linux/platform_device.h>
+#include <linux/types.h>
 #include <linux/watchdog.h>
+
 #include <linux/platform_data/intel-mid_wdt.h>
 
 #include <asm/intel_scu_ipc.h>
Signature · 1 line
2.43.0.rc1.1.gbec44491f096
maintainer Reviewed-by on v1 3/3
#6 lore raw

Re: [PATCH v1 3/3] watchdog: intel-mid_wdt: Get platform data via dev_get_platdata()

In reply to Andy Shevchenko
Quoted 3 lines · Andy Shevchenko

Access to platform data via dev_get_platdata() getter to make code cleaner.

Quoted 20 lines
---
 drivers/watchdog/intel-mid_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/intel-mid_wdt.c +1 -1
index 06d5d207a065..8d71f6a2236b 100644
@@ -127,7 +127,7 @@ static int mid_wdt_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct watchdog_device *wdt_dev;
-	struct intel_mid_wdt_pdata *pdata = dev->platform_data;
+	struct intel_mid_wdt_pdata *pdata = dev_get_platdata(dev);
 	struct mid_wdt *mid;
 	int ret;
 
Signature · 1 line
2.43.0.rc1.1.gbec44491f096