Commit 4336b933 authored by Oliver O'Halloran's avatar Oliver O'Halloran Committed by Michael Ellerman

powerpc/pseries: Make vio and ibmebus initcalls pseries specific

The vio and ibmebus buses are used for pseries specific
paravirtualised devices and currently they're initialised by the
generic initcall types. This is mostly fine, but it can result in some
nuisance errors in dmesg when booting on PowerNV on some OSes, e.g.

  [    2.984439] synth uevent: /devices/vio: failed to send uevent
  [    2.984442] vio vio: uevent: failed to send synthetic uevent
  [   17.968551] synth uevent: /devices/vio: failed to send uevent
  [   17.968554] vio vio: uevent: failed to send synthetic uevent

We don't see anything similar for the ibmebus because that depends on
!CONFIG_LITTLE_ENDIAN.

This patch squashes those by switching to using machine_*_initcall()
so the bus type is only registered when the kernel is running on a
pseries machine.
Signed-off-by: default avatarOliver O'Halloran <oohall@gmail.com>
Reviewed-by: default avatarTyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200421081539.7485-1-oohall@gmail.com
parent f44b85da
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <linux/stat.h> #include <linux/stat.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <asm/ibmebus.h> #include <asm/ibmebus.h>
#include <asm/machdep.h>
static struct device ibmebus_bus_device = { /* fake "parent" device */ static struct device ibmebus_bus_device = { /* fake "parent" device */
.init_name = "ibmebus", .init_name = "ibmebus",
...@@ -464,4 +465,4 @@ static int __init ibmebus_bus_init(void) ...@@ -464,4 +465,4 @@ static int __init ibmebus_bus_init(void)
return 0; return 0;
} }
postcore_initcall(ibmebus_bus_init); machine_postcore_initcall(pseries, ibmebus_bus_init);
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <asm/tce.h> #include <asm/tce.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/hvcall.h> #include <asm/hvcall.h>
#include <asm/machdep.h>
static struct vio_dev vio_bus_device = { /* fake "parent" device */ static struct vio_dev vio_bus_device = { /* fake "parent" device */
.name = "vio", .name = "vio",
...@@ -1513,7 +1514,7 @@ static int __init vio_bus_init(void) ...@@ -1513,7 +1514,7 @@ static int __init vio_bus_init(void)
return 0; return 0;
} }
postcore_initcall(vio_bus_init); machine_postcore_initcall(pseries, vio_bus_init);
static int __init vio_device_init(void) static int __init vio_device_init(void)
{ {
...@@ -1522,7 +1523,7 @@ static int __init vio_device_init(void) ...@@ -1522,7 +1523,7 @@ static int __init vio_device_init(void)
return 0; return 0;
} }
device_initcall(vio_device_init); machine_device_initcall(pseries, vio_device_init);
static ssize_t name_show(struct device *dev, static ssize_t name_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
...@@ -1703,4 +1704,4 @@ static int __init vio_init(void) ...@@ -1703,4 +1704,4 @@ static int __init vio_init(void)
dma_debug_add_bus(&vio_bus_type); dma_debug_add_bus(&vio_bus_type);
return 0; return 0;
} }
fs_initcall(vio_init); machine_fs_initcall(pseries, vio_init);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment