Page MenuHomeFreeBSD

linuxkpi: Add devm_add_action and devm_add_action_or_reset
ClosedPublic

Authored by manu on Mar 17 2023, 10:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 9 2024, 8:23 PM
Unknown Object (File)
Apr 5 2024, 7:56 AM
Unknown Object (File)
Apr 3 2024, 8:10 AM
Unknown Object (File)
Dec 12 2023, 2:36 PM
Unknown Object (File)
Nov 24 2023, 10:25 AM
Unknown Object (File)
Nov 19 2023, 12:21 PM
Unknown Object (File)
Sep 2 2023, 11:10 AM
Unknown Object (File)
Sep 2 2023, 11:09 AM

Details

Summary

Those adds a new devres and will exectute some function on release.

Sponsored by: Beckhoff Automation GmbH & Co. KG

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

manu requested review of this revision.Mar 17 2023, 10:22 AM
bz added a subscriber: bz.

Feel free to implement the changes before commit they make sense to you.

sys/compat/linuxkpi/common/include/linux/device.h
683

Do we have to #define to something else? Wy can we not use the names as they should be?

sys/compat/linuxkpi/common/src/linux_devres.c
246

Should we check that action is non-NULL to avoid calling a possible NULL pointer on release?

This revision is now accepted and ready to land.Mar 17 2023, 9:17 PM
sys/compat/linuxkpi/common/include/linux/device.h
683

That's what we did from the beginning for linuxkpi, prefix all the stuff just in case we add a native symbol that is the same in the kernel.

sys/compat/linuxkpi/common/src/linux_devres.c
246

Doesn't seems that Linux does this, it wouldn't hurt to add a check, just wondering what errno we should return then

sys/compat/linuxkpi/common/src/linux_devres.c
246

-EINVAL? or add a KASSERT instead?

sys/compat/linuxkpi/common/src/linux_devres.c
246

I'll do the KASSERT

This revision now requires review to proceed.Mar 22 2023, 7:50 AM
manu marked an inline comment as done.Mar 22 2023, 7:51 AM
This revision is now accepted and ready to land.Mar 22 2023, 1:47 PM