Skip to content

Instantly share code, notes, and snippets.

@scottellis
Created November 25, 2010 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottellis/715716 to your computer and use it in GitHub Desktop.
Save scottellis/715716 to your computer and use it in GitHub Desktop.
spike_do_one_message
static int spike_do_one_message(void)
{
int status;
if (down_interruptible(&spike_dev.spi_sem))
return -ERESTARTSYS;
if (!spike_dev.spi_device) {
up(&spike_dev.spi_sem);
return -ENODEV;
}
spike_prepare_spi_message();
/* this will put us to sleep until the transfers are complete */
status = spi_sync(spike_dev.spi_device, &spike_ctl.msg);
up(&spike_dev.spi_sem);
return status;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment