Skip to content

Commit

Permalink
Merge pull request #7244 from smlng/drivers/jc42/fix_const
Browse files Browse the repository at this point in the history
drivers, jc42: fix constness in jc42_init
  • Loading branch information
aabadie committed Jun 26, 2017
2 parents e4cc780 + 5fa123c commit 45e4690
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/include/jc42.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ extern const saul_driver_t jc42_temperature_saul_driver;
* @return 0 on success
* @return -1 on error
*/
int jc42_init(jc42_t* dev, jc42_params_t* params);
int jc42_init(jc42_t* dev, const jc42_params_t* params);

/**
* @brief Get content of configuration register
Expand Down
2 changes: 1 addition & 1 deletion drivers/jc42/jc42.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int jc42_get_temperature(const jc42_t* dev, int16_t* temperature)
return JC42_OK;
}

int jc42_init(jc42_t* dev, jc42_params_t* params)
int jc42_init(jc42_t* dev, const jc42_params_t* params)
{
uint16_t config;
dev->i2c = params->i2c;
Expand Down
4 changes: 1 addition & 3 deletions sys/auto_init/saul/auto_init_jc42.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ extern const saul_driver_t jc42_temperature_saul_driver;
void auto_init_jc42(void)
{
for (unsigned i = 0; i < JC42_NUMOF; i++) {
const jc42_params_t *p = &jc42_params[i];

LOG_DEBUG("[auto_init_saul] initializing jc42 #%u\n", i);

if (jc42_init(&jc42_devs[i], (jc42_params_t*) p) < 0) {
if (jc42_init(&jc42_devs[i], &jc42_params[i]) < 0) {
LOG_ERROR("[auto_init_saul] error initializing jc42 #%u\n", i);
continue;
}
Expand Down

0 comments on commit 45e4690

Please sign in to comment.