Skip to content

Conversation

t123yh
Copy link
Contributor

@t123yh t123yh commented Oct 25, 2021

This patch use class_create and device_create to automatically create /dev/esps0 when driver is loaded, eliminating the need to mknod /dev/esps0.

Use `class_create` to automatically create /dev/esps0 when
driver is loaded. Eliminating the need to `mknod /dev/esps0`.
@mantriyogesh
Copy link
Collaborator

hello @t123yh ,

Thanks for time and efforts.
We will review the Pull request and merge in master shortly.

dev_t dev_num = dev_first + i;
devs[i].dev_index = i;
cdev_add(&devs[i].cdev, MKDEV(ESP_SERIAL_MAJOR, i), 1);
devs[i].dev = device_create(cl, NULL, dev_num, NULL, "esps%d", i);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this removed from OS automatically when driver unloads?
If not, it would be better to remove this manually before driver unloading.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is removed in line 269, device_destroy(cl, dev_num);

espressif-bot pushed a commit that referenced this pull request Mar 18, 2024
- create and maintain serial driver /dev/esps0 from kernel module
- removed serial creation and destroy from rpi_init.sh
- closes PR #71
- closes PR #81
- closes PR #180

Co-authored-by: Yunhao Tian <[email protected]>
Co-authored-by: ljgabc <[email protected]>
Co-authored-by: David Rosen <[email protected]>
Co-authored-by: Yogesh Mantri <[email protected]>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants