Re: [PATCH 2/2] hwmon: (i5500_temp) Convert to use ATTRIBUTE_GROUPS macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 23 Oct 2014 16:14:00 +0800, Axel Lin wrote:
> Use ATTRIBUTE_GROUPS macro to simplify the code a bit.
> 
> Signed-off-by: Axel Lin <axel.lin@xxxxxxxxxx>
> ---
>  drivers/hwmon/i5500_temp.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/hwmon/i5500_temp.c b/drivers/hwmon/i5500_temp.c
> index e19d5d7..7946603 100644
> --- a/drivers/hwmon/i5500_temp.c
> +++ b/drivers/hwmon/i5500_temp.c
> @@ -120,7 +120,7 @@ static SENSOR_DEVICE_ATTR(temp1_max, S_IRUGO, show_thresh, NULL, 2);
>  static SENSOR_DEVICE_ATTR(temp1_crit_alarm, S_IRUGO, show_alarm, NULL, 0);
>  static SENSOR_DEVICE_ATTR(temp1_max_alarm, S_IRUGO, show_alarm, NULL, 1);
>  
> -static struct attribute *i5500_temp_attributes[] = {
> +static struct attribute *i5500_temp_attrs[] = {
>  	&dev_attr_temp1_input.attr,
>  	&sensor_dev_attr_temp1_crit.dev_attr.attr,
>  	&sensor_dev_attr_temp1_max_hyst.dev_attr.attr,
> @@ -130,14 +130,7 @@ static struct attribute *i5500_temp_attributes[] = {
>  	NULL
>  };
>  
> -static const struct attribute_group i5500_temp_group = {
> -	.attrs = i5500_temp_attributes,
> -};
> -
> -static const struct attribute_group *i5500_temp_groups[] = {
> -	&i5500_temp_group,
> -	NULL
> -};
> +ATTRIBUTE_GROUPS(i5500_temp);
>  
>  static const struct pci_device_id i5500_temp_ids[] = {
>  	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x3438) },

Applied, thanks.

-- 
Jean Delvare
SUSE L3 Support

_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux