Skip to content

Commit

Permalink
Merge pull request osmocom#20 from lcl7/correct-e4k_reg_write
Browse files Browse the repository at this point in the history
Correct return code of e4k_reg_write().
  • Loading branch information
steve-m committed May 15, 2015
2 parents 92df068 + c5dc459 commit 8b4d755
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tuner_e4k.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ static const uint8_t width2mask[] = {
*/
static int e4k_reg_write(struct e4k_state *e4k, uint8_t reg, uint8_t val)
{
int r;
uint8_t data[2];
data[0] = reg;
data[1] = val;

return rtlsdr_i2c_write_fn(e4k->rtl_dev, e4k->i2c_addr, data, 2);
r = rtlsdr_i2c_write_fn(e4k->rtl_dev, e4k->i2c_addr, data, 2);
return r == 2 ? 0 : -1;
}

/*! \brief Read a register of the tuner chip
Expand Down

0 comments on commit 8b4d755

Please sign in to comment.