Commit 40e7ac19 authored by Vasily Khoruzhick's avatar Vasily Khoruzhick Committed by Daniel Drake

Adapting to latest libusb

Signed-off-by: Vasily Khoruzhick's avatarVasily Khoruzhick <anarsoul@gmail.com>
parent 1ab52617
......@@ -70,7 +70,7 @@ static int do_write_regv(struct write_regv_data *wdata, int upper_bound)
unsigned char *data = g_malloc(alloc_size);
unsigned int i;
size_t data_offset = 0;
struct libusb_transfer *transfer = libusb_alloc_transfer();
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
int r;
if (!transfer) {
......
......@@ -111,7 +111,7 @@ static void read_regs_rq_cb(struct fp_img_dev *dev, int result, void *user_data)
if (result != 0)
goto err;
transfer = libusb_alloc_transfer();
transfer = libusb_alloc_transfer(0);
if (!transfer) {
result = -ENOMEM;
goto err;
......@@ -203,7 +203,7 @@ static void generic_ignore_data_cb(struct libusb_transfer *transfer)
* away, then increment the SSM */
static void generic_read_ignore_data(struct fpi_ssm *ssm, size_t bytes)
{
struct libusb_transfer *transfer = libusb_alloc_transfer();
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
unsigned char *data;
int r;
......@@ -434,7 +434,7 @@ static void finger_det_reqs_cb(struct fp_img_dev *dev, int result,
return;
}
transfer = libusb_alloc_transfer();
transfer = libusb_alloc_transfer(0);
if (!transfer) {
fpi_imgdev_session_error(dev, -ENOMEM);
return;
......@@ -630,7 +630,7 @@ static void capture_run_state(struct fpi_ssm *ssm)
generic_write_regv_cb, ssm);
break;
case CAPTURE_READ_STRIP: ;
struct libusb_transfer *transfer = libusb_alloc_transfer();
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
unsigned char *data;
if (!transfer) {
......
......@@ -164,7 +164,7 @@ static void do_capture(struct fp_img_dev *dev)
unsigned char *data;
int r;
aesdev->img_trf = libusb_alloc_transfer();
aesdev->img_trf = libusb_alloc_transfer(0);
if (!aesdev->img_trf) {
fpi_imgdev_session_error(dev, -EIO);
return;
......
......@@ -137,7 +137,7 @@ static struct libusb_transfer *alloc_send_cmd_transfer(struct fp_dev *dev,
unsigned char seq_a, unsigned char seq_b, const unsigned char *data,
uint16_t len, libusb_transfer_cb_fn callback, void *user_data)
{
struct libusb_transfer *transfer = libusb_alloc_transfer();
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
uint16_t crc;
/* 9 bytes extra for: 4 byte 'Ciao', 1 byte A, 1 byte B | lenHI,
......@@ -410,7 +410,7 @@ static void read_msg_cb(struct libusb_transfer *transfer)
* to read the remainder. This is handled below. */
if (len > MAX_DATA_IN_READ_BUF) {
int needed = len - MAX_DATA_IN_READ_BUF;
struct libusb_transfer *etransfer = libusb_alloc_transfer();
struct libusb_transfer *etransfer = libusb_alloc_transfer(0);
int r;
if (!transfer)
......@@ -450,7 +450,7 @@ out:
static int __read_msg_async(struct read_msg_data *udata)
{
unsigned char *buf = g_malloc(MSG_READ_BUF_SIZE);
struct libusb_transfer *transfer = libusb_alloc_transfer();
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
int r;
if (!transfer) {
......@@ -703,7 +703,7 @@ static void initsm_run_state(struct fpi_ssm *ssm)
case WRITE_CTRL400: ;
unsigned char *data;
transfer = libusb_alloc_transfer();
transfer = libusb_alloc_transfer(0);
if (!transfer) {
fpi_ssm_mark_aborted(ssm, -ENOMEM);
break;
......
......@@ -187,7 +187,7 @@ static int write_regs(struct fp_img_dev *dev, uint16_t first_reg,
void *user_data)
{
struct write_regs_data *wrdata;
struct libusb_transfer *transfer = libusb_alloc_transfer();
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
unsigned char *data;
int r;
......@@ -254,7 +254,7 @@ static int read_regs(struct fp_img_dev *dev, uint16_t first_reg,
uint16_t num_regs, read_regs_cb_fn callback, void *user_data)
{
struct read_regs_data *rrdata;
struct libusb_transfer *transfer = libusb_alloc_transfer();
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
unsigned char *data;
int r;
......@@ -423,7 +423,7 @@ out:
static int start_irq_handler(struct fp_img_dev *dev)
{
struct uru4k_dev *urudev = dev->priv;
struct libusb_transfer *transfer = libusb_alloc_transfer();
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
unsigned char *data;
int r;
......@@ -507,7 +507,7 @@ out:
static int start_imaging_loop(struct fp_img_dev *dev)
{
struct uru4k_dev *urudev = dev->priv;
struct libusb_transfer *transfer = libusb_alloc_transfer();
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
unsigned char *data;
int r;
......
......@@ -95,7 +95,7 @@ static void sm_write_reg(struct fpi_ssm *ssm, unsigned char reg,
unsigned char value)
{
struct fp_img_dev *dev = ssm->priv;
struct libusb_transfer *transfer = libusb_alloc_transfer();
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
unsigned char *data;
int r;
......@@ -134,7 +134,7 @@ static void sm_exec_cmd(struct fpi_ssm *ssm, unsigned char cmd,
unsigned char param)
{
struct fp_img_dev *dev = ssm->priv;
struct libusb_transfer *transfer = libusb_alloc_transfer();
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
unsigned char *data;
int r;
......@@ -229,7 +229,7 @@ static void capture_iterate(struct fpi_ssm *ssm)
struct fp_img_dev *dev = ssm->priv;
struct v5s_dev *vdev = dev->priv;
int iteration = vdev->capture_iteration;
struct libusb_transfer *transfer = libusb_alloc_transfer();
struct libusb_transfer *transfer = libusb_alloc_transfer(0);
int r;
if (!transfer) {
......
......@@ -228,7 +228,7 @@ API_EXPORTED int fp_handle_events_timeout(struct timeval *timeout)
select_timeout = *timeout;
}
r = libusb_poll_timeout(&select_timeout);
r = libusb_handle_events_timeout(&select_timeout);
*timeout = select_timeout;
if (r < 0)
return r;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment