Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73631
b: refs/heads/master
c: 76e6386
h: refs/heads/master
i:
  73629: e7d388d
  73627: 2f384ce
  73623: 465bb0e
  73615: 853d467
  73599: 43f5df7
v: v3
  • Loading branch information
Ivo Manca authored and Mark M. Hoffman committed Nov 8, 2007
1 parent 6748ebb commit 8539a33
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5c726b3ba0d6692253a09d88c701f0c4b45ca248
refs/heads/master: 76e63860daedb302bddd707a765411c902d936bd
39 changes: 18 additions & 21 deletions trunk/drivers/hwmon/sis5595.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,21 +495,28 @@ static const struct attribute_group sis5595_group = {
.attrs = sis5595_attributes,
};

static struct attribute *sis5595_attributes_opt[] = {
static struct attribute *sis5595_attributes_in4[] = {
&sensor_dev_attr_in4_input.dev_attr.attr,
&sensor_dev_attr_in4_min.dev_attr.attr,
&sensor_dev_attr_in4_max.dev_attr.attr,
&sensor_dev_attr_in4_alarm.dev_attr.attr,
NULL
};

static const struct attribute_group sis5595_group_in4 = {
.attrs = sis5595_attributes_in4,
};

static struct attribute *sis5595_attributes_temp1[] = {
&dev_attr_temp1_input.attr,
&dev_attr_temp1_max.attr,
&dev_attr_temp1_max_hyst.attr,
&sensor_dev_attr_temp1_alarm.dev_attr.attr,
NULL
};

static const struct attribute_group sis5595_group_opt = {
.attrs = sis5595_attributes_opt,
static const struct attribute_group sis5595_group_temp1 = {
.attrs = sis5595_attributes_temp1,
};

/* This is called when the module is loaded */
Expand Down Expand Up @@ -564,24 +571,12 @@ static int __devinit sis5595_probe(struct platform_device *pdev)
if ((err = sysfs_create_group(&pdev->dev.kobj, &sis5595_group)))
goto exit_free;
if (data->maxins == 4) {
if ((err = device_create_file(&pdev->dev,
&sensor_dev_attr_in4_input.dev_attr))
|| (err = device_create_file(&pdev->dev,
&sensor_dev_attr_in4_min.dev_attr))
|| (err = device_create_file(&pdev->dev,
&sensor_dev_attr_in4_max.dev_attr))
|| (err = device_create_file(&pdev->dev,
&sensor_dev_attr_in4_alarm.dev_attr)))
if ((err = sysfs_create_group(&pdev->dev.kobj,
&sis5595_group_in4)))
goto exit_remove_files;
} else {
if ((err = device_create_file(&pdev->dev,
&dev_attr_temp1_input))
|| (err = device_create_file(&pdev->dev,
&dev_attr_temp1_max))
|| (err = device_create_file(&pdev->dev,
&dev_attr_temp1_max_hyst))
|| (err = device_create_file(&pdev->dev,
&sensor_dev_attr_temp1_alarm.dev_attr)))
if ((err = sysfs_create_group(&pdev->dev.kobj,
&sis5595_group_temp1)))
goto exit_remove_files;
}

Expand All @@ -595,7 +590,8 @@ static int __devinit sis5595_probe(struct platform_device *pdev)

exit_remove_files:
sysfs_remove_group(&pdev->dev.kobj, &sis5595_group);
sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_opt);
sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_in4);
sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_temp1);
exit_free:
kfree(data);
exit_release:
Expand All @@ -610,7 +606,8 @@ static int __devexit sis5595_remove(struct platform_device *pdev)

hwmon_device_unregister(data->hwmon_dev);
sysfs_remove_group(&pdev->dev.kobj, &sis5595_group);
sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_opt);
sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_in4);
sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_temp1);

release_region(data->addr, SIS5595_EXTENT);
platform_set_drvdata(pdev, NULL);
Expand Down

0 comments on commit 8539a33

Please sign in to comment.