aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/sh
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/sh')
-rw-r--r--sound/soc/sh/fsi.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c
index 1693be477f7a..e551ca45f03e 100644
--- a/sound/soc/sh/fsi.c
+++ b/sound/soc/sh/fsi.c
@@ -161,24 +161,30 @@ static void __fsi_reg_mask_set(u32 reg, u32 mask, u32 data)
161 161
162static void fsi_reg_write(struct fsi_priv *fsi, u32 reg, u32 data) 162static void fsi_reg_write(struct fsi_priv *fsi, u32 reg, u32 data)
163{ 163{
164 if (reg > REG_END) 164 if (reg > REG_END) {
165 pr_err("fsi: register access err (%s)\n", __func__);
165 return; 166 return;
167 }
166 168
167 __fsi_reg_write((u32)(fsi->base + reg), data); 169 __fsi_reg_write((u32)(fsi->base + reg), data);
168} 170}
169 171
170static u32 fsi_reg_read(struct fsi_priv *fsi, u32 reg) 172static u32 fsi_reg_read(struct fsi_priv *fsi, u32 reg)
171{ 173{
172 if (reg > REG_END) 174 if (reg > REG_END) {
175 pr_err("fsi: register access err (%s)\n", __func__);
173 return 0; 176 return 0;
177 }
174 178
175 return __fsi_reg_read((u32)(fsi->base + reg)); 179 return __fsi_reg_read((u32)(fsi->base + reg));
176} 180}
177 181
178static void fsi_reg_mask_set(struct fsi_priv *fsi, u32 reg, u32 mask, u32 data) 182static void fsi_reg_mask_set(struct fsi_priv *fsi, u32 reg, u32 mask, u32 data)
179{ 183{
180 if (reg > REG_END) 184 if (reg > REG_END) {
185 pr_err("fsi: register access err (%s)\n", __func__);
181 return; 186 return;
187 }
182 188
183 __fsi_reg_mask_set((u32)(fsi->base + reg), mask, data); 189 __fsi_reg_mask_set((u32)(fsi->base + reg), mask, data);
184} 190}
@@ -188,8 +194,10 @@ static void fsi_master_write(struct fsi_master *master, u32 reg, u32 data)
188 unsigned long flags; 194 unsigned long flags;
189 195
190 if ((reg < MREG_START) || 196 if ((reg < MREG_START) ||
191 (reg > MREG_END)) 197 (reg > MREG_END)) {
198 pr_err("fsi: register access err (%s)\n", __func__);
192 return; 199 return;
200 }
193 201
194 spin_lock_irqsave(&master->lock, flags); 202 spin_lock_irqsave(&master->lock, flags);
195 __fsi_reg_write((u32)(master->base + reg), data); 203 __fsi_reg_write((u32)(master->base + reg), data);
@@ -202,8 +210,10 @@ static u32 fsi_master_read(struct fsi_master *master, u32 reg)
202 unsigned long flags; 210 unsigned long flags;
203 211
204 if ((reg < MREG_START) || 212 if ((reg < MREG_START) ||
205 (reg > MREG_END)) 213 (reg > MREG_END)) {
214 pr_err("fsi: register access err (%s)\n", __func__);
206 return 0; 215 return 0;
216 }
207 217
208 spin_lock_irqsave(&master->lock, flags); 218 spin_lock_irqsave(&master->lock, flags);
209 ret = __fsi_reg_read((u32)(master->base + reg)); 219 ret = __fsi_reg_read((u32)(master->base + reg));
@@ -218,8 +228,10 @@ static void fsi_master_mask_set(struct fsi_master *master,
218 unsigned long flags; 228 unsigned long flags;
219 229
220 if ((reg < MREG_START) || 230 if ((reg < MREG_START) ||
221 (reg > MREG_END)) 231 (reg > MREG_END)) {
232 pr_err("fsi: register access err (%s)\n", __func__);
222 return; 233 return;
234 }
223 235
224 spin_lock_irqsave(&master->lock, flags); 236 spin_lock_irqsave(&master->lock, flags);
225 __fsi_reg_mask_set((u32)(master->base + reg), mask, data); 237 __fsi_reg_mask_set((u32)(master->base + reg), mask, data);