platform_bus_init
- 1. platform_bus_init 函数
- 1.1 device_register 函数
- 1.2 bus_register 函数
- 1.3 of_platform_register_reconfig_notifier 函数
- 1.4 device 结构体
1. platform_bus_init 函数
- 通过
early_platform_cleanup()函数,清理早期平台设备(将早期启动阶段通过early_platform_driver_register注册的平台设备进行清理或转移)- 通过 device_register 函数
1.1初始化
platform_bus结构体(struct device)
1.2创建/sys/devices/platform目录,并将devices_kset->list插入到platform_bus->kobj.entry链表中
1.3创建/sys/devices/platform/uevent文件(uevent 的属性文件)
1.1 device_register 函数
通过 device_initialize 函数,初始化 platform_bus 虚拟设备结构体
通过 device_add 函数,完成下列任务:
2.1初始化 device 结构体
2.2kobject_add 函数,创建/sys/devices/platform目录,并将devices_kset->list插入到platform_bus->kobj.entry链表中
2.3device_create_file 函数,创建/sys/devices/platform/uevent文件(uevent 的属性文件)
2.4device_add_class_symlinks 函数,什么都不做
2.5device_add_attrs 函数,什么都不做
2.6bus_add_device 函数,什么都不做
2.7dpm_sysfs_add 函数,什么都不做
2.8device_pm_add 函数,什么都不做
2.9kobject_uevent 函数,什么都不做
2.10bus_probe_device 函数,什么都不做device_register 函数