@@ -267,10 +267,8 @@ static void rockchip_snd_xfer_sync_reset(struct rk_i2s_tdm_dev *i2s_tdm)
267267
268268 tx_id = i2s_tdm -> tx_reset_id ;
269269 rx_id = i2s_tdm -> rx_reset_id ;
270- if (tx_id < 0 || rx_id < 0 ) {
271- dev_err (i2s_tdm -> dev , "invalid reset id\n" );
270+ if (tx_id < 0 || rx_id < 0 )
272271 return ;
273- }
274272
275273 tx_bank = tx_id / 16 ;
276274 tx_offset = tx_id % 16 ;
@@ -355,6 +353,16 @@ static void rockchip_snd_txrxctrl(struct snd_pcm_substream *substream,
355353 spin_unlock (& i2s_tdm -> lock );
356354}
357355
356+ static void rockchip_snd_reset (struct reset_control * rc )
357+ {
358+ if (IS_ERR (rc ))
359+ return ;
360+
361+ reset_control_assert (rc );
362+ udelay (1 );
363+ reset_control_deassert (rc );
364+ }
365+
358366static void rockchip_snd_txctrl (struct rk_i2s_tdm_dev * i2s_tdm , int on )
359367{
360368 unsigned int val = 0 ;
@@ -388,9 +396,7 @@ static void rockchip_snd_txctrl(struct rk_i2s_tdm_dev *i2s_tdm, int on)
388396 retry -- ;
389397 if (!retry ) {
390398 dev_warn (i2s_tdm -> dev , "reset tx\n" );
391- reset_control_assert (i2s_tdm -> tx_reset );
392- udelay (1 );
393- reset_control_deassert (i2s_tdm -> tx_reset );
399+ rockchip_snd_reset (i2s_tdm -> tx_reset );
394400 break ;
395401 }
396402 }
@@ -430,9 +436,7 @@ static void rockchip_snd_rxctrl(struct rk_i2s_tdm_dev *i2s_tdm, int on)
430436 retry -- ;
431437 if (!retry ) {
432438 dev_warn (i2s_tdm -> dev , "reset rx\n" );
433- reset_control_assert (i2s_tdm -> rx_reset );
434- udelay (1 );
435- reset_control_deassert (i2s_tdm -> rx_reset );
439+ rockchip_snd_reset (i2s_tdm -> rx_reset );
436440 break ;
437441 }
438442 }
@@ -1497,11 +1501,7 @@ static int rockchip_i2s_tdm_probe(struct platform_device *pdev)
14971501 return - ENOENT ;
14981502
14991503 i2s_tdm -> tx_reset_id = of_i2s_resetid_get (node , "tx-m" );
1500- if (i2s_tdm -> tx_reset_id < 0 )
1501- return - EINVAL ;
15021504 i2s_tdm -> rx_reset_id = of_i2s_resetid_get (node , "rx-m" );
1503- if (i2s_tdm -> rx_reset_id < 0 )
1504- return - EINVAL ;
15051505 }
15061506
15071507 i2s_tdm -> tx_reset = devm_reset_control_get (& pdev -> dev , "tx-m" );
0 commit comments