lib: Link fp_dev to fp_img_dev and back

So it's easy to switch between the 2 structs, and remove fp_img_dev->dev
direct access, as well as fp_dev->priv "user data" usage.
This commit is contained in:
Bastien Nocera
2018-09-14 17:30:01 +02:00
parent 170da7fec1
commit 161c3ccf1c
6 changed files with 83 additions and 44 deletions

View File

@@ -68,6 +68,9 @@ struct fp_dev {
uint32_t devtype;
void *priv;
/* only valid if drv->type == DRIVER_IMAGING */
struct fp_img_dev *img_dev;
int nr_enroll_stages;
/* read-only to drivers */
@@ -136,8 +139,9 @@ enum fp_imgdev_verify_state {
};
struct fp_img_dev {
struct fp_dev *dev;
libusb_device_handle *udev;
struct fp_dev *parent;
enum fp_imgdev_action action;
int action_state;