@@ -102,10 +102,8 @@ static int aml_rtc_read_time(struct device *dev, struct rtc_time *tm)
102
102
u32 time_sec ;
103
103
104
104
/* if RTC disabled, read time failed */
105
- if (!rtc -> rtc_enabled ) {
106
- dev_err (dev , "RTC disabled, read time failed\n" );
105
+ if (!rtc -> rtc_enabled )
107
106
return - EINVAL ;
108
- }
109
107
110
108
regmap_read (rtc -> map , RTC_REAL_TIME , & time_sec );
111
109
if (rtc -> config -> gray_stored )
@@ -145,10 +143,8 @@ static int aml_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alarm)
145
143
time64_t alarm_sec ;
146
144
147
145
/* if RTC disabled, set alarm failed */
148
- if (!rtc -> rtc_enabled ) {
149
- dev_err (dev , "RTC disabled, set alarm failed\n" );
146
+ if (!rtc -> rtc_enabled )
150
147
return - EINVAL ;
151
- }
152
148
153
149
regmap_update_bits (rtc -> map , RTC_CTRL ,
154
150
RTC_ALRM0_EN , RTC_ALRM0_EN );
@@ -174,10 +170,8 @@ static int aml_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alarm)
174
170
int alarm_mask ;
175
171
176
172
/* if RTC disabled, read alarm failed */
177
- if (!rtc -> rtc_enabled ) {
178
- dev_err (dev , "RTC disabled, read alarm failed\n" );
173
+ if (!rtc -> rtc_enabled )
179
174
return - EINVAL ;
180
- }
181
175
182
176
regmap_read (rtc -> map , RTC_ALARM0_REG , & alarm_sec );
183
177
if (rtc -> config -> gray_stored )
@@ -201,10 +195,8 @@ static int aml_rtc_read_offset(struct device *dev, long *offset)
201
195
int sign , match_counter , enable ;
202
196
203
197
/* if RTC disabled, read offset failed */
204
- if (!rtc -> rtc_enabled ) {
205
- dev_err (dev , "RTC disabled, read offset failed\n" );
198
+ if (!rtc -> rtc_enabled )
206
199
return - EINVAL ;
207
- }
208
200
209
201
regmap_read (rtc -> map , RTC_SEC_ADJUST_REG , & reg_val );
210
202
enable = FIELD_GET (RTC_ADJ_VALID , reg_val );
@@ -231,10 +223,8 @@ static int aml_rtc_set_offset(struct device *dev, long offset)
231
223
u32 reg_val ;
232
224
233
225
/* if RTC disabled, set offset failed */
234
- if (!rtc -> rtc_enabled ) {
235
- dev_err (dev , "RTC disabled, set offset failed\n" );
226
+ if (!rtc -> rtc_enabled )
236
227
return - EINVAL ;
237
- }
238
228
239
229
if (offset ) {
240
230
enable = 1 ;
0 commit comments