blob: 0bf84b9e09b2c315be0a574e79430f9e8f180f73 [file] [log] [blame]
Greg Kroah-Hartman989d42e2017-11-07 17:30:07 +01001// SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * Copyright (c) 2002-3 Patrick Mochel
4 * Copyright (c) 2002-3 Open Source Development Labs
5 *
6 * This file is released under the GPLv2
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 */
8
9#include <linux/device.h>
10#include <linux/init.h>
Dave Hansen3947be12005-10-29 18:16:54 -070011#include <linux/memory.h>
Sudeep Holla194ec9362015-05-14 15:28:24 +010012#include <linux/of.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Ben Dooksa1bdc7a2005-10-13 17:54:41 +010014#include "base.h"
15
Linus Torvalds1da177e2005-04-16 15:20:36 -070016/**
Greg Kroah-Hartman4a3ad202008-01-24 22:50:12 -080017 * driver_init - initialize driver model.
Linus Torvalds1da177e2005-04-16 15:20:36 -070018 *
Greg Kroah-Hartman4a3ad202008-01-24 22:50:12 -080019 * Call the driver model init functions to initialize their
20 * subsystems. Called early from init/main.c.
Linus Torvalds1da177e2005-04-16 15:20:36 -070021 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070022void __init driver_init(void)
23{
24 /* These are the core pieces */
Kay Sievers2b2af542009-04-30 15:23:42 +020025 devtmpfs_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 devices_init();
27 buses_init();
28 classes_init();
29 firmware_init();
Michael Holzheu40394832006-05-09 12:53:49 +020030 hypervisor_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
32 /* These are also core pieces, but must come after the
33 * core core pieces.
34 */
35 platform_bus_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 cpu_dev_init();
Dave Hansen3947be12005-10-29 18:16:54 -070037 memory_dev_init();
Rafael J. Wysockicaa73ea2013-12-29 15:25:48 +010038 container_dev_init();
Sudeep Holla194ec9362015-05-14 15:28:24 +010039 of_core_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -070040}