LCOV - code coverage report
Current view: top level - drivers/base - container.c (source / functions) Hit Total Coverage
Test: landlock.info Lines: 5 11 45.5 %
Date: 2021-04-22 12:43:58 Functions: 1 3 33.3 %

          Line data    Source code
       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             : 
      15           0 : static int trivial_online(struct device *dev)
      16             : {
      17           0 :         return 0;
      18             : }
      19             : 
      20           0 : static int container_offline(struct device *dev)
      21             : {
      22           0 :         struct container_dev *cdev = to_container_dev(dev);
      23             : 
      24           0 :         return cdev->offline ? cdev->offline(cdev) : 0;
      25             : }
      26             : 
      27             : struct 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             : 
      34           1 : void __init container_dev_init(void)
      35             : {
      36           1 :         int ret;
      37             : 
      38           1 :         ret = subsys_system_register(&container_subsys, NULL);
      39           1 :         if (ret)
      40           0 :                 pr_err("%s() failed: %d\n", __func__, ret);
      41           1 : }

Generated by: LCOV version 1.14