hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
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 }
....@@ -414,7 +408,7 @@
414408
415409 if (!reg->ioaddr) {
416410 reg->ioaddr =
417
- ioremap_nocache(reg->addr, reg->size);
411
+ ioremap(reg->addr, reg->size);
418412
419413 if (!reg->ioaddr)
420414 return -ENOMEM;
....@@ -491,7 +485,7 @@
491485
492486 if (!reg->ioaddr) {
493487 reg->ioaddr =
494
- ioremap_nocache(reg->addr, reg->size);
488
+ ioremap(reg->addr, reg->size);
495489
496490 if (!reg->ioaddr)
497491 return -ENOMEM;
....@@ -637,7 +631,7 @@
637631 ret = device_property_read_string(dev, "compatible",
638632 &vdev->compat);
639633 if (ret)
640
- pr_err("VFIO: Cannot retrieve compat for %s\n", vdev->name);
634
+ dev_err(dev, "Cannot retrieve compat for %s\n", vdev->name);
641635
642636 return ret;
643637 }
....@@ -679,14 +673,14 @@
679673
680674 ret = vfio_platform_get_reset(vdev);
681675 if (ret && vdev->reset_required) {
682
- pr_err("VFIO: No reset function found for device %s\n",
683
- vdev->name);
676
+ dev_err(dev, "No reset function found for device %s\n",
677
+ vdev->name);
684678 return ret;
685679 }
686680
687681 group = vfio_iommu_group_get(dev);
688682 if (!group) {
689
- pr_err("VFIO: No IOMMU group for device %s\n", vdev->name);
683
+ dev_err(dev, "No IOMMU group for device %s\n", vdev->name);
690684 ret = -EINVAL;
691685 goto put_reset;
692686 }