ratp: Straighten ratp deregistration
There are some bugs in the error path when ratp initialization fails
half way through. Reusing the global ratp context which might be half
initialized makes the code hard to follow and hard to fix, so the
strategy is changed to always allocating a fresh ratp context and
returning -EBUSY when one exists already. We store in the context what
has been done in the initialization path and add a ratp_unregister()
which uses this information to tear down everything that has been
initialized.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent c90ff1b commit 1915553bf8b6a2d26dfda73069d9ee76ea9e09f5
@Sascha Hauer Sascha Hauer authored on 16 Jun 2020
Showing 1 changed file
View
common/ratp/ratp.c