staging: vt6656: Refactor the vnt_rf_table_download function
Create a constant array of struct vnt_table_info type elements with the
necessary info (address and length) about all the rf tables for every rf
type.
In every case of the "switch" statement replace the hardcoded info about
these tables with and index to the new constant array. Moreover, use
this array index to extract the necessary info in every call to the
vnt_control_out_* functions.
Check if this index has been set and return without error otherwise.
So, avoid the execution of code that previously did nothing due to
lengths with values of zero for some rf types.
Also remove all the variables that are now unused.
This way reduce the stack footprint, and make the code more clear.
Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200429153838.7216-1-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>