Skip to contentSkip to conversation

staging: iio: addac: fix CamelCase naming in adt7316

PATCH In review Jad Keskes 3 participants 3 messages Jun 2 – Jun 3

Subsystems (4)
lore
Share & tools
lore

Jad Keskes

author
#0 lore raw

PATCH v2 1/1 staging: iio: addac: fix CamelCase naming in adt7316

checkpatch flagged a few CamelCase names in this driver. AIN and DAC prefixes are lowercased as standard kernel style. Vref is kept capitalized since V stands for Voltage and is a proper technical abbreviation.

DA_AB and DA_CD are renamed to dac_ab and dac_cd to match the register constants ADT7316_VREF_BYPASS_DAC_AB and ADT7316_VREF_BYPASS_DAC_CD that they reference.

---
 drivers/staging/iio/addac/adt7316.c | 64 ++++++++++++++---------------
 1 file changed, 32 insertions(+), 32 deletions(-)
drivers/staging/iio/addac/adt7316.c +32 -32
index 8a9a8262c..b5d62f1d3 100644
@@ -663,7 +663,7 @@ static IIO_DEVICE_ATTR(da_high_resolution, 0644,
 		adt7316_store_da_high_resolution,
 		0);
 
-static ssize_t adt7316_show_AIN_internal_Vref(struct device *dev,
+static ssize_t adt7316_show_ain_internal_Vref(struct device *dev,
 					      struct device_attribute *attr,
 					      char *buf)
 {
@@ -677,7 +677,7 @@ static ssize_t adt7316_show_AIN_internal_Vref(struct device *dev,
 		!!(chip->config3 & ADT7516_AIN_IN_VREF));
 }
 
-static ssize_t adt7316_store_AIN_internal_Vref(struct device *dev,
+static ssize_t adt7316_store_ain_internal_Vref(struct device *dev,
 					       struct device_attribute *attr,
 					       const char *buf,
 					       size_t len)
@@ -704,9 +704,9 @@ static ssize_t adt7316_store_AIN_internal_Vref(struct device *dev,
 	return len;
 }
 
-static IIO_DEVICE_ATTR(AIN_internal_Vref, 0644,
-		adt7316_show_AIN_internal_Vref,
-		adt7316_store_AIN_internal_Vref,
+static IIO_DEVICE_ATTR(ain_internal_Vref, 0644,
+		adt7316_show_ain_internal_Vref,
+		adt7316_store_ain_internal_Vref,
 		0);
 
 static ssize_t adt7316_show_enable_prop_DACA(struct device *dev,
@@ -787,7 +787,7 @@ static IIO_DEVICE_ATTR(enable_proportion_DACB, 0644,
 		       adt7316_store_enable_prop_DACB,
 		       0);
 
-static ssize_t adt7316_show_DAC_2Vref_ch_mask(struct device *dev,
+static ssize_t adt7316_show_dac_2Vref_ch_mask(struct device *dev,
 					      struct device_attribute *attr,
 					      char *buf)
 {
@@ -798,7 +798,7 @@ static ssize_t adt7316_show_DAC_2Vref_ch_mask(struct device *dev,
 		chip->dac_config & ADT7316_DA_2VREF_CH_MASK);
 }
 
-static ssize_t adt7316_store_DAC_2Vref_ch_mask(struct device *dev,
+static ssize_t adt7316_store_dac_2Vref_ch_mask(struct device *dev,
 					       struct device_attribute *attr,
 					       const char *buf,
 					       size_t len)
@@ -825,9 +825,9 @@ static ssize_t adt7316_store_DAC_2Vref_ch_mask(struct device *dev,
 	return len;
 }
 
-static IIO_DEVICE_ATTR(DAC_2Vref_channels_mask, 0644,
-		       adt7316_show_DAC_2Vref_ch_mask,
-		       adt7316_store_DAC_2Vref_ch_mask,
+static IIO_DEVICE_ATTR(dac_2Vref_channels_mask, 0644,
+		       adt7316_show_dac_2Vref_ch_mask,
+		       adt7316_store_dac_2Vref_ch_mask,
 		       0);
 
 static ssize_t adt7316_show_DAC_update_mode(struct device *dev,
@@ -948,7 +948,7 @@ static IIO_DEVICE_ATTR(update_DAC, 0644,
 		       adt7316_store_update_DAC,
 		       0);
 
-static ssize_t adt7316_show_DA_AB_Vref_bypass(struct device *dev,
+static ssize_t adt7316_show_dac_ab_Vref_bypass(struct device *dev,
 					      struct device_attribute *attr,
 					      char *buf)
 {
@@ -959,7 +959,7 @@ static ssize_t adt7316_show_DA_AB_Vref_bypass(struct device *dev,
 		!!(chip->dac_config & ADT7316_VREF_BYPASS_DAC_AB));
 }
 
-static ssize_t adt7316_store_DA_AB_Vref_bypass(struct device *dev,
+static ssize_t adt7316_store_dac_ab_Vref_bypass(struct device *dev,
 					       struct device_attribute *attr,
 					       const char *buf,
 					       size_t len)
@@ -982,12 +982,12 @@ static ssize_t adt7316_store_DA_AB_Vref_bypass(struct device *dev,
 	return len;
 }
 
-static IIO_DEVICE_ATTR(DA_AB_Vref_bypass, 0644,
-		       adt7316_show_DA_AB_Vref_bypass,
-		       adt7316_store_DA_AB_Vref_bypass,
+static IIO_DEVICE_ATTR(dac_ab_Vref_bypass, 0644,
+		       adt7316_show_dac_ab_Vref_bypass,
+		       adt7316_store_dac_ab_Vref_bypass,
 		       0);
 
-static ssize_t adt7316_show_DA_CD_Vref_bypass(struct device *dev,
+static ssize_t adt7316_show_dac_cd_Vref_bypass(struct device *dev,
 					      struct device_attribute *attr,
 					      char *buf)
 {
@@ -998,7 +998,7 @@ static ssize_t adt7316_show_DA_CD_Vref_bypass(struct device *dev,
 		!!(chip->dac_config & ADT7316_VREF_BYPASS_DAC_CD));
 }
 
-static ssize_t adt7316_store_DA_CD_Vref_bypass(struct device *dev,
+static ssize_t adt7316_store_dac_cd_Vref_bypass(struct device *dev,
 					       struct device_attribute *attr,
 					       const char *buf,
 					       size_t len)
@@ -1021,12 +1021,12 @@ static ssize_t adt7316_store_DA_CD_Vref_bypass(struct device *dev,
 	return len;
 }
 
-static IIO_DEVICE_ATTR(DA_CD_Vref_bypass, 0644,
-		       adt7316_show_DA_CD_Vref_bypass,
-		       adt7316_store_DA_CD_Vref_bypass,
+static IIO_DEVICE_ATTR(dac_cd_Vref_bypass, 0644,
+		       adt7316_show_dac_cd_Vref_bypass,
+		       adt7316_store_dac_cd_Vref_bypass,
 		       0);
 
-static ssize_t adt7316_show_DAC_internal_Vref(struct device *dev,
+static ssize_t adt7316_show_dac_internal_Vref(struct device *dev,
 					      struct device_attribute *attr,
 					      char *buf)
 {
@@ -1041,7 +1041,7 @@ static ssize_t adt7316_show_DAC_internal_Vref(struct device *dev,
 		       !!(chip->ldac_config & ADT7316_DAC_IN_VREF));
 }
 
-static ssize_t adt7316_store_DAC_internal_Vref(struct device *dev,
+static ssize_t adt7316_store_dac_internal_Vref(struct device *dev,
 					       struct device_attribute *attr,
 					       const char *buf,
 					       size_t len)
@@ -1082,9 +1082,9 @@ static ssize_t adt7316_store_DAC_internal_Vref(struct device *dev,
 	return len;
 }
 
-static IIO_DEVICE_ATTR(DAC_internal_Vref, 0644,
-		       adt7316_show_DAC_internal_Vref,
-		       adt7316_store_DAC_internal_Vref,
+static IIO_DEVICE_ATTR(dac_internal_Vref, 0644,
+		       adt7316_show_dac_internal_Vref,
+		       adt7316_store_dac_internal_Vref,
 		       0);
 
 static ssize_t adt7316_show_ad(struct adt7316_chip_info *chip,
@@ -1644,13 +1644,13 @@ static struct attribute *adt7316_attributes[] = {
 	&iio_dev_attr_da_high_resolution.dev_attr.attr,
 	&iio_dev_attr_enable_proportion_DACA.dev_attr.attr,
 	&iio_dev_attr_enable_proportion_DACB.dev_attr.attr,
-	&iio_dev_attr_DAC_2Vref_channels_mask.dev_attr.attr,
+	&iio_dev_attr_dac_2Vref_channels_mask.dev_attr.attr,
 	&iio_dev_attr_DAC_update_mode.dev_attr.attr,
 	&iio_dev_attr_all_DAC_update_modes.dev_attr.attr,
 	&iio_dev_attr_update_DAC.dev_attr.attr,
-	&iio_dev_attr_DA_AB_Vref_bypass.dev_attr.attr,
-	&iio_dev_attr_DA_CD_Vref_bypass.dev_attr.attr,
-	&iio_dev_attr_DAC_internal_Vref.dev_attr.attr,
+	&iio_dev_attr_dac_ab_Vref_bypass.dev_attr.attr,
+	&iio_dev_attr_dac_cd_Vref_bypass.dev_attr.attr,
+	&iio_dev_attr_dac_internal_Vref.dev_attr.attr,
 	&iio_dev_attr_VDD.dev_attr.attr,
 	&iio_dev_attr_in_temp.dev_attr.attr,
 	&iio_dev_attr_ex_temp.dev_attr.attr,
@@ -1684,15 +1684,15 @@ static struct attribute *adt7516_attributes[] = {
 	&iio_dev_attr_enable_smbus_timeout.dev_attr.attr,
 	&iio_dev_attr_powerdown.dev_attr.attr,
 	&iio_dev_attr_fast_ad_clock.dev_attr.attr,
-	&iio_dev_attr_AIN_internal_Vref.dev_attr.attr,
+	&iio_dev_attr_ain_internal_Vref.dev_attr.attr,
 	&iio_dev_attr_da_high_resolution.dev_attr.attr,
 	&iio_dev_attr_enable_proportion_DACA.dev_attr.attr,
 	&iio_dev_attr_enable_proportion_DACB.dev_attr.attr,
-	&iio_dev_attr_DAC_2Vref_channels_mask.dev_attr.attr,
+	&iio_dev_attr_dac_2Vref_channels_mask.dev_attr.attr,
 	&iio_dev_attr_DAC_update_mode.dev_attr.attr,
 	&iio_dev_attr_all_DAC_update_modes.dev_attr.attr,
 	&iio_dev_attr_update_DAC.dev_attr.attr,
-	&iio_dev_attr_DAC_internal_Vref.dev_attr.attr,
+	&iio_dev_attr_dac_internal_Vref.dev_attr.attr,
 	&iio_dev_attr_VDD.dev_attr.attr,
 	&iio_dev_attr_in_temp.dev_attr.attr,
 	&iio_dev_attr_ex_temp_AIN1.dev_attr.attr,
Signature · 1 line
2.54.0
#1 lore raw
Quoted 2 lines · Jad Keskes

checkpatch flagged a few CamelCase names in this driver. AIN and DAC prefixes are lowercased as standard kernel style.

The AIN things aren't an issue and checkpatch doesn't complain about them.

Quoted 6 lines

Vref is kept capitalized since V stands for Voltage and is a proper technical abbreviation.

DA_AB and DA_CD are renamed to dac_ab and dac_cd to match the register constants ADT7316_VREF_BYPASS_DAC_AB and ADT7316_VREF_BYPASS_DAC_CD that they reference.

This sort of change would need to be in its own commit. (We're dropping the rest of the commit anyway). The difference between DA and DAC is not totally clear to me... The adt7316_show_DAC_2Vref_ch_mask() function only seems to deal with DA but the adt7316_store_DAC_2Vref_ch_mask() does stuff with both. So I'm not sure I understand the naming. (I have not investigated and this is my first time to look at this code).

regards,
dan carpenter

maintainer
#2 lore raw
Quoted 6 lines · On Wed, 3 Jun 2026 09:32:13 +0300 Dan Carpenter <[email protected]> wrote:
Quoted 2 lines · Jad Keskes

checkpatch flagged a few CamelCase names in this driver. AIN and DAC prefixes are lowercased as standard kernel style.

The AIN things aren't an issue and checkpatch doesn't complain about them.

Also they are userspace ABI. Admittedly this is in staging and that ABI is completely none compliant with IIO standards, but none the less you should be very very careful when making that sort of change.

This driver needs a mass of work to drag it into the modern age. IIRC there have been a few partial attempts at that in the past. One key part of that is most of what you are touching in this patch is in code that will not exist after this is modernized.

I'd be surprised if there is low hanging fruit like this that actually makes sense to do in the remaining staging/iio drivers. Mostly much more radical surgery is required.

Anyhow, with that all in mind I'm not planning to take this sort of change to this driver

Jonathan

Quoted 20 lines
Quoted 7 lines

Vref is kept capitalized since V stands for Voltage and is a proper technical abbreviation.

DA_AB and DA_CD are renamed to dac_ab and dac_cd to match the register constants ADT7316_VREF_BYPASS_DAC_AB and ADT7316_VREF_BYPASS_DAC_CD that they reference.

This sort of change would need to be in its own commit. (We're dropping the rest of the commit anyway). The difference between DA and DAC is not totally clear to me... The adt7316_show_DAC_2Vref_ch_mask() function only seems to deal with DA but the adt7316_store_DAC_2Vref_ch_mask() does stuff with both. So I'm not sure I understand the naming. (I have not investigated and this is my first time to look at this code).

regards,
dan carpenter