Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devm considered harmful #241

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

arnout
Copy link
Contributor

@arnout arnout commented May 6, 2024

While using the bootlin materials for an internal training, there are a few improvements I made (at least, I consider them improvments myself). Since you probably don't agree with all of them, I'm making separate PRs for each. Feel free to close the PR if you disagree with the idea.

arnout added 2 commits May 6, 2024 10:52
Draw attention to the limitations of devm, cfr. Laurent Pinchart's 2022
LPC talk.

Signed-off-by: Arnout Vandecappelle <[email protected]>
In the "specific struct has a reference to struct device" case, the
private structure is typically found through dev_get_drvdata(). Add an
example of that.

Of course, many frameworks have their own "private" pointer because they
already use drvdata, but explaining that as well would lead us too far.

Signed-off-by: Arnout Vandecappelle <[email protected]>
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