misc/pvpanic: simplify the code using acpi_dev_resource_io

Use acpi_dev_resource_io API.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Peng Hao 2018-11-06 22:57:13 +08:00 committed by Greg Kroah-Hartman
parent fcb418cd56
commit d2ae1717f3

View file

@ -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)