Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48697
b: refs/heads/master
c: 05e2d82
h: refs/heads/master
i:
  48695: 43185b8
v: v3
  • Loading branch information
Mattia Dongili authored and Len Brown committed Feb 13, 2007
1 parent bc09ff8 commit beda2ef
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 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: c561162f10b9f35c9aa5c25eb8dbeb446f0c5201
refs/heads/master: 05e2d8274ef4504db9941f7c515f340ab6c0b2e1
30 changes: 21 additions & 9 deletions trunk/drivers/acpi/sony_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ static int sony_acpi_add(struct acpi_device *device)
acpi_status status;
int result;
acpi_handle handle;
mode_t proc_file_mode;
struct sony_acpi_value *item;

sony_acpi_acpi_device = device;
Expand Down Expand Up @@ -334,20 +335,31 @@ static int sony_acpi_add(struct acpi_device *device)
}

for (item = sony_acpi_values; item->name; ++item) {
proc_file_mode = 0;

if (!debug && item->debug)
continue;

if (item->acpiget &&
ACPI_FAILURE(acpi_get_handle(sony_acpi_handle,
ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle,
item->acpiget, &handle)))
continue;
proc_file_mode = S_IRUSR;
else
printk(LOG_PFX "unable to get ACPI handle for %s (get)\n",
item->name);

if (item->acpiset &&
ACPI_FAILURE(acpi_get_handle(sony_acpi_handle,
ACPI_SUCCESS(acpi_get_handle(sony_acpi_handle,
item->acpiset, &handle)))
continue;
proc_file_mode |= S_IWUSR;
else
printk(LOG_PFX "unable to get ACPI handle for %s (set)\n",
item->name);

if (proc_file_mode == 0)
continue;

item->proc = create_proc_entry(item->name, 0666,
item->proc = create_proc_entry(item->name, proc_file_mode,
acpi_device_dir(device));
if (!item->proc) {
printk(LOG_PFX "unable to create proc entry\n");
Expand All @@ -366,15 +378,15 @@ static int sony_acpi_add(struct acpi_device *device)
return 0;

outproc:
for (item = sony_acpi_values; item->name; ++item)
if (item->proc)
remove_proc_entry(item->name, acpi_device_dir(device));
outnotify:
status = acpi_remove_notify_handler(sony_acpi_handle,
ACPI_DEVICE_NOTIFY,
sony_acpi_notify);
if (ACPI_FAILURE(status))
printk(LOG_PFX "unable to remove notify handler\n");
outnotify:
for (item = sony_acpi_values; item->name; ++item)
if (item->proc)
remove_proc_entry(item->name, acpi_device_dir(device));
outwalk:
return result;
}
Expand Down

0 comments on commit beda2ef

Please sign in to comment.