lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 23 Dec 2010 14:20:27 -0800
From:	Guenter Roeck <guenter.roeck@...csson.com>
To:	dd diasemi <dd.diasemi@...il.com>
CC:	"lm-sensors@...sensors.org" <lm-sensors@...sensors.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [lm-sensors] [PATCHv3 6/11] HWMON: HWMON module of DA9052
 device driver

On Tue, Dec 21, 2010 at 12:52:50PM -0500, dd diasemi wrote:
> HWMON module for DA9052 PMIC device from Dialog Semiconductor.
> 
> Changes made since last submission:
> . removed the DA9052 customized success and error codes
> . changed da9052_manual_read() return type
> 
> Linux Kernel Version: 2.6.34
> 
> Signed-off-by: D. Chen <dchen@...semi.com>

[ ... ]

> +
> +static DEVICE_ATTR(name, S_IRUGO, da9052_adc_show_name, NULL);
> +static SENSOR_DEVICE_ATTR(read_vddout, S_IRUGO,
> +                               da9052_adc_read_start_stop, NULL,
> +                               DA9052_ADC_VDDOUT);
> +static SENSOR_DEVICE_ATTR(read_ich, S_IRUGO, da9052_adc_read_ich, NULL,
> +                               DA9052_ADC_ICH);
> +static SENSOR_DEVICE_ATTR(read_tbat, S_IRUGO, da9052_adc_read_tbat, NULL,
> +                               DA9052_ADC_TBAT);
> +static SENSOR_DEVICE_ATTR(read_vbat, S_IRUGO, da9052_adc_read_vbat, NULL,
> +                               DA9052_ADC_VBAT);
> +#if (DA9052_ADC_CONF_ADC4 == 1)
> +static SENSOR_DEVICE_ATTR(in4_input, S_IRUGO, da9052_adc_read_start_stop, NULL,
> +                               DA9052_ADC_ADCIN4);
> +#endif
> +#if (DA9052_ADC_CONF_ADC5 == 1)
> +static SENSOR_DEVICE_ATTR(in5_input, S_IRUGO, da9052_adc_read_start_stop, NULL,
> +                               DA9052_ADC_ADCIN5);
> +#endif
> +#if (DA9052_ADC_CONF_ADC6 == 1)
> +static SENSOR_DEVICE_ATTR(in6_input, S_IRUGO, da9052_adc_read_start_stop, NULL,
> +                               DA9052_ADC_ADCIN6);
> +#endif
> +static SENSOR_DEVICE_ATTR(read_tjunc, S_IRUGO, da9052_adc_read_tjunc, NULL,
> +                               DA9052_ADC_TJUNC);
> +static SENSOR_DEVICE_ATTR(read_vbbat, S_IRUGO, da9052_adc_read_vbbat, NULL,
> +                               DA9052_ADC_VBBAT);
> +

Driver doesn't follow hwmon sysfs ABI, with no good reason.
As for the labels, I am not sure if the provided labels reflect chip data 
or the use of the chip on a specific board. The product brief seems to indicate
the latter. If so, defining label attribute files is not appropriate. Labels
can then be assigned through sensors.conf.

The use of ifdefs in the code is excessive. There should be a single Kconfig entry
to enable the driver. Remaining data can be provided with platform data if it is 
mandatory, or sensors not supported on a given board can be configured to be 
ignored via sensors.conf.

Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