Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[linux/fpc-iii.git] / drivers / base / container.c
blobecbfbe2e908ffad95d0ecfa49ce34d34f3b4225c
1 /*
2 * System bus type for containers.
4 * Copyright (C) 2013, Intel Corporation
5 * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
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.
12 #include <linux/container.h>
14 #include "base.h"
16 #define CONTAINER_BUS_NAME "container"
18 static int trivial_online(struct device *dev)
20 return 0;
23 static int container_offline(struct device *dev)
25 struct container_dev *cdev = to_container_dev(dev);
27 return cdev->offline ? cdev->offline(cdev) : 0;
30 struct bus_type container_subsys = {
31 .name = CONTAINER_BUS_NAME,
32 .dev_name = CONTAINER_BUS_NAME,
33 .online = trivial_online,
34 .offline = container_offline,
37 void __init container_dev_init(void)
39 int ret;
41 ret = subsys_system_register(&container_subsys, NULL);
42 if (ret)
43 pr_err("%s() failed: %d\n", __func__, ret);