linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] hwmon: (it87) Minor cleanups for future development
@ 2023-01-21  8:57 Frank Crawford
  2023-01-21  8:57 ` [PATCH v1 1/2] hwmon: (it87) Group all related MODULE_PARM definitions together Frank Crawford
  2023-01-21  8:57 ` [PATCH v1 2/2] hwmon: (it87) Added driver version to distinguish from dev version Frank Crawford
  0 siblings, 2 replies; 6+ messages in thread
From: Frank Crawford @ 2023-01-21  8:57 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck; +Cc: linux-hwmon, Frank Crawford

Minor cleanups to make future management easier by
- grouping together all the MODULE_PARM definitions, and
- log a DRIVER_VERSION to distinguish the in-tree version from any
  development versions.

---

Frank Crawford (2):
  Group all related MODULE_PARM definitions together
  Added driver version to distinguish from dev version

 drivers/hwmon/it87.c | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

-- 
2.39.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v1 1/2] hwmon: (it87) Group all related MODULE_PARM definitions together
  2023-01-21  8:57 [PATCH v1 0/2] hwmon: (it87) Minor cleanups for future development Frank Crawford
@ 2023-01-21  8:57 ` Frank Crawford
  2023-01-24 13:51   ` Guenter Roeck
  2023-01-21  8:57 ` [PATCH v1 2/2] hwmon: (it87) Added driver version to distinguish from dev version Frank Crawford
  1 sibling, 1 reply; 6+ messages in thread
From: Frank Crawford @ 2023-01-21  8:57 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck; +Cc: linux-hwmon, Frank Crawford

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(-)

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);
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v1 2/2] hwmon: (it87) Added driver version to distinguish from dev version
  2023-01-21  8:57 [PATCH v1 0/2] hwmon: (it87) Minor cleanups for future development Frank Crawford
  2023-01-21  8:57 ` [PATCH v1 1/2] hwmon: (it87) Group all related MODULE_PARM definitions together Frank Crawford
@ 2023-01-21  8:57 ` Frank Crawford
  2023-01-21 14:04   ` Guenter Roeck
  1 sibling, 1 reply; 6+ messages in thread
From: Frank Crawford @ 2023-01-21  8:57 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck; +Cc: linux-hwmon, Frank Crawford

Add a driver version and log it on load, to make it easier to
distinguish between the in-tree version and any development version from
an external source.

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

diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index a8a6a0ffee82..632ab3d50bc6 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -59,6 +59,8 @@
 #include <linux/acpi.h>
 #include <linux/io.h>
 
+#define IT87_DRIVER_VERSION "v1.0-official"
+
 #define DRVNAME "it87"
 
 enum chips { it87, it8712, it8716, it8718, it8720, it8721, it8728, it8732,
@@ -3398,6 +3400,8 @@ static int __init sm_it87_init(void)
 	bool found = false;
 	int i, err;
 
+	pr_info("it87 driver version %s\n", IT87_DRIVER_VERSION);
+
 	err = platform_driver_register(&it87_driver);
 	if (err)
 		return err;
@@ -3470,6 +3474,7 @@ MODULE_PARM_DESC(fix_pwm_polarity,
 		 "Force PWM polarity to active high (DANGEROUS)");
 
 MODULE_LICENSE("GPL");
+MODULE_VERSION(IT87_DRIVER_VERSION);
 
 module_init(sm_it87_init);
 module_exit(sm_it87_exit);
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 2/2] hwmon: (it87) Added driver version to distinguish from dev version
  2023-01-21  8:57 ` [PATCH v1 2/2] hwmon: (it87) Added driver version to distinguish from dev version Frank Crawford
@ 2023-01-21 14:04   ` Guenter Roeck
  2023-01-21 23:30     ` Frank Crawford
  0 siblings, 1 reply; 6+ messages in thread
From: Guenter Roeck @ 2023-01-21 14:04 UTC (permalink / raw)
  To: Frank Crawford, Jean Delvare; +Cc: linux-hwmon

On 1/21/23 00:57, Frank Crawford wrote:
> Add a driver version and log it on load, to make it easier to
> distinguish between the in-tree version and any development version from
> an external source.
> 

Sorry, no. Name your out of tree version as you want.

Guenter

> Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
> ---
>   drivers/hwmon/it87.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
> index a8a6a0ffee82..632ab3d50bc6 100644
> --- a/drivers/hwmon/it87.c
> +++ b/drivers/hwmon/it87.c
> @@ -59,6 +59,8 @@
>   #include <linux/acpi.h>
>   #include <linux/io.h>
>   
> +#define IT87_DRIVER_VERSION "v1.0-official"
> +
>   #define DRVNAME "it87"
>   
>   enum chips { it87, it8712, it8716, it8718, it8720, it8721, it8728, it8732,
> @@ -3398,6 +3400,8 @@ static int __init sm_it87_init(void)
>   	bool found = false;
>   	int i, err;
>   
> +	pr_info("it87 driver version %s\n", IT87_DRIVER_VERSION);
> +
>   	err = platform_driver_register(&it87_driver);
>   	if (err)
>   		return err;
> @@ -3470,6 +3474,7 @@ MODULE_PARM_DESC(fix_pwm_polarity,
>   		 "Force PWM polarity to active high (DANGEROUS)");
>   
>   MODULE_LICENSE("GPL");
> +MODULE_VERSION(IT87_DRIVER_VERSION);
>   
>   module_init(sm_it87_init);
>   module_exit(sm_it87_exit);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 2/2] hwmon: (it87) Added driver version to distinguish from dev version
  2023-01-21 14:04   ` Guenter Roeck
