Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * System bus type for containers.
0004  *
0005  * Copyright (C) 2013, Intel Corporation
0006  * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
0007  */
0008 
0009 #include <linux/container.h>
0010 
0011 #include "base.h"
0012 
0013 #define CONTAINER_BUS_NAME  "container"
0014 
0015 static int trivial_online(struct device *dev)
0016 {
0017     return 0;
0018 }
0019 
0020 static int container_offline(struct device *dev)
0021 {
0022     struct container_dev *cdev = to_container_dev(dev);
0023 
0024     return cdev->offline ? cdev->offline(cdev) : 0;
0025 }
0026 
0027 struct bus_type container_subsys = {
0028     .name = CONTAINER_BUS_NAME,
0029     .dev_name = CONTAINER_BUS_NAME,
0030     .online = trivial_online,
0031     .offline = container_offline,
0032 };
0033 
0034 void __init container_dev_init(void)
0035 {
0036     int ret;
0037 
0038     ret = subsys_system_register(&container_subsys, NULL);
0039     if (ret)
0040         pr_err("%s() failed: %d\n", __func__, ret);
0041 }