staging: pi433: remove rf69_get_flag function resolving enum conflict
authorPaulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Fri, 25 Feb 2022 22:40:33 +0000 (11:40 +1300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Mar 2022 21:31:21 +0000 (22:31 +0100)
commit2d19e698e7f1c2453340b515f18adc779c42b11e
tree38a3b00b7b5e728217b30c358b2f00dad1a8f244
parented01d1b9bca21b186aa05b5beab4df88d42cf335
staging: pi433: remove rf69_get_flag function resolving enum conflict

The reason why rf69_get_flag() existed was to provide a high-level way
to obtain values out of 1 (of 2) flags registers using bit masking. The
idea was to map the possible flag values found in the data sheet like
shown in page 70 of the RFM69HCW datasheet.

However, due to the fact that enums values in C must be unique, there
was a naming conflict on 'fifo_not_empty' which is used by the
tx_start_condition enum. So the author decided to create a 'fifo_empty'
one which would negate the value that comes from the flag register as
the solution to that conflict (which is very confusing).

this patch removes rf69_get_flag function which subsequently solves the
enum redeclaration problem so kernel developers can follow the data
sheet more easily.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Link: https://lore.kernel.org/r/Yhla4a1Clpguoo2h@mail.google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/pi433/pi433_if.c
drivers/staging/pi433/rf69.c
drivers/staging/pi433/rf69.h
drivers/staging/pi433/rf69_enum.h