|
@@ -667,8 +667,14 @@ static ssize_t
|
|
acpi_device_sun_show(struct device *dev, struct device_attribute *attr,
|
|
acpi_device_sun_show(struct device *dev, struct device_attribute *attr,
|
|
char *buf) {
|
|
char *buf) {
|
|
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
|
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
|
|
|
+ acpi_status status;
|
|
|
|
+ unsigned long long sun;
|
|
|
|
+
|
|
|
|
+ status = acpi_evaluate_integer(acpi_dev->handle, "_SUN", NULL, &sun);
|
|
|
|
+ if (ACPI_FAILURE(status))
|
|
|
|
+ return -ENODEV;
|
|
|
|
|
|
- return sprintf(buf, "%lu\n", acpi_dev->pnp.sun);
|
|
|
|
|
|
+ return sprintf(buf, "%llu\n", sun);
|
|
}
|
|
}
|
|
static DEVICE_ATTR(sun, 0444, acpi_device_sun_show, NULL);
|
|
static DEVICE_ATTR(sun, 0444, acpi_device_sun_show, NULL);
|
|
|
|
|
|
@@ -690,7 +696,6 @@ static int acpi_device_setup_files(struct acpi_device *dev)
|
|
{
|
|
{
|
|
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
|
|
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
|
|
acpi_status status;
|
|
acpi_status status;
|
|
- unsigned long long sun;
|
|
|
|
int result = 0;
|
|
int result = 0;
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -731,14 +736,10 @@ static int acpi_device_setup_files(struct acpi_device *dev)
|
|
if (dev->pnp.unique_id)
|
|
if (dev->pnp.unique_id)
|
|
result = device_create_file(&dev->dev, &dev_attr_uid);
|
|
result = device_create_file(&dev->dev, &dev_attr_uid);
|
|
|
|
|
|
- status = acpi_evaluate_integer(dev->handle, "_SUN", NULL, &sun);
|
|
|
|
- if (ACPI_SUCCESS(status)) {
|
|
|
|
- dev->pnp.sun = (unsigned long)sun;
|
|
|
|
|
|
+ if (acpi_has_method(dev->handle, "_SUN")) {
|
|
result = device_create_file(&dev->dev, &dev_attr_sun);
|
|
result = device_create_file(&dev->dev, &dev_attr_sun);
|
|
if (result)
|
|
if (result)
|
|
goto end;
|
|
goto end;
|
|
- } else {
|
|
|
|
- dev->pnp.sun = (unsigned long)-1;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if (acpi_has_method(dev->handle, "_STA")) {
|
|
if (acpi_has_method(dev->handle, "_STA")) {
|