blob: 908e6520e804b2967ab029ca6a617cc0d1902f16 [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
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 */
6
7#include <linux/device.h>
8#include <linux/init.h>
Dave Hansen3947be12005-10-29 18:16:54 -07009#include <linux/memory.h>
Sudeep Holla194ec932015-05-14 15:28:24 +010010#include <linux/of.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
Ben Dooksa1bdc7a2005-10-13 17:54:41 +010012#include "base.h"
13
Linus Torvalds1da177e2005-04-16 15:20:36 -070014/**
Greg Kroah-Hartman4a3ad202008-01-24 22:50:12 -080015 * driver_init - initialize driver model.
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 *
Greg Kroah-Hartman4a3ad202008-01-24 22:50:12 -080017 * Call the driver model init functions to initialize their
18 * subsystems. Called early from init/main.c.
Linus Torvalds1da177e2005-04-16 15:20:36 -070019 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070020void __init driver_init(void)
21{
22 /* These are the core pieces */
Kay Sievers2b2af542009-04-30 15:23:42 +020023 devtmpfs_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 devices_init();
25 buses_init();
26 classes_init();
27 firmware_init();
Michael Holzheu40394832006-05-09 12:53:49 +020028 hypervisor_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -070029
30 /* These are also core pieces, but must come after the
31 * core core pieces.
32 */
Wesley W. Terpstra319b11e2018-06-21 15:37:37 +020033 of_core_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 platform_bus_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -070035 cpu_dev_init();
Dave Hansen3947be12005-10-29 18:16:54 -070036 memory_dev_init();
Rafael J. Wysockicaa73ea2013-12-29 15:25:48 +010037 container_dev_init();
Linus Torvalds1da177e2005-04-16 15:20:36 -070038}