Merged
Conversation
YJwu2023
reviewed
Jul 11, 2023
| .0 | ||
| .lock() | ||
| .0 | ||
| .get_mut(Self::major_to_index(device_number.major())) |
Collaborator
There was a problem hiding this comment.
这里倒是无所谓,应该是cargo fmt自动换行的,改了可能美观一点,不改也行
| /// @return 初始化成功,返回(),失败,返回错误码 | ||
| pub fn uart_init() -> Result<(), SystemError> { | ||
| let device_inode = bus_device_register("platform:0", &UART_DEV.id_table().to_name()) | ||
| .expect("uart device register error"); |
Collaborator
There was a problem hiding this comment.
出错不要直接panic,做点错误处理(保证不会出错的情况除外)
| // 初始化platform总线 | ||
| crate::driver::base::platform::platform_bus_init().expect("platform bus init failed"); | ||
| // 初始化串口 | ||
| crate::driver::uart::uart::uart_init().expect("initilize uart error"); |
Member
|
笑死,我突然发现这里的chrdev没改成chardev
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
注册串口设备,创建字符设备框架