lkml.org 
[lkml]   [2018]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V6 2/8] misc/pvpanic: simplify the code using acpi_dev_resource_io
Date
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>
---
drivers/misc/pvpanic.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/misc/pvpanic.c b/drivers/misc/pvpanic.c
index fd86dab..49c59e1 100644
--- a/drivers/misc/pvpanic.c
+++ b/drivers/misc/pvpanic.c
@@ -77,17 +77,14 @@
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)
--
1.8.3.1
\
 
 \ /
  Last update: 2018-11-02 05:47    [W:1.752 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site