diff mbox series

[v1,1/2] hwmon: (it87) Group all related MODULE_PARM definitions together

Message ID 20230121085754.1693336-2-frank@crawford.emu.id.au (mailing list archive)
State Accepted
Headers show
Series hwmon: (it87) Minor cleanups for future development | expand

Commit Message

Frank Crawford Jan. 21, 2023, 8:57 a.m. UTC
Group the MODULE_PARM definitions together to make them easier for
future maintenance, rather than having them spread across the file.

Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
---
 drivers/hwmon/it87.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

Comments

Guenter Roeck Jan. 24, 2023, 1:51 p.m. UTC | #1
On Sat, Jan 21, 2023 at 07:57:53PM +1100, Frank Crawford wrote:
> Group the MODULE_PARM definitions together to make them easier for
> future maintenance, rather than having them spread across the file.
> 
> Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>

Applied to hwmon-next.

Guenter

> ---
>  drivers/hwmon/it87.c | 23 +++++++++++++++--------
>  1 file changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
> index ee48e238e46f..a8a6a0ffee82 100644
> --- a/drivers/hwmon/it87.c
> +++ b/drivers/hwmon/it87.c
> @@ -65,14 +65,6 @@ enum chips { it87, it8712, it8716, it8718, it8720, it8721, it8728, it8732,
>  	     it8771, it8772, it8781, it8782, it8783, it8786, it8790,
>  	     it8792, it8603, it8620, it8622, it8628 };
>  
> -static unsigned short force_id;
> -module_param(force_id, ushort, 0);
> -MODULE_PARM_DESC(force_id, "Override the detected device ID");
> -
> -static bool ignore_resource_conflict;
> -module_param(ignore_resource_conflict, bool, 0);
> -MODULE_PARM_DESC(ignore_resource_conflict, "Ignore ACPI resource conflict");
> -
>  static struct platform_device *it87_pdev[2];
>  
>  #define	REG_2E	0x2e	/* The register to read/write */
> @@ -181,6 +173,12 @@ static inline void superio_exit(int ioreg)
>  #define IT87_SIO_VID_REG	0xfc	/* VID value */
>  #define IT87_SIO_BEEP_PIN_REG	0xf6	/* Beep pin mapping */
>  
> +/* Force chip ID to specified value. Should only be used for testing */
> +static unsigned short force_id;
> +
> +/* ACPI resource conflicts are ignored if this parameter is set to 1 */
> +static bool ignore_resource_conflict;
> +
>  /* Update battery voltage after every reading if true */
>  static bool update_vbat;
>  
> @@ -3457,11 +3455,20 @@ static void __exit sm_it87_exit(void)
>  
>  MODULE_AUTHOR("Chris Gauthron, Jean Delvare <jdelvare@suse.de>");
>  MODULE_DESCRIPTION("IT8705F/IT871xF/IT872xF hardware monitoring driver");
> +
> +module_param(force_id, ushort, 0);
> +MODULE_PARM_DESC(force_id, "Override the detected device ID");
> +
> +module_param(ignore_resource_conflict, bool, 0);
> +MODULE_PARM_DESC(ignore_resource_conflict, "Ignore ACPI resource conflict");
> +
>  module_param(update_vbat, bool, 0);
>  MODULE_PARM_DESC(update_vbat, "Update vbat if set else return powerup value");
> +
>  module_param(fix_pwm_polarity, bool, 0);
>  MODULE_PARM_DESC(fix_pwm_polarity,
>  		 "Force PWM polarity to active high (DANGEROUS)");
> +
>  MODULE_LICENSE("GPL");
>  
>  module_init(sm_it87_init);
diff mbox series

Patch

diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index ee48e238e46f..a8a6a0ffee82 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -65,14 +65,6 @@  enum chips { it87, it8712, it8716, it8718, it8720, it8721, it8728, it8732,
 	     it8771, it8772, it8781, it8782, it8783, it8786, it8790,
 	     it8792, it8603, it8620, it8622, it8628 };
 
-static unsigned short force_id;
-module_param(force_id, ushort, 0);
-MODULE_PARM_DESC(force_id, "Override the detected device ID");
-
-static bool ignore_resource_conflict;
-module_param(ignore_resource_conflict, bool, 0);
-MODULE_PARM_DESC(ignore_resource_conflict, "Ignore ACPI resource conflict");
-
 static struct platform_device *it87_pdev[2];
 
 #define	REG_2E	0x2e	/* The register to read/write */
@@ -181,6 +173,12 @@  static inline void superio_exit(int ioreg)
 #define IT87_SIO_VID_REG	0xfc	/* VID value */
 #define IT87_SIO_BEEP_PIN_REG	0xf6	/* Beep pin mapping */
 
+/* Force chip ID to specified value. Should only be used for testing */
+static unsigned short force_id;
+
+/* ACPI resource conflicts are ignored if this parameter is set to 1 */
+static bool ignore_resource_conflict;
+
 /* Update battery voltage after every reading if true */
 static bool update_vbat;
 
@@ -3457,11 +3455,20 @@  static void __exit sm_it87_exit(void)
 
 MODULE_AUTHOR("Chris Gauthron, Jean Delvare <jdelvare@suse.de>");
 MODULE_DESCRIPTION("IT8705F/IT871xF/IT872xF hardware monitoring driver");
+
+module_param(force_id, ushort, 0);
+MODULE_PARM_DESC(force_id, "Override the detected device ID");
+
+module_param(ignore_resource_conflict, bool, 0);
+MODULE_PARM_DESC(ignore_resource_conflict, "Ignore ACPI resource conflict");
+
 module_param(update_vbat, bool, 0);
 MODULE_PARM_DESC(update_vbat, "Update vbat if set else return powerup value");
+
 module_param(fix_pwm_polarity, bool, 0);
 MODULE_PARM_DESC(fix_pwm_polarity,
 		 "Force PWM polarity to active high (DANGEROUS)");
+
 MODULE_LICENSE("GPL");
 
 module_init(sm_it87_init);