Commit d2ae1717 authored by Peng Hao's avatar Peng Hao Committed by Greg Kroah-Hartman

misc/pvpanic: simplify the code using acpi_dev_resource_io

Use acpi_dev_resource_io API.
Suggested-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
Signed-off-by: default avatarPeng Hao <peng.hao2@zte.com.cn>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fcb418cd
......@@ -77,17 +77,14 @@ static struct notifier_block pvpanic_panic_nb = {
static acpi_status
pvpanic_walk_resources(struct acpi_resource *res, void *context)
{
switch (res->type) {
case ACPI_RESOURCE_TYPE_END_TAG:
return AE_OK;
struct resource r;
case ACPI_RESOURCE_TYPE_IO:
port = res->data.io.minimum;
if (acpi_dev_resource_io(res, &r)) {
port = r.start;
return AE_OK;
default:
return AE_ERROR;
}
return AE_ERROR;
}
static int pvpanic_add(struct acpi_device *device)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment