Skip to content
Snippets Groups Projects
Commit 6f8f0bb5 authored by Federico Vaga's avatar Federico Vaga
Browse files

device: incompatible change in return value of I/O methods.


(input|output)_cset change returned value:
* 0 if the acquisition is already done
* -EAGAIN if the acquisition will be completed in the future (must use
  data_done)
* Other error code if needed

Signed-off-by: default avatarFederico Vaga <federico.vaga@gmail.com>
Acked-by: default avatarAlessandro Rubini <rubini@gnudd.com>
parent caf5eb91
Branches
Tags
No related merge requests found
......@@ -43,13 +43,13 @@ static int zzero_input(struct zio_cset *cset)
data[i] = datum++;
}
}
return 1; /* Already done */
return 0; /* Already done */
}
static int zzero_output(struct zio_cset *cset)
{
/* We just eat data, like /dev/zero and /dev/null */
return 1; /* Already done */
return 0; /* Already done */
}
static const struct zio_device_operations zzero_d_op = {
......
......@@ -200,7 +200,7 @@ static void __zio_fire_input_trigger(struct zio_ti *ti)
}
chan->active_block = block;
}
if (zdev->d_op->input_cset(cset)) {
if (!zdev->d_op->input_cset(cset)) {
/* It succeeded immediately */
ti->t_op->data_done(cset);
}
......@@ -214,7 +214,7 @@ static void __zio_fire_output_trigger(struct zio_ti *ti)
pr_debug("%s:%d\n", __func__, __LINE__);
/* We are expected to already have a block in active channels */
if (zdev->d_op->output_cset(cset)) {
if (!zdev->d_op->output_cset(cset)) {
/* It succeeded immediately */
ti->t_op->data_done(cset);
}
......
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