linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hwmon: (ads7828) Rename regmap_config variable
@ 2022-08-03 17:43 Jack Champagne
  2022-08-04  6:47 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Jack Champagne @ 2022-08-03 17:43 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, linux-hwmon
  Cc: linux-kernel, Stephen Kitt, Jack Champagne

The regmap_config variable for the ads7828 and the ads7830 are both
misnamed to `ads2828_regmap_config` and `ads2830_regmap_config`
respectively. These variables refer to regmap configs for the ads7828
and the ads7830 and should be named accordingly.

This patch does not introduce functional changes as the only two usages
of these regmap_config variables are within the changed file.

Signed-off-by: Jack Champagne <jackchampagne.r@gmail.com>
---
 drivers/hwmon/ads7828.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c
index 7246198f0901..20bdee769882 100644
--- a/drivers/hwmon/ads7828.c
+++ b/drivers/hwmon/ads7828.c
@@ -89,12 +89,12 @@ static struct attribute *ads7828_attrs[] = {
 
 ATTRIBUTE_GROUPS(ads7828);
 
-static const struct regmap_config ads2828_regmap_config = {
+static const struct regmap_config ads7828_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 16,
 };
 
-static const struct regmap_config ads2830_regmap_config = {
+static const struct regmap_config ads7830_regmap_config = {
 	.reg_bits = 8,
 	.val_bits = 8,
 };
@@ -152,11 +152,11 @@ static int ads7828_probe(struct i2c_client *client)
 	if (chip == ads7828) {
 		data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 4096);
 		data->regmap = devm_regmap_init_i2c(client,
-						    &ads2828_regmap_config);
+						    &ads7828_regmap_config);
 	} else {
 		data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 256);
 		data->regmap = devm_regmap_init_i2c(client,
-						    &ads2830_regmap_config);
+						    &ads7830_regmap_config);
 	}
 
 	if (IS_ERR(data->regmap))
-- 
2.25.1


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

* Re: [PATCH] hwmon: (ads7828) Rename regmap_config variable
  2022-08-03 17:43 [PATCH] hwmon: (ads7828) Rename regmap_config variable Jack Champagne
@ 2022-08-04  6:47 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2022-08-04  6:47 UTC (permalink / raw)
  To: Jack Champagne; +Cc: Jean Delvare, linux-hwmon, linux-kernel, Stephen Kitt

On Wed, Aug 03, 2022 at 01:43:56PM -0400, Jack Champagne wrote:
> The regmap_config variable for the ads7828 and the ads7830 are both
> misnamed to `ads2828_regmap_config` and `ads2830_regmap_config`
> respectively. These variables refer to regmap configs for the ads7828
> and the ads7830 and should be named accordingly.
> 
> This patch does not introduce functional changes as the only two usages
> of these regmap_config variables are within the changed file.
> 
> Signed-off-by: Jack Champagne <jackchampagne.r@gmail.com>

Please refrain from submitting patches with non-functional changes
like this one unless you are also submitting patches with functional
changes.

Guenter

> ---
>  drivers/hwmon/ads7828.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hwmon/ads7828.c b/drivers/hwmon/ads7828.c
> index 7246198f0901..20bdee769882 100644
> --- a/drivers/hwmon/ads7828.c
> +++ b/drivers/hwmon/ads7828.c
> @@ -89,12 +89,12 @@ static struct attribute *ads7828_attrs[] = {
>  
>  ATTRIBUTE_GROUPS(ads7828);
>  
> -static const struct regmap_config ads2828_regmap_config = {
> +static const struct regmap_config ads7828_regmap_config = {
>  	.reg_bits = 8,
>  	.val_bits = 16,
>  };
>  
> -static const struct regmap_config ads2830_regmap_config = {
> +static const struct regmap_config ads7830_regmap_config = {
>  	.reg_bits = 8,
>  	.val_bits = 8,
>  };
> @@ -152,11 +152,11 @@ static int ads7828_probe(struct i2c_client *client)
>  	if (chip == ads7828) {
>  		data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 4096);
>  		data->regmap = devm_regmap_init_i2c(client,
> -						    &ads2828_regmap_config);
> +						    &ads7828_regmap_config);
>  	} else {
>  		data->lsb_resol = DIV_ROUND_CLOSEST(vref_mv * 1000, 256);
>  		data->regmap = devm_regmap_init_i2c(client,
> -						    &ads2830_regmap_config);
> +						    &ads7830_regmap_config);
>  	}
>  
>  	if (IS_ERR(data->regmap))
> -- 
> 2.25.1
> 

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

end of thread, other threads:[~2022-08-04  6:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-03 17:43 [PATCH] hwmon: (ads7828) Rename regmap_config variable Jack Champagne
2022-08-04  6:47 ` Guenter Roeck

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