diff options
| author | Peng Hao <peng.hao2@zte.com.cn> | 2018-11-06 09:57:13 -0500 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-07 07:53:04 -0500 |
| commit | d2ae1717f3f6b1bd86cd05d0443169b645445d62 (patch) | |
| tree | bb281d4c505dc2fe1b9920ede34e6958ef19a3cc /drivers/misc/pvpanic.c | |
| parent | fcb418cd567febb310749e37507679e4f2703e56 (diff) | |
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>
Diffstat (limited to 'drivers/misc/pvpanic.c')
| -rw-r--r-- | drivers/misc/pvpanic.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/misc/pvpanic.c b/drivers/misc/pvpanic.c index fd86daba7ffd..49c59e1d299d 100644 --- a/drivers/misc/pvpanic.c +++ b/drivers/misc/pvpanic.c | |||
| @@ -77,17 +77,14 @@ static struct notifier_block pvpanic_panic_nb = { | |||
| 77 | static acpi_status | 77 | static acpi_status |
| 78 | pvpanic_walk_resources(struct acpi_resource *res, void *context) | 78 | pvpanic_walk_resources(struct acpi_resource *res, void *context) |
| 79 | { | 79 | { |
| 80 | switch (res->type) { | 80 | struct resource r; |
| 81 | case ACPI_RESOURCE_TYPE_END_TAG: | ||
| 82 | return AE_OK; | ||
| 83 | 81 | ||
| 84 | case ACPI_RESOURCE_TYPE_IO: | 82 | if (acpi_dev_resource_io(res, &r)) { |
| 85 | port = res->data.io.minimum; | 83 | port = r.start; |
| 86 | return AE_OK; | 84 | return AE_OK; |
| 87 | |||
| 88 | default: | ||
| 89 | return AE_ERROR; | ||
| 90 | } | 85 | } |
| 86 | |||
| 87 | return AE_ERROR; | ||
| 91 | } | 88 | } |
| 92 | 89 | ||
| 93 | static int pvpanic_add(struct acpi_device *device) | 90 | static int pvpanic_add(struct acpi_device *device) |
