forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/vfio/platform/vfio_platform_common.c
....@@ -1,16 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2013 - Virtual Open Systems
34 * Author: Antonios Motakis <a.motakis@virtualopensystems.com>
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License, version 2, as
7
- * published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
135 */
6
+
7
+#define dev_fmt(fmt) "VFIO: " fmt
148
159 #include <linux/device.h>
1610 #include <linux/acpi.h>
....@@ -63,7 +57,7 @@
6357
6458 adev = ACPI_COMPANION(dev);
6559 if (!adev) {
66
- pr_err("VFIO: ACPI companion device not found for %s\n",
60
+ dev_err(dev, "ACPI companion device not found for %s\n",
6761 vdev->name);
6862 return -ENODEV;
6963 }
....@@ -78,12 +72,11 @@
7872 const char **extra_dbg)
7973 {
8074 #ifdef CONFIG_ACPI
81
- struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
8275 struct device *dev = vdev->device;
8376 acpi_handle handle = ACPI_HANDLE(dev);
8477 acpi_status acpi_ret;
8578
86
- acpi_ret = acpi_evaluate_object(handle, "_RST", NULL, &buffer);
79
+ acpi_ret = acpi_evaluate_object(handle, "_RST", NULL, NULL);
8780 if (ACPI_FAILURE(acpi_ret)) {
8881 if (extra_dbg)
8982 *extra_dbg = acpi_format_exception(acpi_ret);
....@@ -414,7 +407,7 @@
414407
415408 if (!reg->ioaddr) {
416409 reg->ioaddr =
417
- ioremap_nocache(reg->addr, reg->size);
410
+ ioremap(reg->addr, reg->size);
418411
419412 if (!reg->ioaddr)
420413 return -ENOMEM;
....@@ -491,7 +484,7 @@
491484
492485 if (!reg->ioaddr) {
493486 reg->ioaddr =
494
- ioremap_nocache(reg->addr, reg->size);
487
+ ioremap(reg->addr, reg->size);
495488
496489 if (!reg->ioaddr)
497490 return -ENOMEM;
....@@ -637,7 +630,7 @@
637630 ret = device_property_read_string(dev, "compatible",
638631 &vdev->compat);
639632 if (ret)
640
- pr_err("VFIO: Cannot retrieve compat for %s\n", vdev->name);
633
+ dev_err(dev, "Cannot retrieve compat for %s\n", vdev->name);
641634
642635 return ret;
643636 }
....@@ -679,14 +672,14 @@
679672
680673 ret = vfio_platform_get_reset(vdev);
681674 if (ret && vdev->reset_required) {
682
- pr_err("VFIO: No reset function found for device %s\n",
683
- vdev->name);
675
+ dev_err(dev, "No reset function found for device %s\n",
676
+ vdev->name);
684677 return ret;
685678 }
686679
687680 group = vfio_iommu_group_get(dev);
688681 if (!group) {
689
- pr_err("VFIO: No IOMMU group for device %s\n", vdev->name);
682
+ dev_err(dev, "No IOMMU group for device %s\n", vdev->name);
690683 ret = -EINVAL;
691684 goto put_reset;
692685 }