Checkpatch fixes to driver/staging/iio/addac
Subsystems (4)
v4 cover Checkpatch fixes to driver/staging/iio/addac
*** BLURB HERE ***
Scott Matheina (8):
fixed long description text exceeding 80 characters Fixed variables not being consistently lower case Fix camel case issues
Fix braces not present on all arms of if else statement Remove line after closing braces
Fixed code wrap alignment with preceding (. Changed code to align with coding style of using octat Fixes style issues due to mis-aligned carry over lines
drivers/staging/iio/addac/adt7316.c | 850 +++++++++++++++++------------------- 1 file changed, 397 insertions(+), 453 deletions(-)
--
2.7.4
PATCH v4 1/8 fixed long description text exceeding 80 characters
The description was split into 2 lines due to the line greatly exceeding the 80 character soft limit.
--- drivers/staging/iio/addac/adt7316.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/iio/addac/adt7316.c +2 -1
@@ -2181,5 +2181,6 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus,EXPORT_SYMBOL (adt7316_probe);MODULE_AUTHOR ("Sonic Zhang <[email protected]>" ); -MODULE_DESCRIPTION ("Analog Devices ADT7316/7/8 and ADT7516/7/9 digital temperature sensor, ADC and DAC driver" ); +MODULE_DESCRIPTION ("Analog Devices ADT7316/7/8 and ADT7516/7/9 digital\n" +"temperature sensor, ADC and DAC driver" );MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.7.4
Jonathan Cameron
maintainerRe: [PATCHv4 1/8] fixed long description text exceeding 80 characters
Quoted 2 lines · Scott Matheina
The description was split into 2 lines due to the line greatly exceeding the 80 character soft limit.
This is often deliberately done with strings. It makes them much easier to grep for in the source. Adding the artificial newline may destroy attempts by userspace tools to do their own formatting of this string.
So best to leave this one alone.
Jonathan
Quoted 19 lines
Signed-off-by Scott Matheina <[email protected]>--- drivers/staging/iio/addac/adt7316.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/staging/iio/addac/adt7316.c +2
-1@@ -2181,5 +2181,6 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus,EXPORT_SYMBOL (adt7316_probe);MODULE_AUTHOR ("Sonic Zhang <[email protected]>" ); -MODULE_DESCRIPTION ("Analog Devices ADT7316/7/8 and ADT7516/7/9 digital temperature sensor, ADC and DAC driver" ); +MODULE_DESCRIPTION ("Analog Devices ADT7316/7/8 and ADT7516/7/9 digital\n" +"temperature sensor, ADC and DAC driver" );MODULE_LICENSE ("GPL v2" );
PATCH v4 2/8 Fixed variables not being consistently lower case
In reply to Scott MatheinaAcross the file, variables were sometimes upper case, some times lower case, this fix addresses a few of the instances with this inconsistency.
--- drivers/staging/iio/addac/adt7316.c | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-)
drivers/staging/iio/addac/adt7316.c +24 -24
@@ -1755,55 +1755,55 @@ static irqreturn_t adt7316_event_handler(int irq, void *private) time =iio_get_time_ns (indio_dev);if (stat1 &BIT (0 ))iio_push_event (indio_dev, -IIO_UNMOD_EVENT_CODE (IIO_TEMP ,0 , -IIO_EV_TYPE_THRESH , -IIO_EV_DIR_RISING ), +iio_unmod_event_code (iio_temp,0 , + iio_ev_type_thresh, + iio_ev_dir_rising), time);if (stat1 &BIT (1 ))iio_push_event (indio_dev, -IIO_UNMOD_EVENT_CODE (IIO_TEMP ,0 , -IIO_EV_TYPE_THRESH , -IIO_EV_DIR_FALLING ), +iio_unmod_event_code (iio_temp,0 , + iio_ev_type_thresh, + iio_ev_dir_falling), time);if (stat1 &BIT (2 ))iio_push_event (indio_dev, -IIO_UNMOD_EVENT_CODE (IIO_TEMP ,1 , -IIO_EV_TYPE_THRESH , -IIO_EV_DIR_RISING ), +iio_unmod_event_code (iio_temp,1 , + iio_ev_type_thresh, + iio_ev_dir_rising), time);if (stat1 &BIT (3 ))iio_push_event (indio_dev, -IIO_UNMOD_EVENT_CODE (IIO_TEMP ,1 , -IIO_EV_TYPE_THRESH , -IIO_EV_DIR_FALLING ), +iio_unmod_event_code (iio_temp,1 , + iio_ev_type_thresh, + iio_ev_dir_falling), time);if (stat1 &BIT (5 ))iio_push_event (indio_dev, -IIO_UNMOD_EVENT_CODE (IIO_VOLTAGE ,1 , -IIO_EV_TYPE_THRESH , -IIO_EV_DIR_EITHER ), +iio_unmod_event_code (iio_voltage,1 , + iio_ev_type_thresh, + iio_ev_dir_either), time);if (stat1 &BIT (6 ))iio_push_event (indio_dev, -IIO_UNMOD_EVENT_CODE (IIO_VOLTAGE ,2 , -IIO_EV_TYPE_THRESH , -IIO_EV_DIR_EITHER ), +iio_unmod_event_code (iio_voltage,2 , + iio_ev_type_thresh, + iio_ev_dir_either), time);if (stat1 &BIT (7 ))iio_push_event (indio_dev, -IIO_UNMOD_EVENT_CODE (IIO_VOLTAGE ,3 , -IIO_EV_TYPE_THRESH , -IIO_EV_DIR_EITHER ), +iio_unmod_event_code (iio_voltage,3 , + iio_ev_type_thresh, + iio_ev_dir_either), time); } ret = chip->bus.read (chip->bus.client,ADT7316_INT_STAT2 , &stat2);if (!ret) {if (stat2 &ADT7316_INT_MASK2_VDD )iio_push_event (indio_dev, -IIO_UNMOD_EVENT_CODE (IIO_VOLTAGE , +iio_unmod_event_code (iio_voltage,0 , -IIO_EV_TYPE_THRESH , -IIO_EV_DIR_RISING ), + iio_ev_type_thresh, + iio_ev_dir_rising),iio_get_time_ns (indio_dev)); }
--
2.7.4
kbuild test robot
build botRe: [PATCHv4 2/8] Fixed variables not being consistently lower case
reproduce:
Hi Scott,
[auto build test ERROR on iio/togreg]
[also build test ERROR on v4.9 next-20161224]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Scott-Matheina/Checkpatch-fixes-to-driver-staging-iio-addac/20161226-041021 base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg config: i386-randconfig-x001-201652 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=i386
All errors (new ones prefixed by >>):
drivers/staging/iio/addac/adt7316.c: In function 'adt7316_event_handler':
>> drivers/staging/iio/addac/adt7316.c:1758:12: error: implicit declaration of function 'iio_unmod_event_code' [-Werror=implicit-function-declaration]
iio_unmod_event_code(iio_temp, 0,
^~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1758:33: error: 'iio_temp' undeclared (first use in this function)
iio_unmod_event_code(iio_temp, 0,
^~~~~~~~
drivers/staging/iio/addac/adt7316.c:1758:33: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/staging/iio/addac/adt7316.c:1759:12: error: 'iio_ev_type_thresh' undeclared (first use in this function)
iio_ev_type_thresh,
^~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1760:12: error: 'iio_ev_dir_rising' undeclared (first use in this function)
iio_ev_dir_rising),
^~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1766:12: error: 'iio_ev_dir_falling' undeclared (first use in this function)
iio_ev_dir_falling),
^~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1782:33: error: 'iio_voltage' undeclared (first use in this function)
iio_unmod_event_code(iio_voltage, 1,
^~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1784:12: error: 'iio_ev_dir_either' undeclared (first use in this function)
iio_ev_dir_either),
^~~~~~~~~~~~~~~~~cc1: some warnings being treated as errors
vim +/iio_unmod_event_code +1758 drivers/staging/iio/addac/adt7316.c
1752 if ((chip->id & ID_FAMILY_MASK) != ID_ADT75XX)
1753 stat1 &= 0x1F;
1754
1755 time = iio_get_time_ns(indio_dev);
1756 if (stat1 & BIT(0))
1757 iio_push_event(indio_dev,
> 1758 iio_unmod_event_code(iio_temp, 0, > 1759 iio_ev_type_thresh, > 1760 iio_ev_dir_rising), 1761 time); 1762 if (stat1 & BIT(1)) 1763 iio_push_event(indio_dev, 1764 iio_unmod_event_code(iio_temp, 0, 1765 iio_ev_type_thresh, > 1766 iio_ev_dir_falling), 1767 time); 1768 if (stat1 & BIT(2)) 1769 iio_push_event(indio_dev, 1770 iio_unmod_event_code(iio_temp, 1, 1771 iio_ev_type_thresh, 1772 iio_ev_dir_rising), 1773 time); 1774 if (stat1 & BIT(3)) 1775 iio_push_event(indio_dev, 1776 iio_unmod_event_code(iio_temp, 1, 1777 iio_ev_type_thresh, 1778 iio_ev_dir_falling), 1779 time); 1780 if (stat1 & BIT(5)) 1781 iio_push_event(indio_dev, > 1782 iio_unmod_event_code(iio_voltage, 1, 1783 iio_ev_type_thresh, > 1784 iio_ev_dir_either), 1785 time);
1786 if (stat1 & BIT(6))
1787 iio_push_event(indio_dev,
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
PATCH v4 3/8 Fix camel case issues
In reply to Scott MatheinaCases of camel case were fixed by making variables lower case throughout the file.
--- drivers/staging/iio/addac/adt7316.c | 82 ++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 41 deletions(-)
drivers/staging/iio/addac/adt7316.c +41 -41
@@ -1485,7 +1485,7 @@ static ssize_t adt7316_show_DAC_A(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_show_DAC (chip,0 , buf); +return adt7316_show_dac (chip,0 , buf); } static ssize_t adt7316_store_DAC_A(struct device *dev,
@@ -1496,7 +1496,7 @@ static ssize_t adt7316_store_DAC_A(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_store_DAC (chip,0 , buf, len); +return adt7316_store_dac (chip,0 , buf, len); } static IIO_DEVICE_ATTR(DAC_A, S_IRUGO | S_IWUSR, adt7316_show_DAC_A,
@@ -1509,7 +1509,7 @@ static ssize_t adt7316_show_DAC_B(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_show_DAC (chip,1 , buf); +return adt7316_show_dac (chip,1 , buf); } static ssize_t adt7316_store_DAC_B(struct device *dev,
@@ -1520,7 +1520,7 @@ static ssize_t adt7316_store_DAC_B(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_store_DAC (chip,1 , buf, len); +return adt7316_store_dac (chip,1 , buf, len); } static IIO_DEVICE_ATTR(DAC_B, S_IRUGO | S_IWUSR, adt7316_show_DAC_B,
@@ -1533,7 +1533,7 @@ static ssize_t adt7316_show_DAC_C(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_show_DAC (chip,2 , buf); +return adt7316_show_dac (chip,2 , buf); } static ssize_t adt7316_store_DAC_C(struct device *dev,
@@ -1544,7 +1544,7 @@ static ssize_t adt7316_store_DAC_C(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_store_DAC (chip,2 , buf, len); +return adt7316_store_dac (chip,2 , buf, len); } static IIO_DEVICE_ATTR(DAC_C, S_IRUGO | S_IWUSR, adt7316_show_DAC_C,
@@ -1557,7 +1557,7 @@ static ssize_t adt7316_show_DAC_D(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_show_DAC (chip,3 , buf); +return adt7316_show_dac (chip,3 , buf); } static ssize_t adt7316_store_DAC_D(struct device *dev,
@@ -1568,7 +1568,7 @@ static ssize_t adt7316_store_DAC_D(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_store_DAC (chip,3 , buf, len); +return adt7316_store_dac (chip,3 , buf, len); } static IIO_DEVICE_ATTR(DAC_D, S_IRUGO | S_IWUSR, adt7316_show_DAC_D,
@@ -1661,26 +1661,26 @@ static struct attribute *adt7316_attributes[] = { &iio_dev_attr_powerdown.dev_attr.attr, &iio_dev_attr_fast_ad_clock.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_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_VDD.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_internal_vref.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_vdd.dev_attr.attr, &iio_dev_attr_in_temp.dev_attr.attr, &iio_dev_attr_ex_temp.dev_attr.attr, &iio_dev_attr_in_temp_offset.dev_attr.attr, &iio_dev_attr_ex_temp_offset.dev_attr.attr, &iio_dev_attr_in_analog_temp_offset.dev_attr.attr, &iio_dev_attr_ex_analog_temp_offset.dev_attr.attr, - &iio_dev_attr_DAC_A.dev_attr.attr, - &iio_dev_attr_DAC_B.dev_attr.attr, - &iio_dev_attr_DAC_C.dev_attr.attr, - &iio_dev_attr_DAC_D.dev_attr.attr, + &iio_dev_attr_dac_a.dev_attr.attr, + &iio_dev_attr_dac_b.dev_attr.attr, + &iio_dev_attr_dac_c.dev_attr.attr, + &iio_dev_attr_dac_d.dev_attr.attr, &iio_dev_attr_device_id.dev_attr.attr, &iio_dev_attr_manufactorer_id.dev_attr.attr, &iio_dev_attr_device_rev.dev_attr.attr,
@@ -1703,31 +1703,31 @@ 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_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_VDD.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_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_vdd.dev_attr.attr, &iio_dev_attr_in_temp.dev_attr.attr, - &iio_dev_attr_ex_temp_AIN1.dev_attr.attr, - &iio_dev_attr_AIN2.dev_attr.attr, - &iio_dev_attr_AIN3.dev_attr.attr, - &iio_dev_attr_AIN4.dev_attr.attr, + &iio_dev_attr_ex_temp_ain1.dev_attr.attr, + &iio_dev_attr_ain2.dev_attr.attr, + &iio_dev_attr_ain3.dev_attr.attr, + &iio_dev_attr_ain4.dev_attr.attr, &iio_dev_attr_in_temp_offset.dev_attr.attr, &iio_dev_attr_ex_temp_offset.dev_attr.attr, &iio_dev_attr_in_analog_temp_offset.dev_attr.attr, &iio_dev_attr_ex_analog_temp_offset.dev_attr.attr, - &iio_dev_attr_DAC_A.dev_attr.attr, - &iio_dev_attr_DAC_B.dev_attr.attr, - &iio_dev_attr_DAC_C.dev_attr.attr, - &iio_dev_attr_DAC_D.dev_attr.attr, + &iio_dev_attr_dac_a.dev_attr.attr, + &iio_dev_attr_dac_b.dev_attr.attr, + &iio_dev_attr_dac_c.dev_attr.attr, + &iio_dev_attr_dac_d.dev_attr.attr, &iio_dev_attr_device_id.dev_attr.attr, &iio_dev_attr_manufactorer_id.dev_attr.attr, &iio_dev_attr_device_rev.dev_attr.attr,
Signature · 1 line
2.7.4
kbuild test robot
build botRe: [PATCHv4 3/8] Fix camel case issues
reproduce:
Hi Scott,
[auto build test ERROR on iio/togreg]
[also build test ERROR on v4.9 next-20161224]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Scott-Matheina/Checkpatch-fixes-to-driver-staging-iio-addac/20161226-041021 base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg config: i386-randconfig-x001-201652 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=i386
All error/warnings (new ones prefixed by >>):
drivers/staging/iio/addac/adt7316.c: In function 'adt7316_show_DAC_A':
>> drivers/staging/iio/addac/adt7316.c:1488:9: error: implicit declaration of function 'adt7316_show_dac' [-Werror=implicit-function-declaration]
return adt7316_show_dac(chip, 0, buf);
^~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c: In function 'adt7316_store_DAC_A':
>> drivers/staging/iio/addac/adt7316.c:1499:9: error: implicit declaration of function 'adt7316_store_dac' [-Werror=implicit-function-declaration]
return adt7316_store_dac(chip, 0, buf, len);
^~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c: At top level:
>> drivers/staging/iio/addac/adt7316.c:1664:3: error: 'iio_dev_attr_enable_proportion_daca' undeclared here (not in a function)
&iio_dev_attr_enable_proportion_daca.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1665:3: error: 'iio_dev_attr_enable_proportion_dacb' undeclared here (not in a function)
&iio_dev_attr_enable_proportion_dacb.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1666:3: error: 'iio_dev_attr_dac_2vref_channels_mask' undeclared here (not in a function)
&iio_dev_attr_dac_2vref_channels_mask.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1667:3: error: 'iio_dev_attr_dac_internal_vref' undeclared here (not in a function)
&iio_dev_attr_dac_internal_vref.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1668:3: error: 'iio_dev_attr_all_dac_update_modes' undeclared here (not in a function)
&iio_dev_attr_all_dac_update_modes.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1669:3: error: 'iio_dev_attr_update_dac' undeclared here (not in a function)
&iio_dev_attr_update_dac.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1670:3: error: 'iio_dev_attr_da_ab_vref_bypass' undeclared here (not in a function)
&iio_dev_attr_da_ab_vref_bypass.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1671:3: error: 'iio_dev_attr_da_cd_vref_bypass' undeclared here (not in a function)
&iio_dev_attr_da_cd_vref_bypass.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1673:3: error: 'iio_dev_attr_vdd' undeclared here (not in a function)
&iio_dev_attr_vdd.dev_attr.attr,
^~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1680:3: error: 'iio_dev_attr_dac_a' undeclared here (not in a function)
&iio_dev_attr_dac_a.dev_attr.attr,
^~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1681:3: error: 'iio_dev_attr_dac_b' undeclared here (not in a function)
&iio_dev_attr_dac_b.dev_attr.attr,
^~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1682:3: error: 'iio_dev_attr_dac_c' undeclared here (not in a function)
&iio_dev_attr_dac_c.dev_attr.attr,
^~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1683:3: error: 'iio_dev_attr_dac_d' undeclared here (not in a function)
&iio_dev_attr_dac_d.dev_attr.attr,
^~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1706:3: error: 'iio_dev_attr_ain_internal_vref' undeclared here (not in a function)
&iio_dev_attr_ain_internal_vref.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1706:33: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_ain_internal_vref.dev_attr.attr,
^
>> drivers/staging/iio/addac/adt7316.c:1706:42: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_ain_internal_vref.dev_attr.attr,
^
>> drivers/staging/iio/addac/adt7316.c:1706:2: error: initializer element is not constant
&iio_dev_attr_ain_internal_vref.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1706:2: note: (near initialization for 'adt7516_attributes[10]')
drivers/staging/iio/addac/adt7316.c:1708:38: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_enable_proportion_daca.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1708:47: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_enable_proportion_daca.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1708:2: error: initializer element is not constant
&iio_dev_attr_enable_proportion_daca.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1708:2: note: (near initialization for 'adt7516_attributes[12]')
drivers/staging/iio/addac/adt7316.c:1709:38: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_enable_proportion_dacb.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1709:47: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_enable_proportion_dacb.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1709:2: error: initializer element is not constant
&iio_dev_attr_enable_proportion_dacb.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1709:2: note: (near initialization for 'adt7516_attributes[13]')
drivers/staging/iio/addac/adt7316.c:1710:39: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_dac_2vref_channels_mask.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1710:48: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_dac_2vref_channels_mask.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1710:2: error: initializer element is not constant
&iio_dev_attr_dac_2vref_channels_mask.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1710:2: note: (near initialization for 'adt7516_attributes[14]')
>> drivers/staging/iio/addac/adt7316.c:1711:3: error: 'iio_dev_attr_dac_update_mode' undeclared here (not in a function)
&iio_dev_attr_dac_update_mode.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1711:31: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_dac_update_mode.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1711:40: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_dac_update_mode.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1711:2: error: initializer element is not constant
&iio_dev_attr_dac_update_mode.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1711:2: note: (near initialization for 'adt7516_attributes[15]')
drivers/staging/iio/addac/adt7316.c:1712:36: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_all_dac_update_modes.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1712:45: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_all_dac_update_modes.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1712:2: error: initializer element is not constant
&iio_dev_attr_all_dac_update_modes.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1712:2: note: (near initialization for 'adt7516_attributes[16]')
drivers/staging/iio/addac/adt7316.c:1713:26: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_update_dac.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1713:35: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_update_dac.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1713:2: error: initializer element is not constant
&iio_dev_attr_update_dac.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1713:2: note: (near initialization for 'adt7516_attributes[17]')
drivers/staging/iio/addac/adt7316.c:1714:33: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_da_ab_vref_bypass.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1714:42: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_da_ab_vref_bypass.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1714:2: error: initializer element is not constant
&iio_dev_attr_da_ab_vref_bypass.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1714:2: note: (near initialization for 'adt7516_attributes[18]')
drivers/staging/iio/addac/adt7316.c:1715:33: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_da_cd_vref_bypass.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1715:42: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_da_cd_vref_bypass.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1715:2: error: initializer element is not constant
&iio_dev_attr_da_cd_vref_bypass.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1715:2: note: (near initialization for 'adt7516_attributes[19]')
drivers/staging/iio/addac/adt7316.c:1716:33: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_dac_internal_vref.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1716:42: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_dac_internal_vref.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1716:2: error: initializer element is not constant
&iio_dev_attr_dac_internal_vref.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1716:2: note: (near initialization for 'adt7516_attributes[20]')
drivers/staging/iio/addac/adt7316.c:1717:19: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_vdd.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1717:28: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_vdd.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1717:2: error: initializer element is not constant
&iio_dev_attr_vdd.dev_attr.attr,
^ drivers/staging/iio/addac/adt7316.c:1717:2: note: (near initialization for 'adt7516_attributes[21]')
vim +/adt7316_show_dac +1488 drivers/staging/iio/addac/adt7316.c
1482 struct device_attribute *attr,
1483 char *buf)
1484 {
1485 struct iio_dev *dev_info = dev_to_iio_dev(dev);
1486 struct adt7316_chip_info *chip = iio_priv(dev_info);
1487
> 1488 return adt7316_show_dac(chip, 0, buf);
1489 }
1490
1491 static ssize_t adt7316_store_DAC_A(struct device *dev,
1492 struct device_attribute *attr,
1493 const char *buf,
1494 size_t len)
1495 {
1496 struct iio_dev *dev_info = dev_to_iio_dev(dev);
1497 struct adt7316_chip_info *chip = iio_priv(dev_info);
1498
> 1499 return adt7316_store_dac(chip, 0, buf, len);
1500 }
1501
1502 static IIO_DEVICE_ATTR(DAC_A, S_IRUGO | S_IWUSR, adt7316_show_DAC_A,
1503 adt7316_store_DAC_A, 0);
1504
1505 static ssize_t adt7316_show_DAC_B(struct device *dev,
1506 struct device_attribute *attr,
1507 char *buf)
1508 {
1509 struct iio_dev *dev_info = dev_to_iio_dev(dev);
1510 struct adt7316_chip_info *chip = iio_priv(dev_info);
1511
1512 return adt7316_show_dac(chip, 1, buf);
1513 }
1514
1515 static ssize_t adt7316_store_DAC_B(struct device *dev,
1516 struct device_attribute *attr,
1517 const char *buf,
1518 size_t len)
1519 {
1520 struct iio_dev *dev_info = dev_to_iio_dev(dev);
1521 struct adt7316_chip_info *chip = iio_priv(dev_info);
1522
1523 return adt7316_store_dac(chip, 1, buf, len);
1524 }
1525
1526 static IIO_DEVICE_ATTR(DAC_B, S_IRUGO | S_IWUSR, adt7316_show_DAC_B,
1527 adt7316_store_DAC_B, 0);
1528
1529 static ssize_t adt7316_show_DAC_C(struct device *dev,
1530 struct device_attribute *attr,
1531 char *buf)
1532 {
1533 struct iio_dev *dev_info = dev_to_iio_dev(dev);
1534 struct adt7316_chip_info *chip = iio_priv(dev_info);
1535
1536 return adt7316_show_dac(chip, 2, buf);
1537 }
1538
1539 static ssize_t adt7316_store_DAC_C(struct device *dev,
1540 struct device_attribute *attr,
1541 const char *buf,
1542 size_t len)
1543 {
1544 struct iio_dev *dev_info = dev_to_iio_dev(dev);
1545 struct adt7316_chip_info *chip = iio_priv(dev_info);
1546
1547 return adt7316_store_dac(chip, 2, buf, len);
1548 }
1549
1550 static IIO_DEVICE_ATTR(DAC_C, S_IRUGO | S_IWUSR, adt7316_show_DAC_C,
1551 adt7316_store_DAC_C, 0);
1552
1553 static ssize_t adt7316_show_DAC_D(struct device *dev,
1554 struct device_attribute *attr,
1555 char *buf)
1556 {
1557 struct iio_dev *dev_info = dev_to_iio_dev(dev);
1558 struct adt7316_chip_info *chip = iio_priv(dev_info);
1559
1560 return adt7316_show_dac(chip, 3, buf);
1561 }
1562
1563 static ssize_t adt7316_store_DAC_D(struct device *dev,
1564 struct device_attribute *attr,
1565 const char *buf,
1566 size_t len)
1567 {
1568 struct iio_dev *dev_info = dev_to_iio_dev(dev);
1569 struct adt7316_chip_info *chip = iio_priv(dev_info);
1570
1571 return adt7316_store_dac(chip, 3, buf, len);
1572 }
1573
> 1574 static IIO_DEVICE_ATTR(DAC_D, S_IRUGO | S_IWUSR, adt7316_show_DAC_D,
1575 adt7316_store_DAC_D, 0);
1576
1577 static ssize_t adt7316_show_device_id(struct device *dev,
1578 struct device_attribute *attr,
1579 char *buf)
1580 {
1581 struct iio_dev *dev_info = dev_to_iio_dev(dev);
1582 struct adt7316_chip_info *chip = iio_priv(dev_info);
1583 u8 id;
1584 int ret;
1585
1586 ret = chip->bus.read(chip->bus.client, ADT7316_DEVICE_ID, &id);
1587 if (ret)
1588 return -EIO;
1589
1590 return sprintf(buf, "%d\n", id);
1591 }
1592
1593 static IIO_DEVICE_ATTR(device_id, S_IRUGO, adt7316_show_device_id, NULL, 0);
1594
1595 static ssize_t adt7316_show_manufactorer_id(struct device *dev,
1596 struct device_attribute *attr,
1597 char *buf)
1598 {
1599 struct iio_dev *dev_info = dev_to_iio_dev(dev);
1600 struct adt7316_chip_info *chip = iio_priv(dev_info);
1601 u8 id;
1602 int ret;
1603
1604 ret = chip->bus.read(chip->bus.client, ADT7316_MANUFACTURE_ID, &id);
1605 if (ret)
1606 return -EIO;
1607
1608 return sprintf(buf, "%d\n", id);
1609 }
1610
1611 static IIO_DEVICE_ATTR(manufactorer_id, S_IRUGO,
1612 adt7316_show_manufactorer_id, NULL, 0);
1613
1614 static ssize_t adt7316_show_device_rev(struct device *dev,
1615 struct device_attribute *attr,
1616 char *buf)
1617 {
1618 struct iio_dev *dev_info = dev_to_iio_dev(dev);
1619 struct adt7316_chip_info *chip = iio_priv(dev_info);
1620 u8 rev;
1621 int ret;
1622
1623 ret = chip->bus.read(chip->bus.client, ADT7316_DEVICE_REV, &rev);
1624 if (ret)
1625 return -EIO;
1626
1627 return sprintf(buf, "%d\n", rev);
1628 }
1629
1630 static IIO_DEVICE_ATTR(device_rev, S_IRUGO, adt7316_show_device_rev, NULL, 0);
1631
1632 static ssize_t adt7316_show_bus_type(struct device *dev,
1633 struct device_attribute *attr,
1634 char *buf)
1635 {
1636 struct iio_dev *dev_info = dev_to_iio_dev(dev);
1637 struct adt7316_chip_info *chip = iio_priv(dev_info);
1638 u8 stat;
1639 int ret;
1640
1641 ret = chip->bus.read(chip->bus.client, ADT7316_SPI_LOCK_STAT, &stat);
1642 if (ret)
1643 return -EIO;
1644
1645 if (stat)
1646 return sprintf(buf, "spi\n");
1647
1648 return sprintf(buf, "i2c\n");
1649 }
1650
1651 static IIO_DEVICE_ATTR(bus_type, S_IRUGO, adt7316_show_bus_type, NULL, 0);
1652
1653 static struct attribute *adt7316_attributes[] = {
1654 &iio_dev_attr_all_modes.dev_attr.attr,
1655 &iio_dev_attr_mode.dev_attr.attr,
1656 &iio_dev_attr_enabled.dev_attr.attr,
1657 &iio_dev_attr_ad_channel.dev_attr.attr,
1658 &iio_dev_attr_all_ad_channels.dev_attr.attr,
1659 &iio_dev_attr_disable_averaging.dev_attr.attr,
1660 &iio_dev_attr_enable_smbus_timeout.dev_attr.attr,
1661 &iio_dev_attr_powerdown.dev_attr.attr,
1662 &iio_dev_attr_fast_ad_clock.dev_attr.attr,
1663 &iio_dev_attr_da_high_resolution.dev_attr.attr,
> 1664 &iio_dev_attr_enable_proportion_daca.dev_attr.attr,
> 1665 &iio_dev_attr_enable_proportion_dacb.dev_attr.attr,
> 1666 &iio_dev_attr_dac_2vref_channels_mask.dev_attr.attr,
> 1667 &iio_dev_attr_dac_internal_vref.dev_attr.attr,
> 1668 &iio_dev_attr_all_dac_update_modes.dev_attr.attr,
> 1669 &iio_dev_attr_update_dac.dev_attr.attr,
> 1670 &iio_dev_attr_da_ab_vref_bypass.dev_attr.attr,
> 1671 &iio_dev_attr_da_cd_vref_bypass.dev_attr.attr,
1672 &iio_dev_attr_dac_internal_vref.dev_attr.attr,
> 1673 &iio_dev_attr_vdd.dev_attr.attr,
1674 &iio_dev_attr_in_temp.dev_attr.attr,
1675 &iio_dev_attr_ex_temp.dev_attr.attr,
1676 &iio_dev_attr_in_temp_offset.dev_attr.attr,
1677 &iio_dev_attr_ex_temp_offset.dev_attr.attr,
1678 &iio_dev_attr_in_analog_temp_offset.dev_attr.attr,
1679 &iio_dev_attr_ex_analog_temp_offset.dev_attr.attr,
> 1680 &iio_dev_attr_dac_a.dev_attr.attr,
> 1681 &iio_dev_attr_dac_b.dev_attr.attr,
> 1682 &iio_dev_attr_dac_c.dev_attr.attr,
> 1683 &iio_dev_attr_dac_d.dev_attr.attr, 1684 &iio_dev_attr_device_id.dev_attr.attr,
1685 &iio_dev_attr_manufactorer_id.dev_attr.attr,
1686 &iio_dev_attr_device_rev.dev_attr.attr,
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Jonathan Cameron
maintainerRe: [PATCHv4 3/8] Fix camel case issues
In reply to Scott MatheinaQuoted 4 lines · Scott Matheina
Cases of camel case were fixed by making variables lower case throughout the file.
Signed-off-by Scott Matheina <[email protected]>
So of these cases might arguably be worth doing, but extreme care is needed to ensure that the code is not broken.
Also, you are modifiying userspace ABI here so another level of care is needed. To approach this sort of change I would suggest an RFC for the proposed ABI changes.
In this particular case the driver is so far from standard ABI that you would likely get the response that it needs to conform to standard ABI rather than fixing it's own random choices of what sysfs files should be called.
Jonathan
Quoted 173 lines
--- drivers/staging/iio/addac/adt7316.c | 82 ++++++++++++++++++------------------- 1 file changed, 41 insertions(+), 41 deletions(-)drivers/staging/iio/addac/adt7316.c +41
-41@@ -1485,7 +1485,7 @@ static ssize_t adt7316_show_DAC_A(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_show_DAC (chip,0 , buf); +return adt7316_show_dac (chip,0 , buf); } static ssize_t adt7316_store_DAC_A(struct device *dev,@@ -1496,7 +1496,7 @@ static ssize_t adt7316_store_DAC_A(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_store_DAC (chip,0 , buf, len); +return adt7316_store_dac (chip,0 , buf, len); } static IIO_DEVICE_ATTR(DAC_A, S_IRUGO | S_IWUSR, adt7316_show_DAC_A,@@ -1509,7 +1509,7 @@ static ssize_t adt7316_show_DAC_B(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_show_DAC (chip,1 , buf); +return adt7316_show_dac (chip,1 , buf); } static ssize_t adt7316_store_DAC_B(struct device *dev,@@ -1520,7 +1520,7 @@ static ssize_t adt7316_store_DAC_B(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_store_DAC (chip,1 , buf, len); +return adt7316_store_dac (chip,1 , buf, len); } static IIO_DEVICE_ATTR(DAC_B, S_IRUGO | S_IWUSR, adt7316_show_DAC_B,@@ -1533,7 +1533,7 @@ static ssize_t adt7316_show_DAC_C(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_show_DAC (chip,2 , buf); +return adt7316_show_dac (chip,2 , buf); } static ssize_t adt7316_store_DAC_C(struct device *dev,@@ -1544,7 +1544,7 @@ static ssize_t adt7316_store_DAC_C(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_store_DAC (chip,2 , buf, len); +return adt7316_store_dac (chip,2 , buf, len); } static IIO_DEVICE_ATTR(DAC_C, S_IRUGO | S_IWUSR, adt7316_show_DAC_C,@@ -1557,7 +1557,7 @@ static ssize_t adt7316_show_DAC_D(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_show_DAC (chip,3 , buf); +return adt7316_show_dac (chip,3 , buf); } static ssize_t adt7316_store_DAC_D(struct device *dev,@@ -1568,7 +1568,7 @@ static ssize_t adt7316_store_DAC_D(struct device *dev,struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info); -return adt7316_store_DAC (chip,3 , buf, len); +return adt7316_store_dac (chip,3 , buf, len); } static IIO_DEVICE_ATTR(DAC_D, S_IRUGO | S_IWUSR, adt7316_show_DAC_D,@@ -1661,26 +1661,26 @@ static struct attribute *adt7316_attributes[] = { &iio_dev_attr_powerdown.dev_attr.attr, &iio_dev_attr_fast_ad_clock.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_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_VDD.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_internal_vref.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_vdd.dev_attr.attr, &iio_dev_attr_in_temp.dev_attr.attr, &iio_dev_attr_ex_temp.dev_attr.attr, &iio_dev_attr_in_temp_offset.dev_attr.attr, &iio_dev_attr_ex_temp_offset.dev_attr.attr, &iio_dev_attr_in_analog_temp_offset.dev_attr.attr, &iio_dev_attr_ex_analog_temp_offset.dev_attr.attr, - &iio_dev_attr_DAC_A.dev_attr.attr, - &iio_dev_attr_DAC_B.dev_attr.attr, - &iio_dev_attr_DAC_C.dev_attr.attr, - &iio_dev_attr_DAC_D.dev_attr.attr, + &iio_dev_attr_dac_a.dev_attr.attr, + &iio_dev_attr_dac_b.dev_attr.attr, + &iio_dev_attr_dac_c.dev_attr.attr, + &iio_dev_attr_dac_d.dev_attr.attr, &iio_dev_attr_device_id.dev_attr.attr, &iio_dev_attr_manufactorer_id.dev_attr.attr, &iio_dev_attr_device_rev.dev_attr.attr,@@ -1703,31 +1703,31 @@ 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_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_VDD.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_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_vdd.dev_attr.attr, &iio_dev_attr_in_temp.dev_attr.attr, - &iio_dev_attr_ex_temp_AIN1.dev_attr.attr, - &iio_dev_attr_AIN2.dev_attr.attr, - &iio_dev_attr_AIN3.dev_attr.attr, - &iio_dev_attr_AIN4.dev_attr.attr, + &iio_dev_attr_ex_temp_ain1.dev_attr.attr, + &iio_dev_attr_ain2.dev_attr.attr, + &iio_dev_attr_ain3.dev_attr.attr, + &iio_dev_attr_ain4.dev_attr.attr, &iio_dev_attr_in_temp_offset.dev_attr.attr, &iio_dev_attr_ex_temp_offset.dev_attr.attr, &iio_dev_attr_in_analog_temp_offset.dev_attr.attr, &iio_dev_attr_ex_analog_temp_offset.dev_attr.attr, - &iio_dev_attr_DAC_A.dev_attr.attr, - &iio_dev_attr_DAC_B.dev_attr.attr, - &iio_dev_attr_DAC_C.dev_attr.attr, - &iio_dev_attr_DAC_D.dev_attr.attr, + &iio_dev_attr_dac_a.dev_attr.attr, + &iio_dev_attr_dac_b.dev_attr.attr, + &iio_dev_attr_dac_c.dev_attr.attr, + &iio_dev_attr_dac_d.dev_attr.attr, &iio_dev_attr_device_id.dev_attr.attr, &iio_dev_attr_manufactorer_id.dev_attr.attr, &iio_dev_attr_device_rev.dev_attr.attr,
PATCH v4 4/8 Fix braces not present on all arms of if else statement
In reply to Scott MatheinaAdds braces to second arm of if else statement.
--- drivers/staging/iio/addac/adt7316.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/iio/addac/adt7316.c +2 -1
@@ -661,8 +661,9 @@ static ssize_t adt7316_store_da_high_resolution(struct device *dev, chip->dac_bits =12 ; else if (chip->id == ID_ADT7317 || chip->id == ID_ADT7517) chip->dac_bits = 10; - }else + }else { config3 = chip->config3 & (~ADT7316_DA_HIGH_RESOLUTION ); + } ret = chip->bus.write (chip->bus.client,ADT7316_CONFIG3 , config3);if (ret)
Signature · 1 line
2.7.4
Jonathan Cameron
maintainerRe: [PATCHv4 4/8] Fix braces not present on all arms of if else statement
Quoted 3 lines · Scott Matheina
Adds braces to second arm of if else statement.
Signed-off-by Scott Matheina <[email protected]>
This patch is actually correct so applied to the togreg branch of iio.git.
Thanks,
Jonathan
Quoted 20 lines
--- drivers/staging/iio/addac/adt7316.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/staging/iio/addac/adt7316.c +2
-1@@ -661,8 +661,9 @@ static ssize_t adt7316_store_da_high_resolution(struct device *dev, chip->dac_bits =12 ; else if (chip->id == ID_ADT7317 || chip->id == ID_ADT7517) chip->dac_bits = 10; - }else + }else { config3 = chip->config3 & (~ADT7316_DA_HIGH_RESOLUTION ); + } ret = chip->bus.write (chip->bus.client,ADT7316_CONFIG3 , config3);if (ret)
Jonathan Cameron
maintainerRe: [PATCHv4 4/8] Fix braces not present on all arms of if else statement
Quoted 5 lines · Jonathan Cameron
Quoted 3 lines · Scott Matheina
Adds braces to second arm of if else statement.
Signed-off-by Scott Matheina <[email protected]>This patch is actually correct so applied to the togreg branch of iio.git.
Ah, patch title could be better. Should mention which driver it is for as it is common for people to cherrypick individual patches out of a series (like I just did).
I'll fix this one up to
staging:iio:adt7316...
Jonathan
Quoted 30 lines
Thanks,
Jonathan
Quoted 10 lines
--- drivers/staging/iio/addac/adt7316.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/staging/iio/addac/adt7316.c +0
-0drivers/staging/iio/addac/adt7316.c static ssize_t adt7316_store_da_high_resolution(struct device *dev, · line 669
Quoted 10 lines
drivers/staging/iio/addac/adt7316.c +2
-1@@ -661,8 +661,9 @@ static ssize_t adt7316_store_da_high_resolution(struct device *dev, chip->dac_bits =12 ; else if (chip->id == ID_ADT7317 || chip->id == ID_ADT7517) chip->dac_bits = 10; - }else + }else { config3 = chip->config3 & (~ADT7316_DA_HIGH_RESOLUTION ); + } ret = chip->bus.write (chip->bus.client,ADT7316_CONFIG3 , config3);if (ret)--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv4 4/8] Fix braces not present on all arms of if else statement
Quoted 11 lines · Jonathan Cameron
Quoted 5 lines · Jonathan Cameron
Quoted 3 lines · Scott Matheina
Adds braces to second arm of if else statement.
Signed-off-by Scott Matheina <[email protected]>This patch is actually correct so applied to the togreg branch of
iio.git.
Ah, patch title could be better. Should mention which driver it is for as it is common for people to cherrypick individual patches out of a series (like I just did).
Quoted 5 lines
I'll fix this one up to
staging:iio:adt7316...Jonathan
Thanks
Quoted 34 lines
Quoted 9 lines
Thanks,
Jonathan
Review
Quoted 5 lines
--- drivers/staging/iio/addac/adt7316.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/staging/iio/addac/adt7316.cQuoted 4 lines
drivers/staging/iio/addac/adt7316.c static ssize_t adt7316_store_da_high_resolution(struct
Quoted 4 lines
index 2b584a0..e78d302 100644
drivers/staging/iio/addac/adt7316.c +0
-0@@ -661,8 +661,9 @@ static ssize_t adt7316_store_da_high_resolution(structdevice *dev,
Quoted 17 lines
drivers/staging/iio/addac/adt7316.c static ssize_t adt7316_store_da_high_resolution(struct device *dev, · line 669
Quoted 11 lines
drivers/staging/iio/addac/adt7316.c +2
-1chip->dac_bits =12 ; else if (chip->id == ID_ADT7317 || chip->id == ID_ADT7517) chip->dac_bits = 10; - }else + }else { config3 = chip->config3 & (~ADT7316_DA_HIGH_RESOLUTION ); + } ret = chip->bus.write (chip->bus.client,ADT7316_CONFIG3 , config3);if (ret)--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCHv4 4/8] Fix braces not present on all arms of if else statement
Quoted 48 lines · Scott Matheina
Quoted 4 lines · Jonathan Cameron
Quoted 2 lines · Scott Matheina
Adds braces to second arm of if else statement.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Scott Matheina <[email protected]>This patch is actually correct so applied to the togreg branch of iio.git.
Thanks,
Jonathan
Thanks for the feedback. Last weekend I learned how to compile the kernel to test my changes, and
I'll save your comments for my future patches to get the titles more in line with what is expected.Scott
---
Quoted 23 lines
Quoted 23 lines
drivers/staging/iio/addac/adt7316.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/staging/iio/addac/adt7316.c +2
-1@@ -661,8 +661,9 @@ static ssize_t adt7316_store_da_high_resolution(struct device *dev, chip->dac_bits =12 ; else if (chip->id == ID_ADT7317 || chip->id ==ID_ADT7517 ) chip->dac_bits = 10; - }else + }else { config3 = chip->config3 & (~ADT7316_DA_HIGH_RESOLUTION ); + } ret = chip->bus.write(chip->bus.client, ADT7316_CONFIG3,config3);
if (ret)
PATCH v4 5/8 Remove line after closing braces
In reply to Scott MatheinaThere was an additional line which was un-needed, removed that line.
--- drivers/staging/iio/addac/adt7316.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/iio/addac/adt7316.c +0 -1
@@ -434,7 +434,6 @@ static ssize_t adt7316_store_ad_channel(struct device *dev, config2 = chip->config2 & (~ADT7316_AD_SINGLE_CH_MASK ); } - config2 |= data; ret = chip->bus.write (chip->bus.client,ADT7316_CONFIG2 , config2);
Signature · 1 line
2.7.4
PATCH v4 6/8 Fixed code wrap alignment with preceding (.
In reply to Scott MatheinaThe code wasn't aligned with preceding ( on following lines, fixes this coding style issue.
--- drivers/staging/iio/addac/adt7316.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)
drivers/staging/iio/addac/adt7316.c +17 -17
@@ -317,8 +317,8 @@ static IIO_DEVICE_ATTR(select_ex_temp, S_IRUGO | S_IWUSR, 0);static ssize_t adt7316_show_mode (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -358,8 +358,8 @@ static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, 0);static ssize_t adt7316_show_all_modes (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {return sprintf (buf,"single_channel\nround_robin\n" ); }
@@ -367,8 +367,8 @@ static ssize_t adt7316_show_all_modes(struct device *dev, static IIO_DEVICE_ATTR(all_modes, S_IRUGO, adt7316_show_all_modes, NULL, 0);static ssize_t adt7316_show_ad_channel (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -383,7 +383,7 @@ static ssize_t adt7316_show_ad_channel(struct device *dev,return sprintf (buf,"1 - Internal Temperature\n" );case ADT7316_AD_SINGLE_CH_EX :if (((chip->id &ID_FAMILY_MASK ) ==ID_ADT75XX ) && - (chip->config1 &ADT7516_SEL_AIN1_2_EX_TEMP_MASK ) ==0 ) + (chip->config1 &ADT7516_SEL_AIN1_2_EX_TEMP_MASK ) ==0 )return sprintf (buf,"2 - AIN1\n" );return sprintf (buf,"2 - External Temperature\n" );
@@ -451,8 +451,8 @@ static IIO_DEVICE_ATTR(ad_channel, S_IRUGO | S_IWUSR, 0);static ssize_t adt7316_show_all_ad_channels (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -472,8 +472,8 @@ static IIO_DEVICE_ATTR(all_ad_channels, S_IRUGO, adt7316_show_all_ad_channels, NULL, 0);static ssize_t adt7316_show_disable_averaging (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -511,8 +511,8 @@ static IIO_DEVICE_ATTR(disable_averaging, S_IRUGO | S_IWUSR, 0);static ssize_t adt7316_show_enable_smbus_timeout (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -550,8 +550,8 @@ static IIO_DEVICE_ATTR(enable_smbus_timeout, S_IRUGO | S_IWUSR, 0);static ssize_t adt7316_show_powerdown (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -588,8 +588,8 @@ static IIO_DEVICE_ATTR(powerdown, S_IRUGO | S_IWUSR, 0);static ssize_t adt7316_show_fast_ad_clock (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
Signature · 1 line
2.7.4
Jonathan Cameron
maintainerRe: [PATCHv4 6/8] Fixed code wrap alignment with preceding (.
Quoted 4 lines · Scott Matheina
The code wasn't aligned with preceding ( on following lines, fixes this coding style issue.
Signed-off-by Scott Matheina <[email protected]>
This looks fine, but is invasive enough I suspect it won't apply without some of the earlier patches. If you care to respin this, please give it a title of the same form I suggested for the previous patch.
Jonathan
Quoted 106 lines
--- drivers/staging/iio/addac/adt7316.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)drivers/staging/iio/addac/adt7316.c +17
-17@@ -317,8 +317,8 @@ static IIO_DEVICE_ATTR(select_ex_temp, S_IRUGO | S_IWUSR, 0);static ssize_t adt7316_show_mode (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -358,8 +358,8 @@ static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, 0);static ssize_t adt7316_show_all_modes (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {return sprintf (buf,"single_channel\nround_robin\n" ); }@@ -367,8 +367,8 @@ static ssize_t adt7316_show_all_modes(struct device *dev, static IIO_DEVICE_ATTR(all_modes, S_IRUGO, adt7316_show_all_modes, NULL, 0);static ssize_t adt7316_show_ad_channel (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -383,7 +383,7 @@ static ssize_t adt7316_show_ad_channel(struct device *dev,return sprintf (buf,"1 - Internal Temperature\n" );case ADT7316_AD_SINGLE_CH_EX :if (((chip->id &ID_FAMILY_MASK ) ==ID_ADT75XX ) && - (chip->config1 &ADT7516_SEL_AIN1_2_EX_TEMP_MASK ) ==0 ) + (chip->config1 &ADT7516_SEL_AIN1_2_EX_TEMP_MASK ) ==0 )return sprintf (buf,"2 - AIN1\n" );return sprintf (buf,"2 - External Temperature\n" );@@ -451,8 +451,8 @@ static IIO_DEVICE_ATTR(ad_channel, S_IRUGO | S_IWUSR, 0);static ssize_t adt7316_show_all_ad_channels (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -472,8 +472,8 @@ static IIO_DEVICE_ATTR(all_ad_channels, S_IRUGO, adt7316_show_all_ad_channels, NULL, 0);static ssize_t adt7316_show_disable_averaging (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -511,8 +511,8 @@ static IIO_DEVICE_ATTR(disable_averaging, S_IRUGO | S_IWUSR, 0);static ssize_t adt7316_show_enable_smbus_timeout (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -550,8 +550,8 @@ static IIO_DEVICE_ATTR(enable_smbus_timeout, S_IRUGO | S_IWUSR, 0);static ssize_t adt7316_show_powerdown (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -588,8 +588,8 @@ static IIO_DEVICE_ATTR(powerdown, S_IRUGO | S_IWUSR, 0);static ssize_t adt7316_show_fast_ad_clock (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
PATCH v4 7/8 Changed code to align with coding style of using octat
In reply to Scott MatheinaThe permmission code was changed to reflect octat (0644/0444) for required permissions.
--- drivers/staging/iio/addac/adt7316.c | 264 ++++++++++++++---------------------- 1 file changed, 101 insertions(+), 163 deletions(-)
drivers/staging/iio/addac/adt7316.c +101 -163
@@ -267,10 +267,8 @@ static ssize_t adt7316_store_enabled(struct device *dev,return len; } -static IIO_DEVICE_ATTR(enabled, S_IRUGO | S_IWUSR, - adt7316_show_enabled, - adt7316_store_enabled, - 0); +static iio_device_attr(enabled, 0644, adt7316_show_enabled, + adt7316_store_enabled, 0); static ssize_t adt7316_show_select_ex_temp(struct device *dev, struct device_attribute *attr,
@@ -311,10 +309,8 @@ static ssize_t adt7316_store_select_ex_temp(struct device *dev,return len; } -static IIO_DEVICE_ATTR(select_ex_temp, S_IRUGO | S_IWUSR, - adt7316_show_select_ex_temp, - adt7316_store_select_ex_temp, - 0); +static iio_device_attr(select_ex_temp, 0644, adt7316_show_select_ex_temp, + adt7316_store_select_ex_temp, 0); static ssize_t adt7316_show_mode(struct device *dev, struct device_attribute *attr,
@@ -352,10 +348,7 @@ static ssize_t adt7316_store_mode(struct device *dev,return len; } -static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, - adt7316_show_mode, - adt7316_store_mode, - 0); +static iio_device_attr(mode, 0644, adt7316_show_mode, adt7316_store_mode, 0); static ssize_t adt7316_show_all_modes(struct device *dev, struct device_attribute *attr,
@@ -364,7 +357,7 @@ static ssize_t adt7316_show_all_modes(struct device *dev,return sprintf (buf,"single_channel\nround_robin\n" ); } -static IIO_DEVICE_ATTR(all_modes, S_IRUGO, adt7316_show_all_modes, NULL, 0); +static iio_device_attr(all_modes, 0444, adt7316_show_all_modes, NULL, 0); static ssize_t adt7316_show_ad_channel(struct device *dev, struct device_attribute *attr,
@@ -445,10 +438,8 @@ static ssize_t adt7316_store_ad_channel(struct device *dev,return len; } -static IIO_DEVICE_ATTR(ad_channel, S_IRUGO | S_IWUSR, - adt7316_show_ad_channel, - adt7316_store_ad_channel, - 0); +static iio_device_attr(ad_channel, 0644, adt7316_show_ad_channel, + adt7316_store_ad_channel, 0); static ssize_t adt7316_show_all_ad_channels(struct device *dev, struct device_attribute *attr,
@@ -468,8 +459,8 @@ static ssize_t adt7316_show_all_ad_channels(struct device *dev, "2 - External Temperature\n"); } -static IIO_DEVICE_ATTR(all_ad_channels, S_IRUGO, - adt7316_show_all_ad_channels, NULL, 0); +static iio_device_attr(all_ad_channels, 0444, adt7316_show_all_ad_channels, + NULL, 0); static ssize_t adt7316_show_disable_averaging(struct device *dev, struct device_attribute *attr,
@@ -505,10 +496,8 @@ static ssize_t adt7316_store_disable_averaging(struct device *dev,return len; } -static IIO_DEVICE_ATTR(disable_averaging, S_IRUGO | S_IWUSR, - adt7316_show_disable_averaging, - adt7316_store_disable_averaging, - 0); +static iio_device_attr(disable_averaging, 0644, adt7316_show_disable_averaging, + adt7316_store_disable_averaging, 0); static ssize_t adt7316_show_enable_smbus_timeout(struct device *dev, struct device_attribute *attr,
@@ -544,10 +533,9 @@ static ssize_t adt7316_store_enable_smbus_timeout(struct device *dev,return len; } -static IIO_DEVICE_ATTR(enable_smbus_timeout, S_IRUGO | S_IWUSR, - adt7316_show_enable_smbus_timeout, - adt7316_store_enable_smbus_timeout, - 0); +static iio_device_attr(enable_smbus_timeout, 0644, + adt7316_show_enable_smbus_timeout, + adt7316_store_enable_smbus_timeout, 0); static ssize_t adt7316_show_powerdown(struct device *dev, struct device_attribute *attr,
@@ -582,10 +570,8 @@ static ssize_t adt7316_store_powerdown(struct device *dev,return len; } -static IIO_DEVICE_ATTR(powerdown, S_IRUGO | S_IWUSR, - adt7316_show_powerdown, - adt7316_store_powerdown, - 0); +static iio_device_attr(powerdown, 0644, adt7316_show_powerdown, + adt7316_store_powerdown, 0); static ssize_t adt7316_show_fast_ad_clock(struct device *dev, struct device_attribute *attr,
@@ -620,10 +606,8 @@ static ssize_t adt7316_store_fast_ad_clock(struct device *dev,return len; } -static IIO_DEVICE_ATTR(fast_ad_clock, S_IRUGO | S_IWUSR, - adt7316_show_fast_ad_clock, - adt7316_store_fast_ad_clock, - 0); +static iio_device_attr(fast_ad_clock, 0644, adt7316_show_fast_ad_clock, + adt7316_store_fast_ad_clock, 0); static ssize_t adt7316_show_da_high_resolution(struct device *dev, struct device_attribute *attr,
@@ -673,10 +657,9 @@ static ssize_t adt7316_store_da_high_resolution(struct device *dev,return len; } -static IIO_DEVICE_ATTR(da_high_resolution, S_IRUGO | S_IWUSR, - adt7316_show_da_high_resolution, - adt7316_store_da_high_resolution, - 0); +static iio_device_attr(da_high_resolution, 0644, + adt7316_show_da_high_resolution, + adt7316_store_da_high_resolution, 0); static ssize_t adt7316_show_AIN_internal_Vref(struct device *dev, struct device_attribute *attr,
@@ -719,10 +702,9 @@ static ssize_t adt7316_store_AIN_internal_Vref(struct device *dev,return len; } -static IIO_DEVICE_ATTR(AIN_internal_Vref, S_IRUGO | S_IWUSR, - adt7316_show_AIN_internal_Vref, - adt7316_store_AIN_internal_Vref, - 0); +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,
@@ -759,10 +741,9 @@ static ssize_t adt7316_store_enable_prop_DACA(struct device *dev,return len; } -static IIO_DEVICE_ATTR(enable_proportion_DACA, S_IRUGO | S_IWUSR, - adt7316_show_enable_prop_DACA, - adt7316_store_enable_prop_DACA, - 0); +static iio_device_attr(enable_proportion_daca, 0644, + adt7316_show_enable_prop_daca, + adt7316_store_enable_prop_daca, 0); static ssize_t adt7316_show_enable_prop_DACB(struct device *dev, struct device_attribute *attr,
@@ -798,10 +779,9 @@ static ssize_t adt7316_store_enable_prop_DACB(struct device *dev,return len; } -static IIO_DEVICE_ATTR(enable_proportion_DACB, S_IRUGO | S_IWUSR, - adt7316_show_enable_prop_DACB, - adt7316_store_enable_prop_DACB, - 0); +static iio_device_attr(enable_proportion_dacb, 0644, + adt7316_show_enable_prop_dacb, + adt7316_store_enable_prop_dacb, 0); static ssize_t adt7316_show_DAC_2Vref_ch_mask(struct device *dev, struct device_attribute *attr,
@@ -841,10 +821,9 @@ static ssize_t adt7316_store_DAC_2Vref_ch_mask(struct device *dev,return len; } -static IIO_DEVICE_ATTR(DAC_2Vref_channels_mask, S_IRUGO | S_IWUSR, - adt7316_show_DAC_2Vref_ch_mask, - adt7316_store_DAC_2Vref_ch_mask, - 0); +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, struct device_attribute *attr,
@@ -901,10 +880,8 @@ static ssize_t adt7316_store_DAC_update_mode(struct device *dev,return len; } -static IIO_DEVICE_ATTR(DAC_update_mode, S_IRUGO | S_IWUSR, - adt7316_show_DAC_update_mode, - adt7316_store_DAC_update_mode, - 0); +static iio_device_attr(DAC_update_mode, 0644, adt7316_show_dac_update_mode, + adt7316_store_dac_update_mode, 0); static ssize_t adt7316_show_all_DAC_update_modes(struct device *dev, struct device_attribute *attr,
@@ -921,9 +898,8 @@ static ssize_t adt7316_show_all_DAC_update_modes(struct device *dev,return sprintf (buf,"manual\n" ); } -static IIO_DEVICE_ATTR(all_DAC_update_modes, S_IRUGO, - adt7316_show_all_DAC_update_modes, NULL, 0); - +static iio_device_attr(all_dac_update_modes, 0444, + adt7316_show_all_dac_update_modes, NULL, 0); static ssize_t adt7316_store_update_DAC(struct device *dev, struct device_attribute *attr,
@@ -960,10 +936,7 @@ static ssize_t adt7316_store_update_DAC(struct device *dev,return len; } -static IIO_DEVICE_ATTR(update_DAC, S_IRUGO | S_IWUSR, -NULL , - adt7316_store_update_DAC, - 0); +static iio_device_attr(update_dac, 0644, NULL, adt7316_store_update_dac, 0); static ssize_t adt7316_show_DA_AB_Vref_bypass(struct device *dev, struct device_attribute *attr,
@@ -1005,10 +978,8 @@ static ssize_t adt7316_store_DA_AB_Vref_bypass(struct device *dev,return len; } -static IIO_DEVICE_ATTR(DA_AB_Vref_bypass, S_IRUGO | S_IWUSR, - adt7316_show_DA_AB_Vref_bypass, - adt7316_store_DA_AB_Vref_bypass, - 0); +static iio_device_attr(da_ab_vref_bypass, 0644, adt7316_show_da_ab_vref_bypass, + adt7316_store_da_ab_vref_bypass, 0); static ssize_t adt7316_show_DA_CD_Vref_bypass(struct device *dev, struct device_attribute *attr,
@@ -1050,10 +1021,8 @@ static ssize_t adt7316_store_DA_CD_Vref_bypass(struct device *dev,return len; } -static IIO_DEVICE_ATTR(DA_CD_Vref_bypass, S_IRUGO | S_IWUSR, - adt7316_show_DA_CD_Vref_bypass, - adt7316_store_DA_CD_Vref_bypass, - 0); +static iio_device_attr(da_cd_vref_bypass, 0644, adt7316_show_da_cd_vref_bypass, + adt7316_store_da_cd_vref_bypass, 0); static ssize_t adt7316_show_DAC_internal_Vref(struct device *dev, struct device_attribute *attr,
@@ -1111,10 +1080,8 @@ static ssize_t adt7316_store_DAC_internal_Vref(struct device *dev,return len; } -static IIO_DEVICE_ATTR(DAC_internal_Vref, S_IRUGO | S_IWUSR, - adt7316_show_DAC_internal_Vref, - adt7316_store_DAC_internal_Vref, - 0); +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,int channel,char *buf)
@@ -1200,7 +1167,8 @@ static ssize_t adt7316_show_VDD(struct device *dev,return adt7316_show_ad (chip,ADT7316_AD_SINGLE_CH_VDD , buf); } -static IIO_DEVICE_ATTR(VDD, S_IRUGO, adt7316_show_VDD, NULL, 0); + +static iio_device_attr(VDD, 0444, adt7316_show_VDD, NULL, 0); static ssize_t adt7316_show_in_temp(struct device *dev, struct device_attribute *attr,
@@ -1212,7 +1180,7 @@ static ssize_t adt7316_show_in_temp(struct device *dev,return adt7316_show_ad (chip,ADT7316_AD_SINGLE_CH_IN , buf); } -static IIO_DEVICE_ATTR(in_temp, S_IRUGO, adt7316_show_in_temp, NULL, 0); +static iio_device_attr(in_temp, 0444, adt7316_show_in_temp, NULL, 0); static ssize_t adt7316_show_ex_temp_AIN1(struct device *dev, struct device_attribute *attr,
@@ -1224,9 +1192,9 @@ static ssize_t adt7316_show_ex_temp_AIN1(struct device *dev,return adt7316_show_ad (chip,ADT7316_AD_SINGLE_CH_EX , buf); } -static IIO_DEVICE_ATTR(ex_temp_AIN1, S_IRUGO, adt7316_show_ex_temp_AIN1, - NULL, 0); -static IIO_DEVICE_ATTR(ex_temp, S_IRUGO, adt7316_show_ex_temp_AIN1, NULL, 0); +static iio_device_attr(ex_temp_ain1, 0444, adt7316_show_ex_temp_ain1, NULL, 0); + +static iio_device_attr(ex_temp, 0444, adt7316_show_ex_temp_ain1, NULL, 0); static ssize_t adt7316_show_AIN2(struct device *dev, struct device_attribute *attr,
@@ -1237,29 +1205,32 @@ static ssize_t adt7316_show_AIN2(struct device *dev,return adt7316_show_ad (chip,ADT7516_AD_SINGLE_CH_AIN2 , buf); } -static IIO_DEVICE_ATTR(AIN2, S_IRUGO, adt7316_show_AIN2, NULL, 0); -static ssize_t adt7316_show_AIN3 (struct device *dev, -struct device_attribute *attr, -char *buf) +static iio_device_attr(ain2, 0444, adt7316_show_AIN2, NULL, 0); + +static ssize_t adt7316_show_ain3 (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_show_ad (chip,ADT7516_AD_SINGLE_CH_AIN3 , buf); } -static IIO_DEVICE_ATTR(AIN3, S_IRUGO, adt7316_show_AIN3, NULL, 0); -static ssize_t adt7316_show_AIN4 (struct device *dev, -struct device_attribute *attr, -char *buf) +static iio_device_attr(ain3, 0444, adt7316_show_ain3, NULL, 0); + +static ssize_t adt7316_show_ain4 (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_show_ad (chip,ADT7516_AD_SINGLE_CH_AIN4 , buf); } -static IIO_DEVICE_ATTR(AIN4, S_IRUGO, adt7316_show_AIN4, NULL, 0); + +static iio_device_attr(ain4, 0444, adt7316_show_ain4, NULL, 0);static ssize_t adt7316_show_temp_offset (struct adt7316_chip_info *chip,int offset_addr,char *buf)
@@ -1324,9 +1295,8 @@ static ssize_t adt7316_store_in_temp_offset(struct device *dev, len); } -static IIO_DEVICE_ATTR(in_temp_offset, S_IRUGO | S_IWUSR, - adt7316_show_in_temp_offset, - adt7316_store_in_temp_offset, 0); +static iio_device_attr(in_temp_offset, 0644, adt7316_show_in_temp_offset, + adt7316_store_in_temp_offset, 0); static ssize_t adt7316_show_ex_temp_offset(struct device *dev, struct device_attribute *attr,
@@ -1404,7 +1374,7 @@ static ssize_t adt7316_store_ex_analog_temp_offset(struct device *dev, ADT7316_EX_ANALOG_TEMP_OFFSET, buf, len); } -static IIO_DEVICE_ATTR(ex_analog_temp_offset, S_IRUGO | S_IWUSR, +static iio_device_attr(ex_analog_temp_offset, 0644, adt7316_show_ex_analog_temp_offset, adt7316_store_ex_analog_temp_offset, 0);
@@ -1499,8 +1469,7 @@ static ssize_t adt7316_store_DAC_A(struct device *dev,return adt7316_store_dac (chip,0 , buf, len); } -static IIO_DEVICE_ATTR(DAC_A, S_IRUGO | S_IWUSR, adt7316_show_DAC_A, - adt7316_store_DAC_A, 0); +static iio_device_attr(dac_a, 0644, adt7316_show_dac_a, adt7316_store_dac_a, 0); static ssize_t adt7316_show_DAC_B(struct device *dev, struct device_attribute *attr,
@@ -1523,8 +1492,7 @@ static ssize_t adt7316_store_DAC_B(struct device *dev,return adt7316_store_dac (chip,1 , buf, len); } -static IIO_DEVICE_ATTR(DAC_B, S_IRUGO | S_IWUSR, adt7316_show_DAC_B, - adt7316_store_DAC_B, 0); +static iio_device_attr(dac_b, 0644, adt7316_show_dac_b, adt7316_store_dac_b, 0); static ssize_t adt7316_show_DAC_C(struct device *dev, struct device_attribute *attr,
@@ -1547,8 +1515,7 @@ static ssize_t adt7316_store_DAC_C(struct device *dev,return adt7316_store_dac (chip,2 , buf, len); } -static IIO_DEVICE_ATTR(DAC_C, S_IRUGO | S_IWUSR, adt7316_show_DAC_C, - adt7316_store_DAC_C, 0); +static iio_device_attr(DAC_C, 0644, adt7316_show_dac_c, adt7316_store_dac_c, 0); static ssize_t adt7316_show_DAC_D(struct device *dev, struct device_attribute *attr,
@@ -1571,8 +1538,7 @@ static ssize_t adt7316_store_DAC_D(struct device *dev,return adt7316_store_dac (chip,3 , buf, len); } -static IIO_DEVICE_ATTR(DAC_D, S_IRUGO | S_IWUSR, adt7316_show_DAC_D, - adt7316_store_DAC_D, 0); +static iio_device_attr(DAC_D, 0644, adt7316_show_dac_d, adt7316_store_dac_d, 0); static ssize_t adt7316_show_device_id(struct device *dev, struct device_attribute *attr,
@@ -1608,8 +1574,8 @@ static ssize_t adt7316_show_manufactorer_id(struct device *dev,return sprintf (buf,"%d\n" , id); } -static IIO_DEVICE_ATTR(manufactorer_id, S_IRUGO, - adt7316_show_manufactorer_id, NULL, 0); +static iio_device_attr(manufactorer_id, 0444, adt7316_show_manufactorer_id, + NULL, 0); static ssize_t adt7316_show_device_rev(struct device *dev, struct device_attribute *attr,
@@ -1627,7 +1593,7 @@ static ssize_t adt7316_show_device_rev(struct device *dev,return sprintf (buf,"%d\n" , rev); } -static IIO_DEVICE_ATTR(device_rev, S_IRUGO, adt7316_show_device_rev, NULL, 0); +static iio_device_attr(device_rev, 0444, adt7316_show_device_rev, NULL, 0); static ssize_t adt7316_show_bus_type(struct device *dev, struct device_attribute *attr,
@@ -1648,7 +1614,7 @@ static ssize_t adt7316_show_bus_type(struct device *dev,return sprintf (buf,"i2c\n" ); } -static IIO_DEVICE_ATTR(bus_type, S_IRUGO, adt7316_show_bus_type, NULL, 0); +static iio_device_attr(bus_type, 0444, adt7316_show_bus_type, NULL, 0);static struct attribute *adt7316_attributes[] = { &iio_dev_attr_all_modes.dev_attr.attr,
@@ -1970,63 +1936,35 @@ static ssize_t adt7316_set_int_enabled(struct device *dev,return len; } -static IIO_DEVICE_ATTR(int_mask, - S_IRUGO | S_IWUSR, - adt7316_show_int_mask, adt7316_set_int_mask, - 0); -static IIO_DEVICE_ATTR(in_temp_high_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7316_IN_TEMP_HIGH); -static IIO_DEVICE_ATTR(in_temp_low_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7316_IN_TEMP_LOW); -static IIO_DEVICE_ATTR(ex_temp_high_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7316_EX_TEMP_HIGH); -static IIO_DEVICE_ATTR(ex_temp_low_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7316_EX_TEMP_LOW); +static iio_device_attr(int_mask, 0644, adt7316_show_int_mask, + adt7316_set_int_mask, 0); +static iio_device_attr(in_temp_high_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7316_IN_TEMP_HIGH); +static iio_device_attr(in_temp_low_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7316_IN_TEMP_LOW); +static iio_device_attr(ex_temp_high_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7316_EX_TEMP_HIGH); +static iio_device_attr(ex_temp_low_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7316_EX_TEMP_LOW);/* NASTY duplication to be fixed */ -static IIO_DEVICE_ATTR(ex_temp_ain1_high_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7316_EX_TEMP_HIGH); -static IIO_DEVICE_ATTR(ex_temp_ain1_low_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7316_EX_TEMP_LOW); -static IIO_DEVICE_ATTR(ain2_high_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7516_AIN2_HIGH); -static IIO_DEVICE_ATTR(ain2_low_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7516_AIN2_LOW); -static IIO_DEVICE_ATTR(ain3_high_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7516_AIN3_HIGH); -static IIO_DEVICE_ATTR(ain3_low_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7516_AIN3_LOW); -static IIO_DEVICE_ATTR(ain4_high_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7516_AIN4_HIGH); -static IIO_DEVICE_ATTR(ain4_low_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7516_AIN4_LOW); -static IIO_DEVICE_ATTR(int_enabled, - S_IRUGO | S_IWUSR, - adt7316_show_int_enabled, +static iio_device_attr(ex_temp_ain1_high_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7316_EX_TEMP_HIGH); +static iio_device_attr(ex_temp_ain1_low_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7316_EX_TEMP_LOW); +static iio_device_attr(ain2_high_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7516_AIN2_HIGH); +static iio_device_attr(ain2_low_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7516_AIN2_LOW); +static iio_device_attr(ain3_high_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7516_AIN3_HIGH); +static iio_device_attr(ain3_low_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7516_AIN3_LOW); +static iio_device_attr(ain4_high_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7516_AIN4_HIGH); +static iio_device_attr(ain4_low_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7516_AIN4_LOW); +static iio_device_attr(int_enabled, 0644, adt7316_show_int_enabled, adt7316_set_int_enabled, 0);static struct attribute *adt7316_event_attributes[] = {
Signature · 1 line
2.7.4
kbuild test robot
build botRe: [PATCHv4 7/8] Changed code to align with coding style of using octat
reproduce:
Hi Scott,
[auto build test ERROR on iio/togreg]
[also build test ERROR on v4.9 next-20161224]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Scott-Matheina/Checkpatch-fixes-to-driver-staging-iio-addac/20161226-041021 base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg config: i386-randconfig-x001-201652 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=i386
All errors (new ones prefixed by >>):
>> drivers/staging/iio/addac/adt7316.c:270:33: error: expected ')' before numeric constant
static iio_device_attr(enabled, 0644, adt7316_show_enabled,
^~~~
drivers/staging/iio/addac/adt7316.c:312:40: error: expected ')' before numeric constant
static iio_device_attr(select_ex_temp, 0644, adt7316_show_select_ex_temp,
^~~~
drivers/staging/iio/addac/adt7316.c:351:30: error: expected ')' before numeric constant
static iio_device_attr(mode, 0644, adt7316_show_mode, adt7316_store_mode, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:360:35: error: expected ')' before numeric constant
static iio_device_attr(all_modes, 0444, adt7316_show_all_modes, NULL, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:441:36: error: expected ')' before numeric constant
static iio_device_attr(ad_channel, 0644, adt7316_show_ad_channel,
^~~~
drivers/staging/iio/addac/adt7316.c:462:41: error: expected ')' before numeric constant
static iio_device_attr(all_ad_channels, 0444, adt7316_show_all_ad_channels,
^~~~
drivers/staging/iio/addac/adt7316.c:499:43: error: expected ')' before numeric constant
static iio_device_attr(disable_averaging, 0644, adt7316_show_disable_averaging,
^~~~
drivers/staging/iio/addac/adt7316.c:536:46: error: expected ')' before numeric constant
static iio_device_attr(enable_smbus_timeout, 0644,
^~~~
drivers/staging/iio/addac/adt7316.c:573:35: error: expected ')' before numeric constant
static iio_device_attr(powerdown, 0644, adt7316_show_powerdown,
^~~~
drivers/staging/iio/addac/adt7316.c:609:39: error: expected ')' before numeric constant
static iio_device_attr(fast_ad_clock, 0644, adt7316_show_fast_ad_clock,
^~~~
drivers/staging/iio/addac/adt7316.c:660:44: error: expected ')' before numeric constant
static iio_device_attr(da_high_resolution, 0644,
^~~~
drivers/staging/iio/addac/adt7316.c:705:43: error: expected ')' before numeric constant
static iio_device_attr(ain_internal_vref, 0644,
^~~~
drivers/staging/iio/addac/adt7316.c:744:48: error: expected ')' before numeric constant
static iio_device_attr(enable_proportion_daca, 0644,
^~~~
drivers/staging/iio/addac/adt7316.c:782:48: error: expected ')' before numeric constant
static iio_device_attr(enable_proportion_dacb, 0644,
^~~~
drivers/staging/iio/addac/adt7316.c:824:49: error: expected ')' before numeric constant
static iio_device_attr(dac_2vref_channels_mask, 0644,
^~~~
drivers/staging/iio/addac/adt7316.c:883:41: error: expected ')' before numeric constant
static iio_device_attr(DAC_update_mode, 0644, adt7316_show_dac_update_mode,
^~~~
drivers/staging/iio/addac/adt7316.c:901:46: error: expected ')' before numeric constant
static iio_device_attr(all_dac_update_modes, 0444,
^~~~
drivers/staging/iio/addac/adt7316.c:939:36: error: expected ')' before numeric constant
static iio_device_attr(update_dac, 0644, NULL, adt7316_store_update_dac, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:981:43: error: expected ')' before numeric constant
static iio_device_attr(da_ab_vref_bypass, 0644, adt7316_show_da_ab_vref_bypass,
^~~~
drivers/staging/iio/addac/adt7316.c:1024:43: error: expected ')' before numeric constant
static iio_device_attr(da_cd_vref_bypass, 0644, adt7316_show_da_cd_vref_bypass,
^~~~
drivers/staging/iio/addac/adt7316.c:1083:43: error: expected ')' before numeric constant
static iio_device_attr(dac_internal_vref, 0644, adt7316_show_dac_internal_vref,
^~~~
drivers/staging/iio/addac/adt7316.c:1171:29: error: expected ')' before numeric constant
static iio_device_attr(VDD, 0444, adt7316_show_VDD, NULL, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1183:33: error: expected ')' before numeric constant
static iio_device_attr(in_temp, 0444, adt7316_show_in_temp, NULL, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1195:38: error: expected ')' before numeric constant
static iio_device_attr(ex_temp_ain1, 0444, adt7316_show_ex_temp_ain1, NULL, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1197:33: error: expected ')' before numeric constant
static iio_device_attr(ex_temp, 0444, adt7316_show_ex_temp_ain1, NULL, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1209:30: error: expected ')' before numeric constant
static iio_device_attr(ain2, 0444, adt7316_show_AIN2, NULL, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1221:30: error: expected ')' before numeric constant
static iio_device_attr(ain3, 0444, adt7316_show_ain3, NULL, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1233:30: error: expected ')' before numeric constant
static iio_device_attr(ain4, 0444, adt7316_show_ain4, NULL, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1298:40: error: expected ')' before numeric constant
static iio_device_attr(in_temp_offset, 0644, adt7316_show_in_temp_offset,
^~~~
drivers/staging/iio/addac/adt7316.c:1377:47: error: expected ')' before numeric constant
static iio_device_attr(ex_analog_temp_offset, 0644,
^~~~
drivers/staging/iio/addac/adt7316.c: In function 'adt7316_show_DAC_A':
drivers/staging/iio/addac/adt7316.c:1458:9: error: implicit declaration of function 'adt7316_show_dac' [-Werror=implicit-function-declaration]
return adt7316_show_dac(chip, 0, buf);
^~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c: In function 'adt7316_store_DAC_A':
drivers/staging/iio/addac/adt7316.c:1469:9: error: implicit declaration of function 'adt7316_store_dac' [-Werror=implicit-function-declaration]
return adt7316_store_dac(chip, 0, buf, len);
^~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c: At top level:
drivers/staging/iio/addac/adt7316.c:1472:31: error: expected ')' before numeric constant
static iio_device_attr(dac_a, 0644, adt7316_show_dac_a, adt7316_store_dac_a, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1495:31: error: expected ')' before numeric constant
static iio_device_attr(dac_b, 0644, adt7316_show_dac_b, adt7316_store_dac_b, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1518:31: error: expected ')' before numeric constant
static iio_device_attr(DAC_C, 0644, adt7316_show_dac_c, adt7316_store_dac_c, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1541:31: error: expected ')' before numeric constant
static iio_device_attr(DAC_D, 0644, adt7316_show_dac_d, adt7316_store_dac_d, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1577:41: error: expected ')' before numeric constant
static iio_device_attr(manufactorer_id, 0444, adt7316_show_manufactorer_id,
^~~~
drivers/staging/iio/addac/adt7316.c:1596:36: error: expected ')' before numeric constant
static iio_device_attr(device_rev, 0444, adt7316_show_device_rev, NULL, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1617:34: error: expected ')' before numeric constant
static iio_device_attr(bus_type, 0444, adt7316_show_bus_type, NULL, 0);
^~~~
>> drivers/staging/iio/addac/adt7316.c:1620:3: error: 'iio_dev_attr_all_modes' undeclared here (not in a function)
&iio_dev_attr_all_modes.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1621:3: error: 'iio_dev_attr_mode' undeclared here (not in a function)
&iio_dev_attr_mode.dev_attr.attr,
^~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1622:3: error: 'iio_dev_attr_enabled' undeclared here (not in a function)
&iio_dev_attr_enabled.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1623:3: error: 'iio_dev_attr_ad_channel' undeclared here (not in a function)
&iio_dev_attr_ad_channel.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1624:3: error: 'iio_dev_attr_all_ad_channels' undeclared here (not in a function)
&iio_dev_attr_all_ad_channels.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1625:3: error: 'iio_dev_attr_disable_averaging' undeclared here (not in a function)
&iio_dev_attr_disable_averaging.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1626:3: error: 'iio_dev_attr_enable_smbus_timeout' undeclared here (not in a function)
&iio_dev_attr_enable_smbus_timeout.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1627:3: error: 'iio_dev_attr_powerdown' undeclared here (not in a function)
&iio_dev_attr_powerdown.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1628:3: error: 'iio_dev_attr_fast_ad_clock' undeclared here (not in a function)
&iio_dev_attr_fast_ad_clock.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1629:3: error: 'iio_dev_attr_da_high_resolution' undeclared here (not in a function)
&iio_dev_attr_da_high_resolution.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1630:3: error: 'iio_dev_attr_enable_proportion_daca' undeclared here (not in a function)
&iio_dev_attr_enable_proportion_daca.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1631:3: error: 'iio_dev_attr_enable_proportion_dacb' undeclared here (not in a function)
&iio_dev_attr_enable_proportion_dacb.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1632:3: error: 'iio_dev_attr_dac_2vref_channels_mask' undeclared here (not in a function)
&iio_dev_attr_dac_2vref_channels_mask.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1633:3: error: 'iio_dev_attr_dac_internal_vref' undeclared here (not in a function)
&iio_dev_attr_dac_internal_vref.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1634:3: error: 'iio_dev_attr_all_dac_update_modes' undeclared here (not in a function)
&iio_dev_attr_all_dac_update_modes.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1635:3: error: 'iio_dev_attr_update_dac' undeclared here (not in a function)
&iio_dev_attr_update_dac.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1636:3: error: 'iio_dev_attr_da_ab_vref_bypass' undeclared here (not in a function)
&iio_dev_attr_da_ab_vref_bypass.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1637:3: error: 'iio_dev_attr_da_cd_vref_bypass' undeclared here (not in a function)
&iio_dev_attr_da_cd_vref_bypass.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1639:3: error: 'iio_dev_attr_vdd' undeclared here (not in a function)
&iio_dev_attr_vdd.dev_attr.attr,
^~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1640:3: error: 'iio_dev_attr_in_temp' undeclared here (not in a function)
&iio_dev_attr_in_temp.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1641:3: error: 'iio_dev_attr_ex_temp' undeclared here (not in a function)
&iio_dev_attr_ex_temp.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1642:3: error: 'iio_dev_attr_in_temp_offset' undeclared here (not in a function)
&iio_dev_attr_in_temp_offset.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1645:3: error: 'iio_dev_attr_ex_analog_temp_offset' undeclared here (not in a function)
&iio_dev_attr_ex_analog_temp_offset.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1646:3: error: 'iio_dev_attr_dac_a' undeclared here (not in a function)
&iio_dev_attr_dac_a.dev_attr.attr,
^~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1647:3: error: 'iio_dev_attr_dac_b' undeclared here (not in a function)
&iio_dev_attr_dac_b.dev_attr.attr,
^~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1648:3: error: 'iio_dev_attr_dac_c' undeclared here (not in a function)
&iio_dev_attr_dac_c.dev_attr.attr,
^~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1649:3: error: 'iio_dev_attr_dac_d' undeclared here (not in a function)
&iio_dev_attr_dac_d.dev_attr.attr,
^~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1651:3: error: 'iio_dev_attr_manufactorer_id' undeclared here (not in a function)
&iio_dev_attr_manufactorer_id.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1652:3: error: 'iio_dev_attr_device_rev' undeclared here (not in a function)
&iio_dev_attr_device_rev.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1653:3: error: 'iio_dev_attr_bus_type' undeclared here (not in a function)
&iio_dev_attr_bus_type.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1662:25: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_all_modes.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1662:34: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_all_modes.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1662:2: error: initializer element is not constant
&iio_dev_attr_all_modes.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1662:2: note: (near initialization for 'adt7516_attributes[0]')
drivers/staging/iio/addac/adt7316.c:1663:20: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_mode.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1663:29: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_mode.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1663:2: error: initializer element is not constant
&iio_dev_attr_mode.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1663:2: note: (near initialization for 'adt7516_attributes[1]')
>> drivers/staging/iio/addac/adt7316.c:1664:3: error: 'iio_dev_attr_select_ex_temp' undeclared here (not in a function)
&iio_dev_attr_select_ex_temp.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1664:30: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_select_ex_temp.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1664:39: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_select_ex_temp.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1664:2: error: initializer element is not constant
&iio_dev_attr_select_ex_temp.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1664:2: note: (near initialization for 'adt7516_attributes[2]')
drivers/staging/iio/addac/adt7316.c:1665:23: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_enabled.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1665:32: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_enabled.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1665:2: error: initializer element is not constant
&iio_dev_attr_enabled.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1665:2: note: (near initialization for 'adt7516_attributes[3]')
drivers/staging/iio/addac/adt7316.c:1666:26: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_ad_channel.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1666:35: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_ad_channel.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1666:2: error: initializer element is not constant
&iio_dev_attr_ad_channel.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1666:2: note: (near initialization for 'adt7516_attributes[4]')
drivers/staging/iio/addac/adt7316.c:1667:31: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_all_ad_channels.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1667:40: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_all_ad_channels.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1667:2: error: initializer element is not constant
&iio_dev_attr_all_ad_channels.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1667:2: note: (near initialization for 'adt7516_attributes[5]')
drivers/staging/iio/addac/adt7316.c:1668:33: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_disable_averaging.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1668:42: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_disable_averaging.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1668:2: error: initializer element is not constant
&iio_dev_attr_disable_averaging.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1668:2: note: (near initialization for 'adt7516_attributes[6]')
drivers/staging/iio/addac/adt7316.c:1669:36: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_enable_smbus_timeout.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1669:45: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_enable_smbus_timeout.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1669:2: error: initializer element is not constant
&iio_dev_attr_enable_smbus_timeout.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1669:2: note: (near initialization for 'adt7516_attributes[7]')
drivers/staging/iio/addac/adt7316.c:1670:25: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_powerdown.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1670:34: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_powerdown.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1670:2: error: initializer element is not constant
&iio_dev_attr_powerdown.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1670:2: note: (near initialization for 'adt7516_attributes[8]')
drivers/staging/iio/addac/adt7316.c:1671:29: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_fast_ad_clock.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1671:38: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_fast_ad_clock.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1671:2: error: initializer element is not constant
&iio_dev_attr_fast_ad_clock.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1671:2: note: (near initialization for 'adt7516_attributes[9]')
drivers/staging/iio/addac/adt7316.c:1672:3: error: 'iio_dev_attr_ain_internal_vref' undeclared here (not in a function)
&iio_dev_attr_ain_internal_vref.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1672:33: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_ain_internal_vref.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1672:42: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_ain_internal_vref.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1672:2: error: initializer element is not constant
&iio_dev_attr_ain_internal_vref.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1672:2: note: (near initialization for 'adt7516_attributes[10]')
drivers/staging/iio/addac/adt7316.c:1673:34: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_da_high_resolution.dev_attr.attr,
^ drivers/staging/iio/addac/adt7316.c:1673:43: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_da_high_resolution.dev_attr.attr,
..
vim +270 drivers/staging/iio/addac/adt7316.c
264 if (_adt7316_store_enabled(chip, enable) < 0)
265 return -EIO;
266
267 return len;
268 }
269
> 270 static iio_device_attr(enabled, 0644, adt7316_show_enabled,
271 adt7316_store_enabled, 0);
272
273 static ssize_t adt7316_show_select_ex_temp(struct device *dev,
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Jonathan Cameron
maintainerRe: [PATCHv4 7/8] Changed code to align with coding style of using octat
In reply to Scott MatheinaQuoted 3 lines · Scott Matheina
The permmission code was changed to reflect octat (0644/0444) for required permissions.
Signed-off-by Scott Matheina <[email protected]>
The particularly comment from Linus that lead to this 'rule' coming in recently was fair enough, but the rule creates a lot of churn. I have been applying them when then form part of a larger set, so fair enough having it in here.
However, the ABI in this driver is so broken, I'd rather this sort of change got left until after that is fixed ideally. Most of these elements you are fixing will go away as part of fixing that up.
Jonathan
Quoted 534 lines
--- drivers/staging/iio/addac/adt7316.c | 264 ++++++++++++++---------------------- 1 file changed, 101 insertions(+), 163 deletions(-)drivers/staging/iio/addac/adt7316.c +101
-163@@ -267,10 +267,8 @@ static ssize_t adt7316_store_enabled(struct device *dev,return len; } -static IIO_DEVICE_ATTR(enabled, S_IRUGO | S_IWUSR, - adt7316_show_enabled, - adt7316_store_enabled, - 0); +static iio_device_attr(enabled, 0644, adt7316_show_enabled, + adt7316_store_enabled, 0); static ssize_t adt7316_show_select_ex_temp(struct device *dev, struct device_attribute *attr,@@ -311,10 +309,8 @@ static ssize_t adt7316_store_select_ex_temp(struct device *dev,return len; } -static IIO_DEVICE_ATTR(select_ex_temp, S_IRUGO | S_IWUSR, - adt7316_show_select_ex_temp, - adt7316_store_select_ex_temp, - 0); +static iio_device_attr(select_ex_temp, 0644, adt7316_show_select_ex_temp, + adt7316_store_select_ex_temp, 0); static ssize_t adt7316_show_mode(struct device *dev, struct device_attribute *attr,@@ -352,10 +348,7 @@ static ssize_t adt7316_store_mode(struct device *dev,return len; } -static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, - adt7316_show_mode, - adt7316_store_mode, - 0); +static iio_device_attr(mode, 0644, adt7316_show_mode, adt7316_store_mode, 0); static ssize_t adt7316_show_all_modes(struct device *dev, struct device_attribute *attr,@@ -364,7 +357,7 @@ static ssize_t adt7316_show_all_modes(struct device *dev,return sprintf (buf,"single_channel\nround_robin\n" ); } -static IIO_DEVICE_ATTR(all_modes, S_IRUGO, adt7316_show_all_modes, NULL, 0); +static iio_device_attr(all_modes, 0444, adt7316_show_all_modes, NULL, 0); static ssize_t adt7316_show_ad_channel(struct device *dev, struct device_attribute *attr,@@ -445,10 +438,8 @@ static ssize_t adt7316_store_ad_channel(struct device *dev,return len; } -static IIO_DEVICE_ATTR(ad_channel, S_IRUGO | S_IWUSR, - adt7316_show_ad_channel, - adt7316_store_ad_channel, - 0); +static iio_device_attr(ad_channel, 0644, adt7316_show_ad_channel, + adt7316_store_ad_channel, 0); static ssize_t adt7316_show_all_ad_channels(struct device *dev, struct device_attribute *attr,@@ -468,8 +459,8 @@ static ssize_t adt7316_show_all_ad_channels(struct device *dev, "2 - External Temperature\n"); } -static IIO_DEVICE_ATTR(all_ad_channels, S_IRUGO, - adt7316_show_all_ad_channels, NULL, 0); +static iio_device_attr(all_ad_channels, 0444, adt7316_show_all_ad_channels, + NULL, 0); static ssize_t adt7316_show_disable_averaging(struct device *dev, struct device_attribute *attr,@@ -505,10 +496,8 @@ static ssize_t adt7316_store_disable_averaging(struct device *dev,return len; } -static IIO_DEVICE_ATTR(disable_averaging, S_IRUGO | S_IWUSR, - adt7316_show_disable_averaging, - adt7316_store_disable_averaging, - 0); +static iio_device_attr(disable_averaging, 0644, adt7316_show_disable_averaging, + adt7316_store_disable_averaging, 0); static ssize_t adt7316_show_enable_smbus_timeout(struct device *dev, struct device_attribute *attr,@@ -544,10 +533,9 @@ static ssize_t adt7316_store_enable_smbus_timeout(struct device *dev,return len; } -static IIO_DEVICE_ATTR(enable_smbus_timeout, S_IRUGO | S_IWUSR, - adt7316_show_enable_smbus_timeout, - adt7316_store_enable_smbus_timeout, - 0); +static iio_device_attr(enable_smbus_timeout, 0644, + adt7316_show_enable_smbus_timeout, + adt7316_store_enable_smbus_timeout, 0); static ssize_t adt7316_show_powerdown(struct device *dev, struct device_attribute *attr,@@ -582,10 +570,8 @@ static ssize_t adt7316_store_powerdown(struct device *dev,return len; } -static IIO_DEVICE_ATTR(powerdown, S_IRUGO | S_IWUSR, - adt7316_show_powerdown, - adt7316_store_powerdown, - 0); +static iio_device_attr(powerdown, 0644, adt7316_show_powerdown, + adt7316_store_powerdown, 0); static ssize_t adt7316_show_fast_ad_clock(struct device *dev, struct device_attribute *attr,@@ -620,10 +606,8 @@ static ssize_t adt7316_store_fast_ad_clock(struct device *dev,return len; } -static IIO_DEVICE_ATTR(fast_ad_clock, S_IRUGO | S_IWUSR, - adt7316_show_fast_ad_clock, - adt7316_store_fast_ad_clock, - 0); +static iio_device_attr(fast_ad_clock, 0644, adt7316_show_fast_ad_clock, + adt7316_store_fast_ad_clock, 0); static ssize_t adt7316_show_da_high_resolution(struct device *dev, struct device_attribute *attr,@@ -673,10 +657,9 @@ static ssize_t adt7316_store_da_high_resolution(struct device *dev,return len; } -static IIO_DEVICE_ATTR(da_high_resolution, S_IRUGO | S_IWUSR, - adt7316_show_da_high_resolution, - adt7316_store_da_high_resolution, - 0); +static iio_device_attr(da_high_resolution, 0644, + adt7316_show_da_high_resolution, + adt7316_store_da_high_resolution, 0); static ssize_t adt7316_show_AIN_internal_Vref(struct device *dev, struct device_attribute *attr,@@ -719,10 +702,9 @@ static ssize_t adt7316_store_AIN_internal_Vref(struct device *dev,return len; } -static IIO_DEVICE_ATTR(AIN_internal_Vref, S_IRUGO | S_IWUSR, - adt7316_show_AIN_internal_Vref, - adt7316_store_AIN_internal_Vref, - 0); +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,@@ -759,10 +741,9 @@ static ssize_t adt7316_store_enable_prop_DACA(struct device *dev,return len; } -static IIO_DEVICE_ATTR(enable_proportion_DACA, S_IRUGO | S_IWUSR, - adt7316_show_enable_prop_DACA, - adt7316_store_enable_prop_DACA, - 0); +static iio_device_attr(enable_proportion_daca, 0644, + adt7316_show_enable_prop_daca, + adt7316_store_enable_prop_daca, 0); static ssize_t adt7316_show_enable_prop_DACB(struct device *dev, struct device_attribute *attr,@@ -798,10 +779,9 @@ static ssize_t adt7316_store_enable_prop_DACB(struct device *dev,return len; } -static IIO_DEVICE_ATTR(enable_proportion_DACB, S_IRUGO | S_IWUSR, - adt7316_show_enable_prop_DACB, - adt7316_store_enable_prop_DACB, - 0); +static iio_device_attr(enable_proportion_dacb, 0644, + adt7316_show_enable_prop_dacb, + adt7316_store_enable_prop_dacb, 0); static ssize_t adt7316_show_DAC_2Vref_ch_mask(struct device *dev, struct device_attribute *attr,@@ -841,10 +821,9 @@ static ssize_t adt7316_store_DAC_2Vref_ch_mask(struct device *dev,return len; } -static IIO_DEVICE_ATTR(DAC_2Vref_channels_mask, S_IRUGO | S_IWUSR, - adt7316_show_DAC_2Vref_ch_mask, - adt7316_store_DAC_2Vref_ch_mask, - 0); +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, struct device_attribute *attr,@@ -901,10 +880,8 @@ static ssize_t adt7316_store_DAC_update_mode(struct device *dev,return len; } -static IIO_DEVICE_ATTR(DAC_update_mode, S_IRUGO | S_IWUSR, - adt7316_show_DAC_update_mode, - adt7316_store_DAC_update_mode, - 0); +static iio_device_attr(DAC_update_mode, 0644, adt7316_show_dac_update_mode, + adt7316_store_dac_update_mode, 0); static ssize_t adt7316_show_all_DAC_update_modes(struct device *dev, struct device_attribute *attr,@@ -921,9 +898,8 @@ static ssize_t adt7316_show_all_DAC_update_modes(struct device *dev,return sprintf (buf,"manual\n" ); } -static IIO_DEVICE_ATTR(all_DAC_update_modes, S_IRUGO, - adt7316_show_all_DAC_update_modes, NULL, 0); - +static iio_device_attr(all_dac_update_modes, 0444, + adt7316_show_all_dac_update_modes, NULL, 0); static ssize_t adt7316_store_update_DAC(struct device *dev, struct device_attribute *attr,@@ -960,10 +936,7 @@ static ssize_t adt7316_store_update_DAC(struct device *dev,return len; } -static IIO_DEVICE_ATTR(update_DAC, S_IRUGO | S_IWUSR, -NULL , - adt7316_store_update_DAC, - 0); +static iio_device_attr(update_dac, 0644, NULL, adt7316_store_update_dac, 0); static ssize_t adt7316_show_DA_AB_Vref_bypass(struct device *dev, struct device_attribute *attr,@@ -1005,10 +978,8 @@ static ssize_t adt7316_store_DA_AB_Vref_bypass(struct device *dev,return len; } -static IIO_DEVICE_ATTR(DA_AB_Vref_bypass, S_IRUGO | S_IWUSR, - adt7316_show_DA_AB_Vref_bypass, - adt7316_store_DA_AB_Vref_bypass, - 0); +static iio_device_attr(da_ab_vref_bypass, 0644, adt7316_show_da_ab_vref_bypass, + adt7316_store_da_ab_vref_bypass, 0); static ssize_t adt7316_show_DA_CD_Vref_bypass(struct device *dev, struct device_attribute *attr,@@ -1050,10 +1021,8 @@ static ssize_t adt7316_store_DA_CD_Vref_bypass(struct device *dev,return len; } -static IIO_DEVICE_ATTR(DA_CD_Vref_bypass, S_IRUGO | S_IWUSR, - adt7316_show_DA_CD_Vref_bypass, - adt7316_store_DA_CD_Vref_bypass, - 0); +static iio_device_attr(da_cd_vref_bypass, 0644, adt7316_show_da_cd_vref_bypass, + adt7316_store_da_cd_vref_bypass, 0); static ssize_t adt7316_show_DAC_internal_Vref(struct device *dev, struct device_attribute *attr,@@ -1111,10 +1080,8 @@ static ssize_t adt7316_store_DAC_internal_Vref(struct device *dev,return len; } -static IIO_DEVICE_ATTR(DAC_internal_Vref, S_IRUGO | S_IWUSR, - adt7316_show_DAC_internal_Vref, - adt7316_store_DAC_internal_Vref, - 0); +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,int channel,char *buf)@@ -1200,7 +1167,8 @@ static ssize_t adt7316_show_VDD(struct device *dev,return adt7316_show_ad (chip,ADT7316_AD_SINGLE_CH_VDD , buf); } -static IIO_DEVICE_ATTR(VDD, S_IRUGO, adt7316_show_VDD, NULL, 0); + +static iio_device_attr(VDD, 0444, adt7316_show_VDD, NULL, 0); static ssize_t adt7316_show_in_temp(struct device *dev, struct device_attribute *attr,@@ -1212,7 +1180,7 @@ static ssize_t adt7316_show_in_temp(struct device *dev,return adt7316_show_ad (chip,ADT7316_AD_SINGLE_CH_IN , buf); } -static IIO_DEVICE_ATTR(in_temp, S_IRUGO, adt7316_show_in_temp, NULL, 0); +static iio_device_attr(in_temp, 0444, adt7316_show_in_temp, NULL, 0); static ssize_t adt7316_show_ex_temp_AIN1(struct device *dev, struct device_attribute *attr,@@ -1224,9 +1192,9 @@ static ssize_t adt7316_show_ex_temp_AIN1(struct device *dev,return adt7316_show_ad (chip,ADT7316_AD_SINGLE_CH_EX , buf); } -static IIO_DEVICE_ATTR(ex_temp_AIN1, S_IRUGO, adt7316_show_ex_temp_AIN1, - NULL, 0); -static IIO_DEVICE_ATTR(ex_temp, S_IRUGO, adt7316_show_ex_temp_AIN1, NULL, 0); +static iio_device_attr(ex_temp_ain1, 0444, adt7316_show_ex_temp_ain1, NULL, 0); + +static iio_device_attr(ex_temp, 0444, adt7316_show_ex_temp_ain1, NULL, 0); static ssize_t adt7316_show_AIN2(struct device *dev, struct device_attribute *attr,@@ -1237,29 +1205,32 @@ static ssize_t adt7316_show_AIN2(struct device *dev,return adt7316_show_ad (chip,ADT7516_AD_SINGLE_CH_AIN2 , buf); } -static IIO_DEVICE_ATTR(AIN2, S_IRUGO, adt7316_show_AIN2, NULL, 0); -static ssize_t adt7316_show_AIN3 (struct device *dev, -struct device_attribute *attr, -char *buf) +static iio_device_attr(ain2, 0444, adt7316_show_AIN2, NULL, 0); + +static ssize_t adt7316_show_ain3 (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_show_ad (chip,ADT7516_AD_SINGLE_CH_AIN3 , buf); } -static IIO_DEVICE_ATTR(AIN3, S_IRUGO, adt7316_show_AIN3, NULL, 0); -static ssize_t adt7316_show_AIN4 (struct device *dev, -struct device_attribute *attr, -char *buf) +static iio_device_attr(ain3, 0444, adt7316_show_ain3, NULL, 0); + +static ssize_t adt7316_show_ain4 (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_show_ad (chip,ADT7516_AD_SINGLE_CH_AIN4 , buf); } -static IIO_DEVICE_ATTR(AIN4, S_IRUGO, adt7316_show_AIN4, NULL, 0); + +static iio_device_attr(ain4, 0444, adt7316_show_ain4, NULL, 0);static ssize_t adt7316_show_temp_offset (struct adt7316_chip_info *chip,int offset_addr,char *buf)@@ -1324,9 +1295,8 @@ static ssize_t adt7316_store_in_temp_offset(struct device *dev, len); } -static IIO_DEVICE_ATTR(in_temp_offset, S_IRUGO | S_IWUSR, - adt7316_show_in_temp_offset, - adt7316_store_in_temp_offset, 0); +static iio_device_attr(in_temp_offset, 0644, adt7316_show_in_temp_offset, + adt7316_store_in_temp_offset, 0); static ssize_t adt7316_show_ex_temp_offset(struct device *dev, struct device_attribute *attr,@@ -1404,7 +1374,7 @@ static ssize_t adt7316_store_ex_analog_temp_offset(struct device *dev, ADT7316_EX_ANALOG_TEMP_OFFSET, buf, len); } -static IIO_DEVICE_ATTR(ex_analog_temp_offset, S_IRUGO | S_IWUSR, +static iio_device_attr(ex_analog_temp_offset, 0644, adt7316_show_ex_analog_temp_offset, adt7316_store_ex_analog_temp_offset, 0);@@ -1499,8 +1469,7 @@ static ssize_t adt7316_store_DAC_A(struct device *dev,return adt7316_store_dac (chip,0 , buf, len); } -static IIO_DEVICE_ATTR(DAC_A, S_IRUGO | S_IWUSR, adt7316_show_DAC_A, - adt7316_store_DAC_A, 0); +static iio_device_attr(dac_a, 0644, adt7316_show_dac_a, adt7316_store_dac_a, 0); static ssize_t adt7316_show_DAC_B(struct device *dev, struct device_attribute *attr,@@ -1523,8 +1492,7 @@ static ssize_t adt7316_store_DAC_B(struct device *dev,return adt7316_store_dac (chip,1 , buf, len); } -static IIO_DEVICE_ATTR(DAC_B, S_IRUGO | S_IWUSR, adt7316_show_DAC_B, - adt7316_store_DAC_B, 0); +static iio_device_attr(dac_b, 0644, adt7316_show_dac_b, adt7316_store_dac_b, 0); static ssize_t adt7316_show_DAC_C(struct device *dev, struct device_attribute *attr,@@ -1547,8 +1515,7 @@ static ssize_t adt7316_store_DAC_C(struct device *dev,return adt7316_store_dac (chip,2 , buf, len); } -static IIO_DEVICE_ATTR(DAC_C, S_IRUGO | S_IWUSR, adt7316_show_DAC_C, - adt7316_store_DAC_C, 0); +static iio_device_attr(DAC_C, 0644, adt7316_show_dac_c, adt7316_store_dac_c, 0); static ssize_t adt7316_show_DAC_D(struct device *dev, struct device_attribute *attr,@@ -1571,8 +1538,7 @@ static ssize_t adt7316_store_DAC_D(struct device *dev,return adt7316_store_dac (chip,3 , buf, len); } -static IIO_DEVICE_ATTR(DAC_D, S_IRUGO | S_IWUSR, adt7316_show_DAC_D, - adt7316_store_DAC_D, 0); +static iio_device_attr(DAC_D, 0644, adt7316_show_dac_d, adt7316_store_dac_d, 0); static ssize_t adt7316_show_device_id(struct device *dev, struct device_attribute *attr,@@ -1608,8 +1574,8 @@ static ssize_t adt7316_show_manufactorer_id(struct device *dev,return sprintf (buf,"%d\n" , id); } -static IIO_DEVICE_ATTR(manufactorer_id, S_IRUGO, - adt7316_show_manufactorer_id, NULL, 0); +static iio_device_attr(manufactorer_id, 0444, adt7316_show_manufactorer_id, + NULL, 0); static ssize_t adt7316_show_device_rev(struct device *dev, struct device_attribute *attr,@@ -1627,7 +1593,7 @@ static ssize_t adt7316_show_device_rev(struct device *dev,return sprintf (buf,"%d\n" , rev); } -static IIO_DEVICE_ATTR(device_rev, S_IRUGO, adt7316_show_device_rev, NULL, 0); +static iio_device_attr(device_rev, 0444, adt7316_show_device_rev, NULL, 0); static ssize_t adt7316_show_bus_type(struct device *dev, struct device_attribute *attr,@@ -1648,7 +1614,7 @@ static ssize_t adt7316_show_bus_type(struct device *dev,return sprintf (buf,"i2c\n" ); } -static IIO_DEVICE_ATTR(bus_type, S_IRUGO, adt7316_show_bus_type, NULL, 0); +static iio_device_attr(bus_type, 0444, adt7316_show_bus_type, NULL, 0);static struct attribute *adt7316_attributes[] = { &iio_dev_attr_all_modes.dev_attr.attr,@@ -1970,63 +1936,35 @@ static ssize_t adt7316_set_int_enabled(struct device *dev,return len; } -static IIO_DEVICE_ATTR(int_mask, - S_IRUGO | S_IWUSR, - adt7316_show_int_mask, adt7316_set_int_mask, - 0); -static IIO_DEVICE_ATTR(in_temp_high_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7316_IN_TEMP_HIGH); -static IIO_DEVICE_ATTR(in_temp_low_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7316_IN_TEMP_LOW); -static IIO_DEVICE_ATTR(ex_temp_high_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7316_EX_TEMP_HIGH); -static IIO_DEVICE_ATTR(ex_temp_low_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7316_EX_TEMP_LOW); +static iio_device_attr(int_mask, 0644, adt7316_show_int_mask, + adt7316_set_int_mask, 0); +static iio_device_attr(in_temp_high_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7316_IN_TEMP_HIGH); +static iio_device_attr(in_temp_low_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7316_IN_TEMP_LOW); +static iio_device_attr(ex_temp_high_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7316_EX_TEMP_HIGH); +static iio_device_attr(ex_temp_low_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7316_EX_TEMP_LOW);/* NASTY duplication to be fixed */ -static IIO_DEVICE_ATTR(ex_temp_ain1_high_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7316_EX_TEMP_HIGH); -static IIO_DEVICE_ATTR(ex_temp_ain1_low_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7316_EX_TEMP_LOW); -static IIO_DEVICE_ATTR(ain2_high_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7516_AIN2_HIGH); -static IIO_DEVICE_ATTR(ain2_low_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7516_AIN2_LOW); -static IIO_DEVICE_ATTR(ain3_high_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7516_AIN3_HIGH); -static IIO_DEVICE_ATTR(ain3_low_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7516_AIN3_LOW); -static IIO_DEVICE_ATTR(ain4_high_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7516_AIN4_HIGH); -static IIO_DEVICE_ATTR(ain4_low_value, - S_IRUGO | S_IWUSR, - adt7316_show_ad_bound, adt7316_set_ad_bound, - ADT7516_AIN4_LOW); -static IIO_DEVICE_ATTR(int_enabled, - S_IRUGO | S_IWUSR, - adt7316_show_int_enabled, +static iio_device_attr(ex_temp_ain1_high_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7316_EX_TEMP_HIGH); +static iio_device_attr(ex_temp_ain1_low_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7316_EX_TEMP_LOW); +static iio_device_attr(ain2_high_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7516_AIN2_HIGH); +static iio_device_attr(ain2_low_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7516_AIN2_LOW); +static iio_device_attr(ain3_high_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7516_AIN3_HIGH); +static iio_device_attr(ain3_low_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7516_AIN3_LOW); +static iio_device_attr(ain4_high_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7516_AIN4_HIGH); +static iio_device_attr(ain4_low_value, 0644, adt7316_show_ad_bound, + adt7316_set_ad_bound, ADT7516_AIN4_LOW); +static iio_device_attr(int_enabled, 0644, adt7316_show_int_enabled, adt7316_set_int_enabled, 0);static struct attribute *adt7316_event_attributes[] = {
PATCH v4 8/8 Fixes style issues due to mis-aligned carry over lines
In reply to Scott MatheinaLines were not aligned with (, this patch simply changes the indention, no substantive changes function of driver.
--- drivers/staging/iio/addac/adt7316.c | 415 ++++++++++++++++++------------------ 1 file changed, 210 insertions(+), 205 deletions(-)
drivers/staging/iio/addac/adt7316.c +210 -205
@@ -217,8 +217,8 @@ struct adt7316_limit_regs { };static ssize_t adt7316_show_enabled (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -227,7 +227,7 @@ static ssize_t adt7316_show_enabled(struct device *dev, }static ssize_t _adt7316_store_enabled (struct adt7316_chip_info *chip, -int enable) +int enable) {u8 config1;int ret;
@@ -244,13 +244,12 @@ static ssize_t _adt7316_store_enabled(struct adt7316_chip_info *chip, chip->config1 = config1;return ret; - }static ssize_t adt7316_store_enabled (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -271,8 +270,8 @@ static iio_device_attr(enabled, 0644, adt7316_show_enabled, adt7316_store_enabled, 0);static ssize_t adt7316_show_select_ex_temp (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -284,9 +283,9 @@ static ssize_t adt7316_show_select_ex_temp(struct device *dev, }static ssize_t adt7316_store_select_ex_temp (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -326,9 +325,9 @@ static ssize_t adt7316_show_mode(struct device *dev, }static ssize_t adt7316_store_mode (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -398,9 +397,9 @@ static ssize_t adt7316_show_ad_channel(struct device *dev, }static ssize_t adt7316_store_ad_channel (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -474,9 +473,9 @@ static ssize_t adt7316_show_disable_averaging(struct device *dev, }static ssize_t adt7316_store_disable_averaging (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -511,9 +510,9 @@ static ssize_t adt7316_show_enable_smbus_timeout(struct device *dev, }static ssize_t adt7316_store_enable_smbus_timeout (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -548,9 +547,9 @@ static ssize_t adt7316_show_powerdown(struct device *dev, }static ssize_t adt7316_store_powerdown (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -584,9 +583,9 @@ static ssize_t adt7316_show_fast_ad_clock(struct device *dev, }static ssize_t adt7316_store_fast_ad_clock (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -610,8 +609,8 @@ static iio_device_attr(fast_ad_clock, 0644, adt7316_show_fast_ad_clock, adt7316_store_fast_ad_clock, 0);static ssize_t adt7316_show_da_high_resolution (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -627,9 +626,9 @@ static ssize_t adt7316_show_da_high_resolution(struct device *dev, }static ssize_t adt7316_store_da_high_resolution (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -661,9 +660,9 @@ static iio_device_attr(da_high_resolution, 0644, adt7316_show_da_high_resolution, adt7316_store_da_high_resolution, 0); -static ssize_t adt7316_show_AIN_internal_Vref (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_ain_internal_vref (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -675,10 +674,10 @@ 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, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_ain_internal_vref (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -706,10 +705,9 @@ 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, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_enable_prop_daca (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -718,10 +716,10 @@ static ssize_t adt7316_show_enable_prop_DACA(struct device *dev, !!(chip->config3 & ADT7316_EN_IN_TEMP_PROP_DACA)); } -static ssize_t adt7316_store_enable_prop_DACA (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_enable_prop_daca (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -745,9 +743,9 @@ static iio_device_attr(enable_proportion_daca, 0644, adt7316_show_enable_prop_daca, adt7316_store_enable_prop_daca, 0); -static ssize_t adt7316_show_enable_prop_DACB (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_enable_prop_dacb (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -756,10 +754,10 @@ static ssize_t adt7316_show_enable_prop_DACB(struct device *dev, !!(chip->config3 & ADT7316_EN_EX_TEMP_PROP_DACB)); } -static ssize_t adt7316_store_enable_prop_DACB (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_enable_prop_dacb (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -783,9 +781,9 @@ static iio_device_attr(enable_proportion_dacb, 0644, adt7316_show_enable_prop_dacb, adt7316_store_enable_prop_dacb, 0); -static ssize_t adt7316_show_DAC_2Vref_ch_mask (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_2vref_ch_mask (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -794,10 +792,10 @@ 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, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_2vref_ch_mask (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -825,9 +823,9 @@ 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, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_update_mode (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -850,10 +848,10 @@ static ssize_t adt7316_show_DAC_update_mode(struct device *dev, } } -static ssize_t adt7316_store_DAC_update_mode (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_update_mode (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -883,9 +881,9 @@ static ssize_t adt7316_store_DAC_update_mode(struct device *dev, static iio_device_attr(DAC_update_mode, 0644, adt7316_show_dac_update_mode, adt7316_store_dac_update_mode, 0); -static ssize_t adt7316_show_all_DAC_update_modes (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_all_dac_update_modes (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -901,8 +899,8 @@ static ssize_t adt7316_show_all_DAC_update_modes(struct device *dev, static iio_device_attr(all_dac_update_modes, 0444, adt7316_show_all_dac_update_modes, NULL, 0); -static ssize_t adt7316_store_update_DAC (struct device *dev, -struct device_attribute *attr, +static ssize_t adt7316_store_update_dac (struct device *dev, +struct device_attribute *attr,const char *buf,size_t len) {
@@ -938,9 +936,9 @@ static ssize_t adt7316_store_update_DAC(struct device *dev, static iio_device_attr(update_dac, 0644, NULL, adt7316_store_update_dac, 0); -static ssize_t adt7316_show_DA_AB_Vref_bypass (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_da_ab_vref_bypass (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -952,10 +950,10 @@ 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, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_da_ab_vref_bypass (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -981,9 +979,9 @@ static ssize_t adt7316_store_DA_AB_Vref_bypass(struct device *dev, static iio_device_attr(da_ab_vref_bypass, 0644, adt7316_show_da_ab_vref_bypass, adt7316_store_da_ab_vref_bypass, 0); -static ssize_t adt7316_show_DA_CD_Vref_bypass (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_da_cd_vref_bypass (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -995,10 +993,10 @@ 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, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_da_cd_vref_bypass (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1024,9 +1022,9 @@ static ssize_t adt7316_store_DA_CD_Vref_bypass(struct device *dev, static iio_device_attr(da_cd_vref_bypass, 0644, adt7316_show_da_cd_vref_bypass, adt7316_store_da_cd_vref_bypass, 0); -static ssize_t adt7316_show_DAC_internal_Vref (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_internal_vref (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1039,10 +1037,10 @@ static ssize_t adt7316_show_DAC_internal_Vref(struct device *dev, !!(chip->dac_config & ADT7316_DAC_IN_VREF)); } -static ssize_t adt7316_store_DAC_internal_Vref (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_internal_vref (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1084,7 +1082,8 @@ 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, -int channel,char *buf) +int channel, +char *buf) {u16 data;u8 msb, lsb;
@@ -1092,7 +1091,7 @@ static ssize_t adt7316_show_ad(struct adt7316_chip_info *chip,int ret;if ((chip->config2 &ADT7316_AD_SINGLE_CH_MODE ) && - channel != (chip->config2 &ADT7516_AD_SINGLE_CH_MASK )) + channel != (chip->config2 &ADT7516_AD_SINGLE_CH_MASK ))return -EPERM ;switch (channel) {
@@ -1159,8 +1158,8 @@ static ssize_t adt7316_show_ad(struct adt7316_chip_info *chip, }static ssize_t adt7316_show_VDD (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1171,8 +1170,8 @@ static ssize_t adt7316_show_VDD(struct device *dev, static iio_device_attr(VDD, 0444, adt7316_show_VDD, NULL, 0);static ssize_t adt7316_show_in_temp (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1182,9 +1181,9 @@ static ssize_t adt7316_show_in_temp(struct device *dev, static iio_device_attr(in_temp, 0444, adt7316_show_in_temp, NULL, 0); -static ssize_t adt7316_show_ex_temp_AIN1 (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_ex_temp_ain1 (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1197,8 +1196,8 @@ static iio_device_attr(ex_temp_ain1, 0444, adt7316_show_ex_temp_ain1, NULL, 0); static iio_device_attr(ex_temp, 0444, adt7316_show_ex_temp_ain1, NULL, 0);static ssize_t adt7316_show_AIN2 (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1233,7 +1232,8 @@ static ssize_t adt7316_show_ain4(struct device *dev, static iio_device_attr(ain4, 0444, adt7316_show_ain4, NULL, 0);static ssize_t adt7316_show_temp_offset (struct adt7316_chip_info *chip, -int offset_addr,char *buf) +int offset_addr, +char *buf) {int data;u8 val;
@@ -1251,7 +1251,9 @@ static ssize_t adt7316_show_temp_offset(struct adt7316_chip_info *chip, }static ssize_t adt7316_store_temp_offset (struct adt7316_chip_info *chip, -int offset_addr,const char *buf,size_t len) +int offset_addr, +const char *buf, +size_t len) {int data;u8 val;
@@ -1274,8 +1276,8 @@ static ssize_t adt7316_store_temp_offset(struct adt7316_chip_info *chip, }static ssize_t adt7316_show_in_temp_offset (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1284,23 +1286,23 @@ static ssize_t adt7316_show_in_temp_offset(struct device *dev, }static ssize_t adt7316_store_in_temp_offset (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_store_temp_offset (chip,ADT7316_IN_TEMP_OFFSET , buf, - len); + len); } static iio_device_attr(in_temp_offset, 0644, adt7316_show_in_temp_offset, adt7316_store_in_temp_offset, 0);static ssize_t adt7316_show_ex_temp_offset (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1309,63 +1311,62 @@ static ssize_t adt7316_show_ex_temp_offset(struct device *dev, }static ssize_t adt7316_store_ex_temp_offset (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_store_temp_offset (chip,ADT7316_EX_TEMP_OFFSET , buf, - len); + len); } -static IIO_DEVICE_ATTR(ex_temp_offset, S_IRUGO | S_IWUSR, - adt7316_show_ex_temp_offset, - adt7316_store_ex_temp_offset, 0); +static iio_device_attr(ex_temp_offset, 0644, adt7316_show_ex_temp_offset, + adt7316_store_ex_temp_offset, 0);static ssize_t adt7316_show_in_analog_temp_offset (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_show_temp_offset (chip, -ADT7316_IN_ANALOG_TEMP_OFFSET , buf); +ADT7316_IN_ANALOG_TEMP_OFFSET , buf); }static ssize_t adt7316_store_in_analog_temp_offset (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf,size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_store_temp_offset (chip, -ADT7316_IN_ANALOG_TEMP_OFFSET , buf, len); +ADT7316_IN_ANALOG_TEMP_OFFSET , + buf, len); } -static IIO_DEVICE_ATTR(in_analog_temp_offset, S_IRUGO | S_IWUSR, - adt7316_show_in_analog_temp_offset, - adt7316_store_in_analog_temp_offset, 0); +static iio_device_attr(in_analog_temp_offset, 0644, + adt7316_show_in_analog_temp_offset, + adt7316_store_in_analog_temp_offset, 0);static ssize_t adt7316_show_ex_analog_temp_offset (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_show_temp_offset (chip, -ADT7316_EX_ANALOG_TEMP_OFFSET , buf); +ADT7316_EX_ANALOG_TEMP_OFFSET , buf); }static ssize_t adt7316_store_ex_analog_temp_offset (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1378,15 +1379,16 @@ static iio_device_attr(ex_analog_temp_offset, 0644, adt7316_show_ex_analog_temp_offset, adt7316_store_ex_analog_temp_offset, 0); -static ssize_t adt7316_show_DAC (struct adt7316_chip_info *chip, -int channel,char *buf) +static ssize_t adt7316_show_dac (struct adt7316_chip_info *chip, +int channel, +char *buf) {u16 data;u8 msb, lsb, offset;int ret;if (channel >=ADT7316_DA_MSB_DATA_REGS || - (channel ==0 && + (channel ==0 && (chip->config3 &ADT7316_EN_IN_TEMP_PROP_DACA )) || (channel ==1 && (chip->config3 &ADT7316_EN_EX_TEMP_PROP_DACB )))
@@ -1411,15 +1413,17 @@ static ssize_t adt7316_show_DAC(struct adt7316_chip_info *chip,return sprintf (buf,"%d\n" , data); } -static ssize_t adt7316_store_DAC (struct adt7316_chip_info *chip, -int channel,const char *buf,size_t len) +static ssize_t adt7316_store_dac (struct adt7316_chip_info *chip, +int channel, +const char *buf, +size_t len) {u8 msb, lsb, offset;u16 data;int ret;if (channel >=ADT7316_DA_MSB_DATA_REGS || - (channel ==0 && + (channel ==0 && (chip->config3 &ADT7316_EN_IN_TEMP_PROP_DACA )) || (channel ==1 && (chip->config3 &ADT7316_EN_EX_TEMP_PROP_DACB )))
@@ -1448,9 +1452,9 @@ static ssize_t adt7316_store_DAC(struct adt7316_chip_info *chip,return len; } -static ssize_t adt7316_show_DAC_A (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_a (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1458,10 +1462,10 @@ static ssize_t adt7316_show_DAC_A(struct device *dev,return adt7316_show_dac (chip,0 , buf); } -static ssize_t adt7316_store_DAC_A (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_a (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1471,9 +1475,9 @@ static ssize_t adt7316_store_DAC_A(struct device *dev, static iio_device_attr(dac_a, 0644, adt7316_show_dac_a, adt7316_store_dac_a, 0); -static ssize_t adt7316_show_DAC_B (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_b (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1481,10 +1485,10 @@ static ssize_t adt7316_show_DAC_B(struct device *dev,return adt7316_show_dac (chip,1 , buf); } -static ssize_t adt7316_store_DAC_B (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_b (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1494,9 +1498,9 @@ static ssize_t adt7316_store_DAC_B(struct device *dev, static iio_device_attr(dac_b, 0644, adt7316_show_dac_b, adt7316_store_dac_b, 0); -static ssize_t adt7316_show_DAC_C (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_c (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1504,10 +1508,10 @@ static ssize_t adt7316_show_DAC_C(struct device *dev,return adt7316_show_dac (chip,2 , buf); } -static ssize_t adt7316_store_DAC_C (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_c (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1517,9 +1521,9 @@ static ssize_t adt7316_store_DAC_C(struct device *dev, static iio_device_attr(DAC_C, 0644, adt7316_show_dac_c, adt7316_store_dac_c, 0); -static ssize_t adt7316_show_DAC_D (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_d (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1527,10 +1531,10 @@ static ssize_t adt7316_show_DAC_D(struct device *dev,return adt7316_show_dac (chip,3 , buf); } -static ssize_t adt7316_store_DAC_D (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_d (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1541,8 +1545,8 @@ static ssize_t adt7316_store_DAC_D(struct device *dev, static iio_device_attr(DAC_D, 0644, adt7316_show_dac_d, adt7316_store_dac_d, 0);static ssize_t adt7316_show_device_id (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1556,11 +1560,11 @@ static ssize_t adt7316_show_device_id(struct device *dev,return sprintf (buf,"%d\n" , id); } -static IIO_DEVICE_ATTR(device_id, S_IRUGO, adt7316_show_device_id, NULL, 0); +static iio_device_attr(device_id, 0444, adt7316_show_device_id, NULL, 0);static ssize_t adt7316_show_manufactorer_id (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1578,8 +1582,8 @@ static iio_device_attr(manufactorer_id, 0444, adt7316_show_manufactorer_id, NULL, 0);static ssize_t adt7316_show_device_rev (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1596,8 +1600,8 @@ static ssize_t adt7316_show_device_rev(struct device *dev, static iio_device_attr(device_rev, 0444, adt7316_show_device_rev, NULL, 0);static ssize_t adt7316_show_bus_type (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1780,8 +1784,8 @@ static irqreturn_t adt7316_event_handler(int irq, void *private)* Show mask of enabled interrupts in Hex. */ static ssize_t adt7316_show_int_mask (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1793,9 +1797,9 @@ static ssize_t adt7316_show_int_mask(struct device *dev,* Set 1 to the mask in Hex to enabled interrupts. */ static ssize_t adt7316_set_int_mask (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1832,9 +1836,10 @@ static ssize_t adt7316_set_int_mask(struct device *dev,return len; } +static inline ssize_t adt7316_show_ad_bound (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev_attr *this_attr =to_iio_dev_attr (attr);struct iio_dev *dev_info =dev_to_iio_dev (dev);
@@ -1844,7 +1849,7 @@ static inline ssize_t adt7316_show_ad_bound(struct device *dev,int ret;if ((chip->id &ID_FAMILY_MASK ) ==ID_ADT73XX && - this_attr->address >ADT7316_EX_TEMP_LOW ) + this_attr->address >ADT7316_EX_TEMP_LOW )return -EPERM ; ret = chip->bus.read (chip->bus.client, this_attr->address, &val);
@@ -1854,7 +1859,7 @@ static inline ssize_t adt7316_show_ad_bound(struct device *dev, data = (int )val;if (!((chip->id &ID_FAMILY_MASK ) ==ID_ADT75XX && - (chip->config1 &ADT7516_SEL_AIN1_2_EX_TEMP_MASK ) ==0 )) { + (chip->config1 &ADT7516_SEL_AIN1_2_EX_TEMP_MASK ) ==0 )) {if (data &0x80 ) data -=256 ; }
@@ -1863,9 +1868,9 @@ static inline ssize_t adt7316_show_ad_bound(struct device *dev, }static inline ssize_t adt7316_set_ad_bound (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev_attr *this_attr =to_iio_dev_attr (attr);struct iio_dev *dev_info =dev_to_iio_dev (dev);
@@ -1875,7 +1880,7 @@ static inline ssize_t adt7316_set_ad_bound(struct device *dev,int ret;if ((chip->id &ID_FAMILY_MASK ) ==ID_ADT73XX && - this_attr->address >ADT7316_EX_TEMP_LOW ) + this_attr->address >ADT7316_EX_TEMP_LOW )return -EPERM ; ret =kstrtoint (buf,10 , &data);
@@ -1883,7 +1888,7 @@ static inline ssize_t adt7316_set_ad_bound(struct device *dev,return -EINVAL ;if ((chip->id &ID_FAMILY_MASK ) ==ID_ADT75XX && - (chip->config1 &ADT7516_SEL_AIN1_2_EX_TEMP_MASK ) ==0 ) { + (chip->config1 &ADT7516_SEL_AIN1_2_EX_TEMP_MASK ) ==0 ) {if (data >255 || data <0 )return -EINVAL ; }else {
@@ -1904,8 +1909,8 @@ static inline ssize_t adt7316_set_ad_bound(struct device *dev, }static ssize_t adt7316_show_int_enabled (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -1914,9 +1919,9 @@ static ssize_t adt7316_show_int_enabled(struct device *dev, }static ssize_t adt7316_set_int_enabled (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);
@@ -2040,7 +2045,7 @@ static const struct iio_info adt7516_info = {* device probe and remove */ int adt7316_probe (struct device *dev,struct adt7316_bus *bus, -const char *name) +const char *name) {struct adt7316_chip_info *chip;struct iio_dev *indio_dev;
@@ -2112,7 +2117,7 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus,return ret;dev_info (dev,"%s temperature sensor, ADC and DAC registered.\n" , - indio_dev->name); + indio_dev->name);return 0 ; }
Signature · 1 line
2.7.4
kbuild test robot
build botRe: [PATCHv4 8/8] Fixes style issues due to mis-aligned carry over lines
reproduce:
Hi Scott,
[auto build test ERROR on iio/togreg]
[also build test ERROR on v4.9 next-20161224]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Scott-Matheina/Checkpatch-fixes-to-driver-staging-iio-addac/20161226-041021 base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg config: i386-randconfig-x001-201652 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: # save the attached .config to linux build tree make ARCH=i386
All errors (new ones prefixed by >>):
^~~~
drivers/staging/iio/addac/adt7316.c:1325:40: error: expected ')' before numeric constant
static iio_device_attr(ex_temp_offset, 0644, adt7316_show_ex_temp_offset,
^~~~
drivers/staging/iio/addac/adt7316.c:1351:47: error: expected ')' before numeric constant
static iio_device_attr(in_analog_temp_offset, 0644,
^~~~
drivers/staging/iio/addac/adt7316.c:1378:47: error: expected ')' before numeric constant
static iio_device_attr(ex_analog_temp_offset, 0644,
^~~~
drivers/staging/iio/addac/adt7316.c:1476:31: error: expected ')' before numeric constant
static iio_device_attr(dac_a, 0644, adt7316_show_dac_a, adt7316_store_dac_a, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1499:31: error: expected ')' before numeric constant
static iio_device_attr(dac_b, 0644, adt7316_show_dac_b, adt7316_store_dac_b, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1522:31: error: expected ')' before numeric constant
static iio_device_attr(DAC_C, 0644, adt7316_show_dac_c, adt7316_store_dac_c, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1545:31: error: expected ')' before numeric constant
static iio_device_attr(DAC_D, 0644, adt7316_show_dac_d, adt7316_store_dac_d, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1563:35: error: expected ')' before numeric constant
static iio_device_attr(device_id, 0444, adt7316_show_device_id, NULL, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1581:41: error: expected ')' before numeric constant
static iio_device_attr(manufactorer_id, 0444, adt7316_show_manufactorer_id,
^~~~
drivers/staging/iio/addac/adt7316.c:1600:36: error: expected ')' before numeric constant
static iio_device_attr(device_rev, 0444, adt7316_show_device_rev, NULL, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1621:34: error: expected ')' before numeric constant
static iio_device_attr(bus_type, 0444, adt7316_show_bus_type, NULL, 0);
^~~~
drivers/staging/iio/addac/adt7316.c:1624:3: error: 'iio_dev_attr_all_modes' undeclared here (not in a function)
&iio_dev_attr_all_modes.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1625:3: error: 'iio_dev_attr_mode' undeclared here (not in a function)
&iio_dev_attr_mode.dev_attr.attr,
^~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1626:3: error: 'iio_dev_attr_enabled' undeclared here (not in a function)
&iio_dev_attr_enabled.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1627:3: error: 'iio_dev_attr_ad_channel' undeclared here (not in a function)
&iio_dev_attr_ad_channel.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1628:3: error: 'iio_dev_attr_all_ad_channels' undeclared here (not in a function)
&iio_dev_attr_all_ad_channels.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1629:3: error: 'iio_dev_attr_disable_averaging' undeclared here (not in a function)
&iio_dev_attr_disable_averaging.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1630:3: error: 'iio_dev_attr_enable_smbus_timeout' undeclared here (not in a function)
&iio_dev_attr_enable_smbus_timeout.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1631:3: error: 'iio_dev_attr_powerdown' undeclared here (not in a function)
&iio_dev_attr_powerdown.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1632:3: error: 'iio_dev_attr_fast_ad_clock' undeclared here (not in a function)
&iio_dev_attr_fast_ad_clock.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1633:3: error: 'iio_dev_attr_da_high_resolution' undeclared here (not in a function)
&iio_dev_attr_da_high_resolution.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1634:3: error: 'iio_dev_attr_enable_proportion_daca' undeclared here (not in a function)
&iio_dev_attr_enable_proportion_daca.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1635:3: error: 'iio_dev_attr_enable_proportion_dacb' undeclared here (not in a function)
&iio_dev_attr_enable_proportion_dacb.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1636:3: error: 'iio_dev_attr_dac_2vref_channels_mask' undeclared here (not in a function)
&iio_dev_attr_dac_2vref_channels_mask.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1637:3: error: 'iio_dev_attr_dac_internal_vref' undeclared here (not in a function)
&iio_dev_attr_dac_internal_vref.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1638:3: error: 'iio_dev_attr_all_dac_update_modes' undeclared here (not in a function)
&iio_dev_attr_all_dac_update_modes.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1639:3: error: 'iio_dev_attr_update_dac' undeclared here (not in a function)
&iio_dev_attr_update_dac.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1640:3: error: 'iio_dev_attr_da_ab_vref_bypass' undeclared here (not in a function)
&iio_dev_attr_da_ab_vref_bypass.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1641:3: error: 'iio_dev_attr_da_cd_vref_bypass' undeclared here (not in a function)
&iio_dev_attr_da_cd_vref_bypass.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1643:3: error: 'iio_dev_attr_vdd' undeclared here (not in a function)
&iio_dev_attr_vdd.dev_attr.attr,
^~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1644:3: error: 'iio_dev_attr_in_temp' undeclared here (not in a function)
&iio_dev_attr_in_temp.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1645:3: error: 'iio_dev_attr_ex_temp' undeclared here (not in a function)
&iio_dev_attr_ex_temp.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1646:3: error: 'iio_dev_attr_in_temp_offset' undeclared here (not in a function)
&iio_dev_attr_in_temp_offset.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1647:3: error: 'iio_dev_attr_ex_temp_offset' undeclared here (not in a function)
&iio_dev_attr_ex_temp_offset.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1648:3: error: 'iio_dev_attr_in_analog_temp_offset' undeclared here (not in a function)
&iio_dev_attr_in_analog_temp_offset.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1649:3: error: 'iio_dev_attr_ex_analog_temp_offset' undeclared here (not in a function)
&iio_dev_attr_ex_analog_temp_offset.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1650:3: error: 'iio_dev_attr_dac_a' undeclared here (not in a function)
&iio_dev_attr_dac_a.dev_attr.attr,
^~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1651:3: error: 'iio_dev_attr_dac_b' undeclared here (not in a function)
&iio_dev_attr_dac_b.dev_attr.attr,
^~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1652:3: error: 'iio_dev_attr_dac_c' undeclared here (not in a function)
&iio_dev_attr_dac_c.dev_attr.attr,
^~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1653:3: error: 'iio_dev_attr_dac_d' undeclared here (not in a function)
&iio_dev_attr_dac_d.dev_attr.attr,
^~~~~~~~~~~~~~~~~~
>> drivers/staging/iio/addac/adt7316.c:1654:3: error: 'iio_dev_attr_device_id' undeclared here (not in a function)
&iio_dev_attr_device_id.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1655:3: error: 'iio_dev_attr_manufactorer_id' undeclared here (not in a function)
&iio_dev_attr_manufactorer_id.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1656:3: error: 'iio_dev_attr_device_rev' undeclared here (not in a function)
&iio_dev_attr_device_rev.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1657:3: error: 'iio_dev_attr_bus_type' undeclared here (not in a function)
&iio_dev_attr_bus_type.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1666:25: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_all_modes.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1666:34: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_all_modes.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1666:2: error: initializer element is not constant
&iio_dev_attr_all_modes.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1666:2: note: (near initialization for 'adt7516_attributes[0]')
drivers/staging/iio/addac/adt7316.c:1667:20: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_mode.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1667:29: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_mode.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1667:2: error: initializer element is not constant
&iio_dev_attr_mode.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1667:2: note: (near initialization for 'adt7516_attributes[1]')
drivers/staging/iio/addac/adt7316.c:1668:3: error: 'iio_dev_attr_select_ex_temp' undeclared here (not in a function)
&iio_dev_attr_select_ex_temp.dev_attr.attr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/iio/addac/adt7316.c:1668:30: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_select_ex_temp.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1668:39: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_select_ex_temp.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1668:2: error: initializer element is not constant
&iio_dev_attr_select_ex_temp.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1668:2: note: (near initialization for 'adt7516_attributes[2]')
drivers/staging/iio/addac/adt7316.c:1669:23: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_enabled.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1669:32: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_enabled.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1669:2: error: initializer element is not constant
&iio_dev_attr_enabled.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1669:2: note: (near initialization for 'adt7516_attributes[3]')
drivers/staging/iio/addac/adt7316.c:1670:26: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_ad_channel.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1670:35: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_ad_channel.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1670:2: error: initializer element is not constant
&iio_dev_attr_ad_channel.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1670:2: note: (near initialization for 'adt7516_attributes[4]')
drivers/staging/iio/addac/adt7316.c:1671:31: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_all_ad_channels.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1671:40: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_all_ad_channels.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1671:2: error: initializer element is not constant
&iio_dev_attr_all_ad_channels.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1671:2: note: (near initialization for 'adt7516_attributes[5]')
drivers/staging/iio/addac/adt7316.c:1672:33: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_disable_averaging.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1672:42: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_disable_averaging.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1672:2: error: initializer element is not constant
&iio_dev_attr_disable_averaging.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1672:2: note: (near initialization for 'adt7516_attributes[6]')
drivers/staging/iio/addac/adt7316.c:1673:36: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_enable_smbus_timeout.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1673:45: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_enable_smbus_timeout.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1673:2: error: initializer element is not constant
&iio_dev_attr_enable_smbus_timeout.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1673:2: note: (near initialization for 'adt7516_attributes[7]')
drivers/staging/iio/addac/adt7316.c:1674:25: error: request for member 'dev_attr' in something not a structure or union
&iio_dev_attr_powerdown.dev_attr.attr,
^
drivers/staging/iio/addac/adt7316.c:1674:34: error: request for member 'attr' in something not a structure or union
&iio_dev_attr_powerdown.dev_attr.attr,
^vim +/iio_dev_attr_ex_temp_offset +1647 drivers/staging/iio/addac/adt7316.c
e019edd4 Scott Matheina 2016-12-25 1638 &iio_dev_attr_all_dac_update_modes.dev_attr.attr, e019edd4 Scott Matheina 2016-12-25 1639 &iio_dev_attr_update_dac.dev_attr.attr, e019edd4 Scott Matheina 2016-12-25 1640 &iio_dev_attr_da_ab_vref_bypass.dev_attr.attr, e019edd4 Scott Matheina 2016-12-25 1641 &iio_dev_attr_da_cd_vref_bypass.dev_attr.attr, e019edd4 Scott Matheina 2016-12-25 1642 &iio_dev_attr_dac_internal_vref.dev_attr.attr, e019edd4 Scott Matheina 2016-12-25 1643 &iio_dev_attr_vdd.dev_attr.attr, 35f6b6b8 Sonic Zhang 2010-10-27 @1644 &iio_dev_attr_in_temp.dev_attr.attr, 35f6b6b8 Sonic Zhang 2010-10-27 @1645 &iio_dev_attr_ex_temp.dev_attr.attr, 35f6b6b8 Sonic Zhang 2010-10-27 1646 &iio_dev_attr_in_temp_offset.dev_attr.attr, 35f6b6b8 Sonic Zhang 2010-10-27 @1647 &iio_dev_attr_ex_temp_offset.dev_attr.attr, 35f6b6b8 Sonic Zhang 2010-10-27 @1648 &iio_dev_attr_in_analog_temp_offset.dev_attr.attr, 35f6b6b8 Sonic Zhang 2010-10-27 1649 &iio_dev_attr_ex_analog_temp_offset.dev_attr.attr, e019edd4 Scott Matheina 2016-12-25 1650 &iio_dev_attr_dac_a.dev_attr.attr, e019edd4 Scott Matheina 2016-12-25 @1651 &iio_dev_attr_dac_b.dev_attr.attr, e019edd4 Scott Matheina 2016-12-25 1652 &iio_dev_attr_dac_c.dev_attr.attr, e019edd4 Scott Matheina 2016-12-25 1653 &iio_dev_attr_dac_d.dev_attr.attr, 35f6b6b8 Sonic Zhang 2010-10-27 @1654 &iio_dev_attr_device_id.dev_attr.attr, 35f6b6b8 Sonic Zhang 2010-10-27 1655 &iio_dev_attr_manufactorer_id.dev_attr.attr, 35f6b6b8 Sonic Zhang 2010-10-27 1656 &iio_dev_attr_device_rev.dev_attr.attr, 35f6b6b8 Sonic Zhang 2010-10-27 1657 &iio_dev_attr_bus_type.dev_attr.attr,
:::::: The code at line 1647 was first introduced by commit
:::::: 35f6b6b86ede34a9f8c029943842640b2ffbfa19 staging: iio: new ADT7316/7/8 and ADT7516/7/9 driver
:::::: TO: Sonic Zhang <[email protected]> :::::: CC: Greg Kroah-Hartman <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Jonathan Cameron
maintainerRe: [PATCHv4 8/8] Fixes style issues due to mis-aligned carry over lines
In reply to Scott MatheinaQuoted 4 lines · Scott Matheina
Lines were not aligned with (, this patch simply changes the indention, no substantive changes function of driver.
Signed-off-by Scott Matheina <[email protected]>
Again, this patch is fine. If you respin the good bits of the series, please give it a suitable name that indicates what it is effecting such as. staging:iio:adt7316: Aligns function parameters with opening bracket.
This could easily be combined with the other patch doing much the same though.
Thanks,
Jonathan
Quoted 963 lines
--- drivers/staging/iio/addac/adt7316.c | 415 ++++++++++++++++++------------------ 1 file changed, 210 insertions(+), 205 deletions(-)drivers/staging/iio/addac/adt7316.c +210
-205@@ -217,8 +217,8 @@ struct adt7316_limit_regs { };static ssize_t adt7316_show_enabled (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -227,7 +227,7 @@ static ssize_t adt7316_show_enabled(struct device *dev, }static ssize_t _adt7316_store_enabled (struct adt7316_chip_info *chip, -int enable) +int enable) {u8 config1;int ret;@@ -244,13 +244,12 @@ static ssize_t _adt7316_store_enabled(struct adt7316_chip_info *chip, chip->config1 = config1;return ret; - }static ssize_t adt7316_store_enabled (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -271,8 +270,8 @@ static iio_device_attr(enabled, 0644, adt7316_show_enabled, adt7316_store_enabled, 0);static ssize_t adt7316_show_select_ex_temp (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -284,9 +283,9 @@ static ssize_t adt7316_show_select_ex_temp(struct device *dev, }static ssize_t adt7316_store_select_ex_temp (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -326,9 +325,9 @@ static ssize_t adt7316_show_mode(struct device *dev, }static ssize_t adt7316_store_mode (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -398,9 +397,9 @@ static ssize_t adt7316_show_ad_channel(struct device *dev, }static ssize_t adt7316_store_ad_channel (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -474,9 +473,9 @@ static ssize_t adt7316_show_disable_averaging(struct device *dev, }static ssize_t adt7316_store_disable_averaging (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -511,9 +510,9 @@ static ssize_t adt7316_show_enable_smbus_timeout(struct device *dev, }static ssize_t adt7316_store_enable_smbus_timeout (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -548,9 +547,9 @@ static ssize_t adt7316_show_powerdown(struct device *dev, }static ssize_t adt7316_store_powerdown (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -584,9 +583,9 @@ static ssize_t adt7316_show_fast_ad_clock(struct device *dev, }static ssize_t adt7316_store_fast_ad_clock (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -610,8 +609,8 @@ static iio_device_attr(fast_ad_clock, 0644, adt7316_show_fast_ad_clock, adt7316_store_fast_ad_clock, 0);static ssize_t adt7316_show_da_high_resolution (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -627,9 +626,9 @@ static ssize_t adt7316_show_da_high_resolution(struct device *dev, }static ssize_t adt7316_store_da_high_resolution (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -661,9 +660,9 @@ static iio_device_attr(da_high_resolution, 0644, adt7316_show_da_high_resolution, adt7316_store_da_high_resolution, 0); -static ssize_t adt7316_show_AIN_internal_Vref (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_ain_internal_vref (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -675,10 +674,10 @@ 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, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_ain_internal_vref (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -706,10 +705,9 @@ 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, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_enable_prop_daca (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -718,10 +716,10 @@ static ssize_t adt7316_show_enable_prop_DACA(struct device *dev, !!(chip->config3 & ADT7316_EN_IN_TEMP_PROP_DACA)); } -static ssize_t adt7316_store_enable_prop_DACA (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_enable_prop_daca (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -745,9 +743,9 @@ static iio_device_attr(enable_proportion_daca, 0644, adt7316_show_enable_prop_daca, adt7316_store_enable_prop_daca, 0); -static ssize_t adt7316_show_enable_prop_DACB (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_enable_prop_dacb (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -756,10 +754,10 @@ static ssize_t adt7316_show_enable_prop_DACB(struct device *dev, !!(chip->config3 & ADT7316_EN_EX_TEMP_PROP_DACB)); } -static ssize_t adt7316_store_enable_prop_DACB (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_enable_prop_dacb (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -783,9 +781,9 @@ static iio_device_attr(enable_proportion_dacb, 0644, adt7316_show_enable_prop_dacb, adt7316_store_enable_prop_dacb, 0); -static ssize_t adt7316_show_DAC_2Vref_ch_mask (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_2vref_ch_mask (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -794,10 +792,10 @@ 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, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_2vref_ch_mask (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -825,9 +823,9 @@ 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, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_update_mode (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -850,10 +848,10 @@ static ssize_t adt7316_show_DAC_update_mode(struct device *dev, } } -static ssize_t adt7316_store_DAC_update_mode (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_update_mode (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -883,9 +881,9 @@ static ssize_t adt7316_store_DAC_update_mode(struct device *dev, static iio_device_attr(DAC_update_mode, 0644, adt7316_show_dac_update_mode, adt7316_store_dac_update_mode, 0); -static ssize_t adt7316_show_all_DAC_update_modes (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_all_dac_update_modes (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -901,8 +899,8 @@ static ssize_t adt7316_show_all_DAC_update_modes(struct device *dev, static iio_device_attr(all_dac_update_modes, 0444, adt7316_show_all_dac_update_modes, NULL, 0); -static ssize_t adt7316_store_update_DAC (struct device *dev, -struct device_attribute *attr, +static ssize_t adt7316_store_update_dac (struct device *dev, +struct device_attribute *attr,const char *buf,size_t len) {@@ -938,9 +936,9 @@ static ssize_t adt7316_store_update_DAC(struct device *dev, static iio_device_attr(update_dac, 0644, NULL, adt7316_store_update_dac, 0); -static ssize_t adt7316_show_DA_AB_Vref_bypass (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_da_ab_vref_bypass (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -952,10 +950,10 @@ 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, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_da_ab_vref_bypass (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -981,9 +979,9 @@ static ssize_t adt7316_store_DA_AB_Vref_bypass(struct device *dev, static iio_device_attr(da_ab_vref_bypass, 0644, adt7316_show_da_ab_vref_bypass, adt7316_store_da_ab_vref_bypass, 0); -static ssize_t adt7316_show_DA_CD_Vref_bypass (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_da_cd_vref_bypass (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -995,10 +993,10 @@ 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, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_da_cd_vref_bypass (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1024,9 +1022,9 @@ static ssize_t adt7316_store_DA_CD_Vref_bypass(struct device *dev, static iio_device_attr(da_cd_vref_bypass, 0644, adt7316_show_da_cd_vref_bypass, adt7316_store_da_cd_vref_bypass, 0); -static ssize_t adt7316_show_DAC_internal_Vref (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_internal_vref (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1039,10 +1037,10 @@ static ssize_t adt7316_show_DAC_internal_Vref(struct device *dev, !!(chip->dac_config & ADT7316_DAC_IN_VREF)); } -static ssize_t adt7316_store_DAC_internal_Vref (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_internal_vref (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1084,7 +1082,8 @@ 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, -int channel,char *buf) +int channel, +char *buf) {u16 data;u8 msb, lsb;@@ -1092,7 +1091,7 @@ static ssize_t adt7316_show_ad(struct adt7316_chip_info *chip,int ret;if ((chip->config2 &ADT7316_AD_SINGLE_CH_MODE ) && - channel != (chip->config2 &ADT7516_AD_SINGLE_CH_MASK )) + channel != (chip->config2 &ADT7516_AD_SINGLE_CH_MASK ))return -EPERM ;switch (channel) {@@ -1159,8 +1158,8 @@ static ssize_t adt7316_show_ad(struct adt7316_chip_info *chip, }static ssize_t adt7316_show_VDD (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1171,8 +1170,8 @@ static ssize_t adt7316_show_VDD(struct device *dev, static iio_device_attr(VDD, 0444, adt7316_show_VDD, NULL, 0);static ssize_t adt7316_show_in_temp (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1182,9 +1181,9 @@ static ssize_t adt7316_show_in_temp(struct device *dev, static iio_device_attr(in_temp, 0444, adt7316_show_in_temp, NULL, 0); -static ssize_t adt7316_show_ex_temp_AIN1 (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_ex_temp_ain1 (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1197,8 +1196,8 @@ static iio_device_attr(ex_temp_ain1, 0444, adt7316_show_ex_temp_ain1, NULL, 0); static iio_device_attr(ex_temp, 0444, adt7316_show_ex_temp_ain1, NULL, 0);static ssize_t adt7316_show_AIN2 (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1233,7 +1232,8 @@ static ssize_t adt7316_show_ain4(struct device *dev, static iio_device_attr(ain4, 0444, adt7316_show_ain4, NULL, 0);static ssize_t adt7316_show_temp_offset (struct adt7316_chip_info *chip, -int offset_addr,char *buf) +int offset_addr, +char *buf) {int data;u8 val;@@ -1251,7 +1251,9 @@ static ssize_t adt7316_show_temp_offset(struct adt7316_chip_info *chip, }static ssize_t adt7316_store_temp_offset (struct adt7316_chip_info *chip, -int offset_addr,const char *buf,size_t len) +int offset_addr, +const char *buf, +size_t len) {int data;u8 val;@@ -1274,8 +1276,8 @@ static ssize_t adt7316_store_temp_offset(struct adt7316_chip_info *chip, }static ssize_t adt7316_show_in_temp_offset (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1284,23 +1286,23 @@ static ssize_t adt7316_show_in_temp_offset(struct device *dev, }static ssize_t adt7316_store_in_temp_offset (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_store_temp_offset (chip,ADT7316_IN_TEMP_OFFSET , buf, - len); + len); } static iio_device_attr(in_temp_offset, 0644, adt7316_show_in_temp_offset, adt7316_store_in_temp_offset, 0);static ssize_t adt7316_show_ex_temp_offset (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1309,63 +1311,62 @@ static ssize_t adt7316_show_ex_temp_offset(struct device *dev, }static ssize_t adt7316_store_ex_temp_offset (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_store_temp_offset (chip,ADT7316_EX_TEMP_OFFSET , buf, - len); + len); } -static IIO_DEVICE_ATTR(ex_temp_offset, S_IRUGO | S_IWUSR, - adt7316_show_ex_temp_offset, - adt7316_store_ex_temp_offset, 0); +static iio_device_attr(ex_temp_offset, 0644, adt7316_show_ex_temp_offset, + adt7316_store_ex_temp_offset, 0);static ssize_t adt7316_show_in_analog_temp_offset (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_show_temp_offset (chip, -ADT7316_IN_ANALOG_TEMP_OFFSET , buf); +ADT7316_IN_ANALOG_TEMP_OFFSET , buf); }static ssize_t adt7316_store_in_analog_temp_offset (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf,size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_store_temp_offset (chip, -ADT7316_IN_ANALOG_TEMP_OFFSET , buf, len); +ADT7316_IN_ANALOG_TEMP_OFFSET , + buf, len); } -static IIO_DEVICE_ATTR(in_analog_temp_offset, S_IRUGO | S_IWUSR, - adt7316_show_in_analog_temp_offset, - adt7316_store_in_analog_temp_offset, 0); +static iio_device_attr(in_analog_temp_offset, 0644, + adt7316_show_in_analog_temp_offset, + adt7316_store_in_analog_temp_offset, 0);static ssize_t adt7316_show_ex_analog_temp_offset (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);return adt7316_show_temp_offset (chip, -ADT7316_EX_ANALOG_TEMP_OFFSET , buf); +ADT7316_EX_ANALOG_TEMP_OFFSET , buf); }static ssize_t adt7316_store_ex_analog_temp_offset (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1378,15 +1379,16 @@ static iio_device_attr(ex_analog_temp_offset, 0644, adt7316_show_ex_analog_temp_offset, adt7316_store_ex_analog_temp_offset, 0); -static ssize_t adt7316_show_DAC (struct adt7316_chip_info *chip, -int channel,char *buf) +static ssize_t adt7316_show_dac (struct adt7316_chip_info *chip, +int channel, +char *buf) {u16 data;u8 msb, lsb, offset;int ret;if (channel >=ADT7316_DA_MSB_DATA_REGS || - (channel ==0 && + (channel ==0 && (chip->config3 &ADT7316_EN_IN_TEMP_PROP_DACA )) || (channel ==1 && (chip->config3 &ADT7316_EN_EX_TEMP_PROP_DACB )))@@ -1411,15 +1413,17 @@ static ssize_t adt7316_show_DAC(struct adt7316_chip_info *chip,return sprintf (buf,"%d\n" , data); } -static ssize_t adt7316_store_DAC (struct adt7316_chip_info *chip, -int channel,const char *buf,size_t len) +static ssize_t adt7316_store_dac (struct adt7316_chip_info *chip, +int channel, +const char *buf, +size_t len) {u8 msb, lsb, offset;u16 data;int ret;if (channel >=ADT7316_DA_MSB_DATA_REGS || - (channel ==0 && + (channel ==0 && (chip->config3 &ADT7316_EN_IN_TEMP_PROP_DACA )) || (channel ==1 && (chip->config3 &ADT7316_EN_EX_TEMP_PROP_DACB )))@@ -1448,9 +1452,9 @@ static ssize_t adt7316_store_DAC(struct adt7316_chip_info *chip,return len; } -static ssize_t adt7316_show_DAC_A (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_a (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1458,10 +1462,10 @@ static ssize_t adt7316_show_DAC_A(struct device *dev,return adt7316_show_dac (chip,0 , buf); } -static ssize_t adt7316_store_DAC_A (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_a (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1471,9 +1475,9 @@ static ssize_t adt7316_store_DAC_A(struct device *dev, static iio_device_attr(dac_a, 0644, adt7316_show_dac_a, adt7316_store_dac_a, 0); -static ssize_t adt7316_show_DAC_B (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_b (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1481,10 +1485,10 @@ static ssize_t adt7316_show_DAC_B(struct device *dev,return adt7316_show_dac (chip,1 , buf); } -static ssize_t adt7316_store_DAC_B (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_b (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1494,9 +1498,9 @@ static ssize_t adt7316_store_DAC_B(struct device *dev, static iio_device_attr(dac_b, 0644, adt7316_show_dac_b, adt7316_store_dac_b, 0); -static ssize_t adt7316_show_DAC_C (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_c (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1504,10 +1508,10 @@ static ssize_t adt7316_show_DAC_C(struct device *dev,return adt7316_show_dac (chip,2 , buf); } -static ssize_t adt7316_store_DAC_C (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_c (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1517,9 +1521,9 @@ static ssize_t adt7316_store_DAC_C(struct device *dev, static iio_device_attr(DAC_C, 0644, adt7316_show_dac_c, adt7316_store_dac_c, 0); -static ssize_t adt7316_show_DAC_D (struct device *dev, -struct device_attribute *attr, -char *buf) +static ssize_t adt7316_show_dac_d (struct device *dev, +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1527,10 +1531,10 @@ static ssize_t adt7316_show_DAC_D(struct device *dev,return adt7316_show_dac (chip,3 , buf); } -static ssize_t adt7316_store_DAC_D (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +static ssize_t adt7316_store_dac_d (struct device *dev, +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1541,8 +1545,8 @@ static ssize_t adt7316_store_DAC_D(struct device *dev, static iio_device_attr(DAC_D, 0644, adt7316_show_dac_d, adt7316_store_dac_d, 0);static ssize_t adt7316_show_device_id (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1556,11 +1560,11 @@ static ssize_t adt7316_show_device_id(struct device *dev,return sprintf (buf,"%d\n" , id); } -static IIO_DEVICE_ATTR(device_id, S_IRUGO, adt7316_show_device_id, NULL, 0); +static iio_device_attr(device_id, 0444, adt7316_show_device_id, NULL, 0);static ssize_t adt7316_show_manufactorer_id (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1578,8 +1582,8 @@ static iio_device_attr(manufactorer_id, 0444, adt7316_show_manufactorer_id, NULL, 0);static ssize_t adt7316_show_device_rev (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1596,8 +1600,8 @@ static ssize_t adt7316_show_device_rev(struct device *dev, static iio_device_attr(device_rev, 0444, adt7316_show_device_rev, NULL, 0);static ssize_t adt7316_show_bus_type (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1780,8 +1784,8 @@ static irqreturn_t adt7316_event_handler(int irq, void *private)* Show mask of enabled interrupts in Hex. */ static ssize_t adt7316_show_int_mask (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1793,9 +1797,9 @@ static ssize_t adt7316_show_int_mask(struct device *dev,* Set 1 to the mask in Hex to enabled interrupts. */ static ssize_t adt7316_set_int_mask (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1832,9 +1836,10 @@ static ssize_t adt7316_set_int_mask(struct device *dev,return len; } +static inline ssize_t adt7316_show_ad_bound (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev_attr *this_attr =to_iio_dev_attr (attr);struct iio_dev *dev_info =dev_to_iio_dev (dev);@@ -1844,7 +1849,7 @@ static inline ssize_t adt7316_show_ad_bound(struct device *dev,int ret;if ((chip->id &ID_FAMILY_MASK ) ==ID_ADT73XX && - this_attr->address >ADT7316_EX_TEMP_LOW ) + this_attr->address >ADT7316_EX_TEMP_LOW )return -EPERM ; ret = chip->bus.read (chip->bus.client, this_attr->address, &val);@@ -1854,7 +1859,7 @@ static inline ssize_t adt7316_show_ad_bound(struct device *dev, data = (int )val;if (!((chip->id &ID_FAMILY_MASK ) ==ID_ADT75XX && - (chip->config1 &ADT7516_SEL_AIN1_2_EX_TEMP_MASK ) ==0 )) { + (chip->config1 &ADT7516_SEL_AIN1_2_EX_TEMP_MASK ) ==0 )) {if (data &0x80 ) data -=256 ; }@@ -1863,9 +1868,9 @@ static inline ssize_t adt7316_show_ad_bound(struct device *dev, }static inline ssize_t adt7316_set_ad_bound (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev_attr *this_attr =to_iio_dev_attr (attr);struct iio_dev *dev_info =dev_to_iio_dev (dev);@@ -1875,7 +1880,7 @@ static inline ssize_t adt7316_set_ad_bound(struct device *dev,int ret;if ((chip->id &ID_FAMILY_MASK ) ==ID_ADT73XX && - this_attr->address >ADT7316_EX_TEMP_LOW ) + this_attr->address >ADT7316_EX_TEMP_LOW )return -EPERM ; ret =kstrtoint (buf,10 , &data);@@ -1883,7 +1888,7 @@ static inline ssize_t adt7316_set_ad_bound(struct device *dev,return -EINVAL ;if ((chip->id &ID_FAMILY_MASK ) ==ID_ADT75XX && - (chip->config1 &ADT7516_SEL_AIN1_2_EX_TEMP_MASK ) ==0 ) { + (chip->config1 &ADT7516_SEL_AIN1_2_EX_TEMP_MASK ) ==0 ) {if (data >255 || data <0 )return -EINVAL ; }else {@@ -1904,8 +1909,8 @@ static inline ssize_t adt7316_set_ad_bound(struct device *dev, }static ssize_t adt7316_show_int_enabled (struct device *dev, -struct device_attribute *attr, -char *buf) +struct device_attribute *attr, +char *buf) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -1914,9 +1919,9 @@ static ssize_t adt7316_show_int_enabled(struct device *dev, }static ssize_t adt7316_set_int_enabled (struct device *dev, -struct device_attribute *attr, -const char *buf, -size_t len) +struct device_attribute *attr, +const char *buf, +size_t len) {struct iio_dev *dev_info =dev_to_iio_dev (dev);struct adt7316_chip_info *chip =iio_priv (dev_info);@@ -2040,7 +2045,7 @@ static const struct iio_info adt7516_info = {* device probe and remove */ int adt7316_probe (struct device *dev,struct adt7316_bus *bus, -const char *name) +const char *name) {struct adt7316_chip_info *chip;struct iio_dev *indio_dev;@@ -2112,7 +2117,7 @@ int adt7316_probe(struct device *dev, struct adt7316_bus *bus,return ret;dev_info (dev,"%s temperature sensor, ADC and DAC registered.\n" , - indio_dev->name); + indio_dev->name);return 0 ; }