fpga: Simplify and improve fpga mgr test using deferred actions
authorMarco Pagani <marpagan@redhat.com>
Thu, 25 Jul 2024 12:50:29 +0000 (14:50 +0200)
committerXu Yilun <yilun.xu@linux.intel.com>
Wed, 14 Aug 2024 15:50:01 +0000 (23:50 +0800)
commitdbcbd3650f305df708b569517c063c7644cf0d89
treed2184a73ca646416356799c7de1a8725a5b5346b
parent8400291e289ee6b2bf9779ff1c83a291501f017b
fpga: Simplify and improve fpga mgr test using deferred actions

Use deferred actions to simplify the test suite and avoid potential memory
leaks when test cases fail. Remove unnecessary calls to
kunit_device_unregister() since kunit devices are tied to the test context
and released by a deferred action when the test is completed.

Signed-off-by: Marco Pagani <marpagan@redhat.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20240725125031.308195-2-marpagan@redhat.com
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
drivers/fpga/tests/fpga-mgr-test.c