mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-24 19:45:06 +08:00
f99e689181
Conditional registration is a problem for other subsystems which may unwittingly try to interact with host1x_context_device_bus_type in an uninitialised state on non-Tegra platforms. A look under /sys/bus on a typical system already reveals plenty of entries from enabled but otherwise irrelevant configs, so lets keep things simple and register our context bus unconditionally too. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
27 lines
547 B
C
27 lines
547 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (c) 2021, NVIDIA Corporation.
|
|
*/
|
|
|
|
#include <linux/device.h>
|
|
#include <linux/of.h>
|
|
|
|
struct bus_type host1x_context_device_bus_type = {
|
|
.name = "host1x-context",
|
|
};
|
|
EXPORT_SYMBOL_GPL(host1x_context_device_bus_type);
|
|
|
|
static int __init host1x_context_device_bus_init(void)
|
|
{
|
|
int err;
|
|
|
|
err = bus_register(&host1x_context_device_bus_type);
|
|
if (err < 0) {
|
|
pr_err("bus type registration failed: %d\n", err);
|
|
return err;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
postcore_initcall(host1x_context_device_bus_init);
|