crda: add reglib regdb context helpers: reglib_(malloc|free)_regdb_ctx()

These are used to allow users of reglib to instantiate a
reglib context to be used with reglib without having to
always open the regdb, mmap() it and verify it. It also
allows us to tuck away all that magic from users and put
the responsibility on reglib to do all the sanity work
for users.

To start with consolidate with two users:

reglib_get_rd_idx() and reglib_get_rd_alpha2()

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
2 files changed