diff mbox series

[-next] thermal/drivers/int340x/processor_thermal: Switch to use module_pci_driver() macro

Message ID 20220922123141.24042-1-shangxiaojing@huawei.com (mailing list archive)
State Mainlined, archived
Headers show
Series [-next] thermal/drivers/int340x/processor_thermal: Switch to use module_pci_driver() macro | expand

Commit Message

Shang XiaoJing Sept. 22, 2022, 12:31 p.m. UTC
Since pci provides the helper macro module_pci_driver(), we may replace
the module_init/exit with it.

Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
---
 .../int340x_thermal/processor_thermal_device_pci.c  | 13 +------------
 .../processor_thermal_device_pci_legacy.c           | 13 +------------
 2 files changed, 2 insertions(+), 24 deletions(-)

Comments

Rafael J. Wysocki Sept. 24, 2022, 5:23 p.m. UTC | #1
On Thu, Sep 22, 2022 at 1:57 PM Shang XiaoJing <shangxiaojing@huawei.com> wrote:
>
> Since pci provides the helper macro module_pci_driver(), we may replace
> the module_init/exit with it.
>
> Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
> ---
>  .../int340x_thermal/processor_thermal_device_pci.c  | 13 +------------
>  .../processor_thermal_device_pci_legacy.c           | 13 +------------
>  2 files changed, 2 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
> index c2dc4c158b9d..bf1b1cdfade4 100644
> --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
> +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
> @@ -373,18 +373,7 @@ static struct pci_driver proc_thermal_pci_driver = {
>         .driver.pm      = &proc_thermal_pci_pm,
>  };
>
> -static int __init proc_thermal_init(void)
> -{
> -       return pci_register_driver(&proc_thermal_pci_driver);
> -}
> -
> -static void __exit proc_thermal_exit(void)
> -{
> -       pci_unregister_driver(&proc_thermal_pci_driver);
> -}
> -
> -module_init(proc_thermal_init);
> -module_exit(proc_thermal_exit);
> +module_pci_driver(proc_thermal_pci_driver);
>
>  MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
>  MODULE_DESCRIPTION("Processor Thermal Reporting Device Driver");
> diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c
> index 4571a1a53b84..09e032f822f3 100644
> --- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c
> +++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c
> @@ -151,18 +151,7 @@ static struct pci_driver proc_thermal_pci_driver = {
>         .driver.pm      = &proc_thermal_pci_pm,
>  };
>
> -static int __init proc_thermal_init(void)
> -{
> -       return pci_register_driver(&proc_thermal_pci_driver);
> -}
> -
> -static void __exit proc_thermal_exit(void)
> -{
> -       pci_unregister_driver(&proc_thermal_pci_driver);
> -}
> -
> -module_init(proc_thermal_init);
> -module_exit(proc_thermal_exit);
> +module_pci_driver(proc_thermal_pci_driver);
>
>  MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
>  MODULE_DESCRIPTION("Processor Thermal Reporting Device Driver");
> --

Applied as 6.1 material with some edits in the subject and changelog.

Thanks!
diff mbox series

Patch

diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
index c2dc4c158b9d..bf1b1cdfade4 100644
--- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
+++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
@@ -373,18 +373,7 @@  static struct pci_driver proc_thermal_pci_driver = {
 	.driver.pm	= &proc_thermal_pci_pm,
 };
 
-static int __init proc_thermal_init(void)
-{
-	return pci_register_driver(&proc_thermal_pci_driver);
-}
-
-static void __exit proc_thermal_exit(void)
-{
-	pci_unregister_driver(&proc_thermal_pci_driver);
-}
-
-module_init(proc_thermal_init);
-module_exit(proc_thermal_exit);
+module_pci_driver(proc_thermal_pci_driver);
 
 MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
 MODULE_DESCRIPTION("Processor Thermal Reporting Device Driver");
diff --git a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c
index 4571a1a53b84..09e032f822f3 100644
--- a/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c
+++ b/drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci_legacy.c
@@ -151,18 +151,7 @@  static struct pci_driver proc_thermal_pci_driver = {
 	.driver.pm	= &proc_thermal_pci_pm,
 };
 
-static int __init proc_thermal_init(void)
-{
-	return pci_register_driver(&proc_thermal_pci_driver);
-}
-
-static void __exit proc_thermal_exit(void)
-{
-	pci_unregister_driver(&proc_thermal_pci_driver);
-}
-
-module_init(proc_thermal_init);
-module_exit(proc_thermal_exit);
+module_pci_driver(proc_thermal_pci_driver);
 
 MODULE_AUTHOR("Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>");
 MODULE_DESCRIPTION("Processor Thermal Reporting Device Driver");