--- zzzz-none-000/linux-3.10.107/sound/pci/ctxfi/ctsrc.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/sound/pci/ctxfi/ctsrc.c 2021-02-04 17:41:59.000000000 +0000 @@ -335,7 +335,7 @@ return 0; } -static struct src_rsc_ops src_rsc_ops = { +static const struct src_rsc_ops src_rsc_ops = { .set_state = src_set_state, .set_bm = src_set_bm, .set_sf = src_set_sf, @@ -431,7 +431,8 @@ spin_unlock_irqrestore(&mgr->mgr_lock, flags); if (err) { - printk(KERN_ERR "ctxfi: Can't meet SRC resource request!\n"); + dev_err(mgr->card->dev, + "Can't meet SRC resource request!\n"); return err; } @@ -543,7 +544,7 @@ return 0; } -int src_mgr_create(void *hw, struct src_mgr **rsrc_mgr) +int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr) { int err, i; struct src_mgr *src_mgr; @@ -558,7 +559,7 @@ goto error1; spin_lock_init(&src_mgr->mgr_lock); - conj_mask = ((struct hw *)hw)->src_dirty_conj_mask(); + conj_mask = hw->src_dirty_conj_mask(); src_mgr->get_src = get_src_rsc; src_mgr->put_src = put_src_rsc; @@ -566,12 +567,13 @@ src_mgr->src_enable = src_enable; src_mgr->src_disable = src_disable; src_mgr->commit_write = src_mgr_commit_write; + src_mgr->card = hw->card; /* Disable all SRC resources. */ for (i = 0; i < 256; i++) - ((struct hw *)hw)->src_mgr_dsb_src(src_mgr->mgr.ctrl_blk, i); + hw->src_mgr_dsb_src(src_mgr->mgr.ctrl_blk, i); - ((struct hw *)hw)->src_mgr_commit_write(hw, src_mgr->mgr.ctrl_blk); + hw->src_mgr_commit_write(hw, src_mgr->mgr.ctrl_blk); *rsrc_mgr = src_mgr; @@ -609,7 +611,7 @@ return container_of(rsc, struct srcimp, rsc)->idx[rsc->conj]; } -static struct rsc_ops srcimp_basic_rsc_ops = { +static const struct rsc_ops srcimp_basic_rsc_ops = { .master = srcimp_master, .next_conj = srcimp_next_conj, .index = srcimp_index, @@ -660,7 +662,7 @@ return 0; } -static struct srcimp_rsc_ops srcimp_ops = { +static const struct srcimp_rsc_ops srcimp_ops = { .map = srcimp_map, .unmap = srcimp_unmap }; @@ -739,7 +741,8 @@ } spin_unlock_irqrestore(&mgr->mgr_lock, flags); if (err) { - printk(KERN_ERR "ctxfi: Can't meet SRCIMP resource request!\n"); + dev_err(mgr->card->dev, + "Can't meet SRCIMP resource request!\n"); goto error1; } @@ -825,7 +828,7 @@ return err; } -int srcimp_mgr_create(void *hw, struct srcimp_mgr **rsrcimp_mgr) +int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrcimp_mgr) { int err; struct srcimp_mgr *srcimp_mgr; @@ -857,6 +860,7 @@ srcimp_mgr->put_srcimp = put_srcimp_rsc; srcimp_mgr->imap_add = srcimp_imap_add; srcimp_mgr->imap_delete = srcimp_imap_delete; + srcimp_mgr->card = hw->card; *rsrcimp_mgr = srcimp_mgr;