struct iio_prtc_trigger_info {
struct rtc_device *rtc;
- int frequency;
+ unsigned int frequency;
struct rtc_task task;
bool state;
};
if (trig_info->frequency == 0 && state)
return -EINVAL;
- dev_dbg(&trig_info->rtc->dev, "trigger frequency is %d\n",
+ dev_dbg(&trig_info->rtc->dev, "trigger frequency is %u\n",
trig_info->frequency);
ret = rtc_irq_set_state(trig_info->rtc, &trig_info->task, state);
if (ret == 0)
{
struct iio_trigger *trig = to_iio_trigger(dev);
struct iio_prtc_trigger_info *trig_info = iio_trigger_get_drvdata(trig);
- int val;
+ unsigned int val;
int ret;
- ret = kstrtoint(buf, 10, &val);
+ ret = kstrtouint(buf, 10, &val);
if (ret)
goto error_ret;
if (ret == 0 && trig_info->state && trig_info->frequency == 0)
ret = rtc_irq_set_state(trig_info->rtc,
&trig_info->task, 1);
- } else if (val == 0) {
- ret = rtc_irq_set_state(trig_info->rtc, &trig_info->task, 0);
} else
- ret = -EINVAL;
+ ret = rtc_irq_set_state(trig_info->rtc, &trig_info->task, 0);
if (ret)
goto error_ret;