driver core: Fix use-after-free and double free on glue directory
[linux-2.6-block.git] / drivers / base / init.c
CommitLineData
989d42e8 1// SPDX-License-Identifier: GPL-2.0
1da177e4 2/*
1da177e4
LT
3 * Copyright (c) 2002-3 Patrick Mochel
4 * Copyright (c) 2002-3 Open Source Development Labs
1da177e4
LT
5 */
6
7#include <linux/device.h>
8#include <linux/init.h>
3947be19 9#include <linux/memory.h>
194ec936 10#include <linux/of.h>
1da177e4 11
a1bdc7aa
BD
12#include "base.h"
13
1da177e4 14/**
4a3ad20c 15 * driver_init - initialize driver model.
1da177e4 16 *
4a3ad20c
GKH
17 * Call the driver model init functions to initialize their
18 * subsystems. Called early from init/main.c.
1da177e4 19 */
1da177e4
LT
20void __init driver_init(void)
21{
22 /* These are the core pieces */
2b2af54a 23 devtmpfs_init();
1da177e4
LT
24 devices_init();
25 buses_init();
26 classes_init();
27 firmware_init();
4039483f 28 hypervisor_init();
1da177e4
LT
29
30 /* These are also core pieces, but must come after the
31 * core core pieces.
32 */
319b11ef 33 of_core_init();
1da177e4 34 platform_bus_init();
1da177e4 35 cpu_dev_init();
3947be19 36 memory_dev_init();
caa73ea1 37 container_dev_init();
1da177e4 38}