Loading...
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * System bus type for containers.
4 *
5 * Copyright (C) 2013, Intel Corporation
6 * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
7 */
8
9#include <linux/container.h>
10
11#include "base.h"
12
13#define CONTAINER_BUS_NAME "container"
14
15static int trivial_online(struct device *dev)
16{
17 return 0;
18}
19
20static int container_offline(struct device *dev)
21{
22 struct container_dev *cdev = to_container_dev(dev);
23
24 return cdev->offline ? cdev->offline(cdev) : 0;
25}
26
27struct bus_type container_subsys = {
28 .name = CONTAINER_BUS_NAME,
29 .dev_name = CONTAINER_BUS_NAME,
30 .online = trivial_online,
31 .offline = container_offline,
32};
33
34void __init container_dev_init(void)
35{
36 int ret;
37
38 ret = subsys_system_register(&container_subsys, NULL);
39 if (ret)
40 pr_err("%s() failed: %d\n", __func__, ret);
41}
1/*
2 * System bus type for containers.
3 *
4 * Copyright (C) 2013, Intel Corporation
5 * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/container.h>
13
14#include "base.h"
15
16#define CONTAINER_BUS_NAME "container"
17
18static int trivial_online(struct device *dev)
19{
20 return 0;
21}
22
23static int container_offline(struct device *dev)
24{
25 struct container_dev *cdev = to_container_dev(dev);
26
27 return cdev->offline ? cdev->offline(cdev) : 0;
28}
29
30struct bus_type container_subsys = {
31 .name = CONTAINER_BUS_NAME,
32 .dev_name = CONTAINER_BUS_NAME,
33 .online = trivial_online,
34 .offline = container_offline,
35};
36
37void __init container_dev_init(void)
38{
39 int ret;
40
41 ret = subsys_system_register(&container_subsys, NULL);
42 if (ret)
43 pr_err("%s() failed: %d\n", __func__, ret);
44}