@ 2023-01-21 23:30     ` Frank Crawford
  0 siblings, 0 replies; 6+ messages in thread
From: Frank Crawford @ 2023-01-21 23:30 UTC (permalink / raw)
  To: Guenter Roeck, Jean Delvare; +Cc: linux-hwmon

On Sat, 2023-01-21 at 06:04 -0800, Guenter Roeck wrote:
> On 1/21/23 00:57, Frank Crawford wrote:
> > Add a driver version and log it on load, to make it easier to
> > distinguish between the in-tree version and any development version
> > from
> > an external source.
> > 
> 
> Sorry, no. Name your out of tree version as you want.

Okay, fair enough.

Do you want the other patch in the set resubmitted separately, or will
you assess it as is?

> 
> Guenter

Regards
Frank
> 
> > Signed-off-by: Frank Crawford <frank@crawford.emu.id.au>
> > ---
> >   drivers/hwmon/it87.c | 5 +++++
> >   1 file changed, 5 insertions(+)
> > 
> > diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
> > index a8a6a0ffee82..632ab3d50bc6 100644
> > --- a/drivers/hwmon/it87.c
> > +++ b/drivers/hwmon/it87.c
> > @@ -59,6 +59,8 @@
> >   #include <linux/acpi.h>
> >   #include <linux/io.h>
> >   
> > +#define IT87_DRIVER_VERSION "v1.0-official"
> > +
> >   #define DRVNAME "it87"
> >   
> >   enum chips { it87, it8712, it8716, it8718, it8720, it8721,
> > it8728, it8732,
> > @@ -3398,6 +3400,8 @@ static int __init sm_it87_init(void)
> >         bool found = false;
> >         int i, err;
> >   
> > +       pr_info("it87 driver version %s\n", IT87_DRIVER_VERSION);
> > +
> >         err = platform_driver_register(&it87_driver);
> >         if (err)
> >                 return err;
> > @@ -3470,6 +3474,7 @@ MODULE_PARM_DESC(fix_pwm_polarity,
> >                  "Force PWM polarity to active high (DANGEROUS)");
> >   
> >   MODULE_LICENSE("GPL");
> > +MODULE_VERSION(IT87_DRIVER_VERSION);
> >   
> >   module_init(sm_it87_init);
> >   module_exit(sm_it87_exit);
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1 1/2] hwmon: (it87) Group all related MODULE_PARM definitions together
  2023-01-21  8:57 ` [PATCH v1 1/2] hwmon: (it87) Group all related MODULE_PARM definitions together Frank Crawford
@ 2023-01-24 13:51   ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2023-01-24 13:51 UTC (permalink / raw)
  To: Frank Crawford; +Cc: Jean Delvare, linux-hwmon

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);

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-24 13:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-21  8:57 [PATCH v1 0/2] hwmon: (it87) Minor cleanups for future development Frank Crawford
2023-01-21  8:57 ` [PATCH v1 1/2] hwmon: (it87) Group all related MODULE_PARM definitions together Frank Crawford
2023-01-24 13:51   ` Guenter Roeck
2023-01-21  8:57 ` [PATCH v1 2/2] hwmon: (it87) Added driver version to distinguish from dev version Frank Crawford
2023-01-21 14:04   ` Guenter Roeck
2023-01-21 23:30     ` Frank Crawford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).