Lines Matching refs:ret
70 int ret; in tps80031_rtc_read_time() local
72 ret = tps80031_reads(dev->parent, TPS80031_SLAVE_ID1, in tps80031_rtc_read_time()
74 if (ret < 0) { in tps80031_rtc_read_time()
75 dev_err(dev, "reading RTC_SECONDS_REG failed, err = %d\n", ret); in tps80031_rtc_read_time()
76 return ret; in tps80031_rtc_read_time()
92 int ret; in tps80031_rtc_set_time() local
103 ret = tps80031_clr_bits(dev->parent, TPS80031_SLAVE_ID1, in tps80031_rtc_set_time()
105 if (ret < 0) { in tps80031_rtc_set_time()
106 dev_err(dev->parent, "Stop RTC failed, err = %d\n", ret); in tps80031_rtc_set_time()
107 return ret; in tps80031_rtc_set_time()
110 ret = tps80031_writes(dev->parent, TPS80031_SLAVE_ID1, in tps80031_rtc_set_time()
113 if (ret < 0) { in tps80031_rtc_set_time()
114 dev_err(dev, "writing RTC_SECONDS_REG failed, err %d\n", ret); in tps80031_rtc_set_time()
115 return ret; in tps80031_rtc_set_time()
118 ret = tps80031_set_bits(dev->parent, TPS80031_SLAVE_ID1, in tps80031_rtc_set_time()
120 if (ret < 0) in tps80031_rtc_set_time()
121 dev_err(dev->parent, "Start RTC failed, err = %d\n", ret); in tps80031_rtc_set_time()
122 return ret; in tps80031_rtc_set_time()
128 int ret; in tps80031_rtc_alarm_irq_enable() local
131 ret = tps80031_set_bits(dev->parent, TPS80031_SLAVE_ID1, in tps80031_rtc_alarm_irq_enable()
134 ret = tps80031_clr_bits(dev->parent, TPS80031_SLAVE_ID1, in tps80031_rtc_alarm_irq_enable()
136 if (ret < 0) { in tps80031_rtc_alarm_irq_enable()
137 dev_err(dev, "Update on RTC_INT failed, err = %d\n", ret); in tps80031_rtc_alarm_irq_enable()
138 return ret; in tps80031_rtc_alarm_irq_enable()
146 int ret; in tps80031_rtc_set_alarm() local
154 ret = tps80031_writes(dev->parent, TPS80031_SLAVE_ID1, in tps80031_rtc_set_alarm()
157 if (ret < 0) { in tps80031_rtc_set_alarm()
158 dev_err(dev, "Writing RTC_ALARM failed, err %d\n", ret); in tps80031_rtc_set_alarm()
159 return ret; in tps80031_rtc_set_alarm()
167 int ret; in tps80031_rtc_read_alarm() local
169 ret = tps80031_reads(dev->parent, TPS80031_SLAVE_ID1, in tps80031_rtc_read_alarm()
172 if (ret < 0) { in tps80031_rtc_read_alarm()
174 "reading RTC_ALARM failed, err = %d\n", ret); in tps80031_rtc_read_alarm()
175 return ret; in tps80031_rtc_read_alarm()
189 int ret; in clear_alarm_int_status() local
197 ret = tps80031_read(dev->parent, TPS80031_SLAVE_ID1, in clear_alarm_int_status()
199 if (ret < 0) { in clear_alarm_int_status()
200 dev_err(dev, "reading RTC_STATUS failed. err = %d\n", ret); in clear_alarm_int_status()
201 return ret; in clear_alarm_int_status()
205 ret = tps80031_set_bits(dev->parent, TPS80031_SLAVE_ID1, in clear_alarm_int_status()
207 if (ret < 0) { in clear_alarm_int_status()
208 dev_err(dev, "clear Alarm INT failed, err = %d\n", ret); in clear_alarm_int_status()
209 return ret; in clear_alarm_int_status()
218 int ret; in tps80031_rtc_irq() local
220 ret = clear_alarm_int_status(dev, rtc); in tps80031_rtc_irq()
221 if (ret < 0) in tps80031_rtc_irq()
222 return ret; in tps80031_rtc_irq()
240 int ret; in tps80031_rtc_probe() local
250 ret = tps80031_set_bits(pdev->dev.parent, TPS80031_SLAVE_ID1, in tps80031_rtc_probe()
252 if (ret < 0) { in tps80031_rtc_probe()
253 dev_err(&pdev->dev, "failed to start RTC. err = %d\n", ret); in tps80031_rtc_probe()
254 return ret; in tps80031_rtc_probe()
265 ret = tps80031_rtc_set_time(&pdev->dev, &tm); in tps80031_rtc_probe()
266 if (ret < 0) { in tps80031_rtc_probe()
268 "RTC set time failed, err = %d\n", ret); in tps80031_rtc_probe()
269 return ret; in tps80031_rtc_probe()
274 ret = clear_alarm_int_status(&pdev->dev, rtc); in tps80031_rtc_probe()
275 if (ret < 0) { in tps80031_rtc_probe()
276 dev_err(&pdev->dev, "Clear alarm int failed, err = %d\n", ret); in tps80031_rtc_probe()
277 return ret; in tps80031_rtc_probe()
283 ret = PTR_ERR(rtc->rtc); in tps80031_rtc_probe()
284 dev_err(&pdev->dev, "RTC registration failed, err %d\n", ret); in tps80031_rtc_probe()
285 return ret; in tps80031_rtc_probe()
288 ret = devm_request_threaded_irq(&pdev->dev, rtc->irq, NULL, in tps80031_rtc_probe()
292 if (ret < 0) { in tps80031_rtc_probe()
294 rtc->irq, ret); in tps80031_rtc_probe()
295 return ret; in tps80031_rtc_probe()