diff mbox series

[v1,4/5] platform/x86: intel_scu_wdt: Drop SCU notification

Message ID 20210122123201.40935-4-andriy.shevchenko@linux.intel.com (mailing list archive)
State Not Applicable
Headers show
Series [v1,1/5] watchdog: intel_scu_watchdog: Remove driver for deprecated platform | expand

Commit Message

Andy Shevchenko Jan. 22, 2021, 12:32 p.m. UTC
Since SCU code along with the Intel MID watchdog driver has been refactored
in a way that latter will be probed only after the former has been come
to live, the notification code is bogus and not needed. Remove it for good.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/platform/x86/intel_scu_wdt.c | 31 +++++++---------------------
 1 file changed, 7 insertions(+), 24 deletions(-)

Comments

Guenter Roeck Jan. 22, 2021, 2:21 p.m. UTC | #1
On 1/22/21 4:32 AM, Andy Shevchenko wrote:
> Since SCU code along with the Intel MID watchdog driver has been refactored
> in a way that latter will be probed only after the former has been come
> to live, the notification code is bogus and not needed. Remove it for good.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/platform/x86/intel_scu_wdt.c | 31 +++++++---------------------
>  1 file changed, 7 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel_scu_wdt.c b/drivers/platform/x86/intel_scu_wdt.c
> index 227218a8f98e..19f7686a3c19 100644
> --- a/drivers/platform/x86/intel_scu_wdt.c
> +++ b/drivers/platform/x86/intel_scu_wdt.c
> @@ -12,7 +12,6 @@
>  #include <linux/platform_data/intel-mid_wdt.h>
>  
>  #include <asm/intel-mid.h>
> -#include <asm/intel_scu_ipc.h>
>  #include <asm/io_apic.h>
>  #include <asm/hw_irq.h>
>  
> @@ -49,34 +48,18 @@ static struct intel_mid_wdt_pdata tangier_pdata = {
>  	.probe = tangier_probe,
>  };
>  
> -static int wdt_scu_status_change(struct notifier_block *nb,
> -				 unsigned long code, void *data)
> -{
> -	if (code == SCU_DOWN) {
> -		platform_device_unregister(&wdt_dev);
> -		return 0;
> -	}
> -
> -	return platform_device_register(&wdt_dev);
> -}
> -
> -static struct notifier_block wdt_scu_notifier = {
> -	.notifier_call	= wdt_scu_status_change,
> -};
> -
>  static int __init register_mid_wdt(void)
>  {
>  	if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER)
>  		return -ENODEV;
>  
>  	wdt_dev.dev.platform_data = &tangier_pdata;
> -
> -	/*
> -	 * We need to be sure that the SCU IPC is ready before watchdog device
> -	 * can be registered:
> -	 */
> -	intel_scu_notifier_add(&wdt_scu_notifier);
> -
> -	return 0;
> +	return platform_device_register(&wdt_dev);
>  }
>  arch_initcall(register_mid_wdt);
> +
> +static void __exit unregister_mid_wdt(void)
> +{
> +	platform_device_unregister(&wdt_dev);
> +}
> +__exitcall(unregister_mid_wdt);
>
diff mbox series

Patch

diff --git a/drivers/platform/x86/intel_scu_wdt.c b/drivers/platform/x86/intel_scu_wdt.c
index 227218a8f98e..19f7686a3c19 100644
--- a/drivers/platform/x86/intel_scu_wdt.c
+++ b/drivers/platform/x86/intel_scu_wdt.c
@@ -12,7 +12,6 @@ 
 #include <linux/platform_data/intel-mid_wdt.h>
 
 #include <asm/intel-mid.h>
-#include <asm/intel_scu_ipc.h>
 #include <asm/io_apic.h>
 #include <asm/hw_irq.h>
 
@@ -49,34 +48,18 @@  static struct intel_mid_wdt_pdata tangier_pdata = {
 	.probe = tangier_probe,
 };
 
-static int wdt_scu_status_change(struct notifier_block *nb,
-				 unsigned long code, void *data)
-{
-	if (code == SCU_DOWN) {
-		platform_device_unregister(&wdt_dev);
-		return 0;
-	}
-
-	return platform_device_register(&wdt_dev);
-}
-
-static struct notifier_block wdt_scu_notifier = {
-	.notifier_call	= wdt_scu_status_change,
-};
-
 static int __init register_mid_wdt(void)
 {
 	if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER)
 		return -ENODEV;
 
 	wdt_dev.dev.platform_data = &tangier_pdata;
-
-	/*
-	 * We need to be sure that the SCU IPC is ready before watchdog device
-	 * can be registered:
-	 */
-	intel_scu_notifier_add(&wdt_scu_notifier);
-
-	return 0;
+	return platform_device_register(&wdt_dev);
 }
 arch_initcall(register_mid_wdt);
+
+static void __exit unregister_mid_wdt(void)
+{
+	platform_device_unregister(&wdt_dev);
+}
+__exitcall(unregister_mid_wdt);