diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2014-09-29 05:03:21 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-09-30 04:34:29 -0400 |
commit | 66640898edb7b0ef452e179753e8d6130b35fd83 (patch) | |
tree | a920c67eb3cb63e5081672d6bce8ab72c02d26ce | |
parent | 7a7686bd0d153c0d6e120da6712c9339aaeaa2f9 (diff) |
ALSA: ctxfi: changed void * to struct hw *
in the code we have void *hw and while using we are always typecasting
it to (struct hw *). it is better to use void type of pointer when we
store different types of pointer , but in this code we are only having
struct hw.
So changed all the relevant reference of void *hw to struct hw *hw,
without any modification of the existing code logic.
the next patch of the series will remove the typecasting which is
not required now.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/ctxfi/ctamixer.c | 4 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctamixer.h | 4 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctatc.c | 4 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctatc.h | 2 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctdaio.c | 4 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctdaio.h | 6 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctresource.c | 5 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctresource.h | 9 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctsrc.c | 4 | ||||
-rw-r--r-- | sound/pci/ctxfi/ctsrc.h | 4 |
10 files changed, 24 insertions, 22 deletions
diff --git a/sound/pci/ctxfi/ctamixer.c b/sound/pci/ctxfi/ctamixer.c index fed6e6a57608..4671cbe7b397 100644 --- a/sound/pci/ctxfi/ctamixer.c +++ b/sound/pci/ctxfi/ctamixer.c | |||
@@ -296,7 +296,7 @@ static int put_amixer_rsc(struct amixer_mgr *mgr, struct amixer *amixer) | |||
296 | return 0; | 296 | return 0; |
297 | } | 297 | } |
298 | 298 | ||
299 | int amixer_mgr_create(void *hw, struct amixer_mgr **ramixer_mgr) | 299 | int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr) |
300 | { | 300 | { |
301 | int err; | 301 | int err; |
302 | struct amixer_mgr *amixer_mgr; | 302 | struct amixer_mgr *amixer_mgr; |
@@ -449,7 +449,7 @@ static int put_sum_rsc(struct sum_mgr *mgr, struct sum *sum) | |||
449 | return 0; | 449 | return 0; |
450 | } | 450 | } |
451 | 451 | ||
452 | int sum_mgr_create(void *hw, struct sum_mgr **rsum_mgr) | 452 | int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr) |
453 | { | 453 | { |
454 | int err; | 454 | int err; |
455 | struct sum_mgr *sum_mgr; | 455 | struct sum_mgr *sum_mgr; |
diff --git a/sound/pci/ctxfi/ctamixer.h b/sound/pci/ctxfi/ctamixer.h index cc49e5ab4750..6fa5eff7b89d 100644 --- a/sound/pci/ctxfi/ctamixer.h +++ b/sound/pci/ctxfi/ctamixer.h | |||
@@ -45,7 +45,7 @@ struct sum_mgr { | |||
45 | }; | 45 | }; |
46 | 46 | ||
47 | /* Constructor and destructor of daio resource manager */ | 47 | /* Constructor and destructor of daio resource manager */ |
48 | int sum_mgr_create(void *hw, struct sum_mgr **rsum_mgr); | 48 | int sum_mgr_create(struct hw *hw, struct sum_mgr **rsum_mgr); |
49 | int sum_mgr_destroy(struct sum_mgr *sum_mgr); | 49 | int sum_mgr_destroy(struct sum_mgr *sum_mgr); |
50 | 50 | ||
51 | /* Define the descriptor of a amixer resource */ | 51 | /* Define the descriptor of a amixer resource */ |
@@ -90,7 +90,7 @@ struct amixer_mgr { | |||
90 | }; | 90 | }; |
91 | 91 | ||
92 | /* Constructor and destructor of amixer resource manager */ | 92 | /* Constructor and destructor of amixer resource manager */ |
93 | int amixer_mgr_create(void *hw, struct amixer_mgr **ramixer_mgr); | 93 | int amixer_mgr_create(struct hw *hw, struct amixer_mgr **ramixer_mgr); |
94 | int amixer_mgr_destroy(struct amixer_mgr *amixer_mgr); | 94 | int amixer_mgr_destroy(struct amixer_mgr *amixer_mgr); |
95 | 95 | ||
96 | #endif /* CTAMIXER_H */ | 96 | #endif /* CTAMIXER_H */ |
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index d92a08c7a39c..04e54ccf5120 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c | |||
@@ -106,11 +106,11 @@ static struct { | |||
106 | .public_name = "Mixer"} | 106 | .public_name = "Mixer"} |
107 | }; | 107 | }; |
108 | 108 | ||
109 | typedef int (*create_t)(void *, void **); | 109 | typedef int (*create_t)(struct hw *, void **); |
110 | typedef int (*destroy_t)(void *); | 110 | typedef int (*destroy_t)(void *); |
111 | 111 | ||
112 | static struct { | 112 | static struct { |
113 | int (*create)(void *hw, void **rmgr); | 113 | int (*create)(struct hw *hw, void **rmgr); |
114 | int (*destroy)(void *mgr); | 114 | int (*destroy)(void *mgr); |
115 | } rsc_mgr_funcs[NUM_RSCTYP] = { | 115 | } rsc_mgr_funcs[NUM_RSCTYP] = { |
116 | [SRC] = { .create = (create_t)src_mgr_create, | 116 | [SRC] = { .create = (create_t)src_mgr_create, |
diff --git a/sound/pci/ctxfi/ctatc.h b/sound/pci/ctxfi/ctatc.h index 5f11ca22fcde..56413343a9e8 100644 --- a/sound/pci/ctxfi/ctatc.h +++ b/sound/pci/ctxfi/ctatc.h | |||
@@ -131,7 +131,7 @@ struct ct_atc { | |||
131 | /* Don't touch! Used for internal object. */ | 131 | /* Don't touch! Used for internal object. */ |
132 | void *rsc_mgrs[NUM_RSCTYP]; /* chip resource managers */ | 132 | void *rsc_mgrs[NUM_RSCTYP]; /* chip resource managers */ |
133 | void *mixer; /* internal mixer object */ | 133 | void *mixer; /* internal mixer object */ |
134 | void *hw; /* chip specific hardware access object */ | 134 | struct hw *hw; /* chip specific hardware access object */ |
135 | void **daios; /* digital audio io resources */ | 135 | void **daios; /* digital audio io resources */ |
136 | void **pcm; /* SUMs for collecting all pcm stream */ | 136 | void **pcm; /* SUMs for collecting all pcm stream */ |
137 | void **srcs; /* Sample Rate Converters for input signal */ | 137 | void **srcs; /* Sample Rate Converters for input signal */ |
diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c index 6f0654ea3630..75416410fb0b 100644 --- a/sound/pci/ctxfi/ctdaio.c +++ b/sound/pci/ctxfi/ctdaio.c | |||
@@ -331,7 +331,7 @@ static struct dai_rsc_ops dai_ops = { | |||
331 | 331 | ||
332 | static int daio_rsc_init(struct daio *daio, | 332 | static int daio_rsc_init(struct daio *daio, |
333 | const struct daio_desc *desc, | 333 | const struct daio_desc *desc, |
334 | void *hw) | 334 | struct hw *hw) |
335 | { | 335 | { |
336 | int err; | 336 | int err; |
337 | unsigned int idx_l, idx_r; | 337 | unsigned int idx_l, idx_r; |
@@ -692,7 +692,7 @@ static int daio_mgr_commit_write(struct daio_mgr *mgr) | |||
692 | return 0; | 692 | return 0; |
693 | } | 693 | } |
694 | 694 | ||
695 | int daio_mgr_create(void *hw, struct daio_mgr **rdaio_mgr) | 695 | int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr) |
696 | { | 696 | { |
697 | int err, i; | 697 | int err, i; |
698 | struct daio_mgr *daio_mgr; | 698 | struct daio_mgr *daio_mgr; |
diff --git a/sound/pci/ctxfi/ctdaio.h b/sound/pci/ctxfi/ctdaio.h index 85ccb6ee1ab4..e4817de08864 100644 --- a/sound/pci/ctxfi/ctdaio.h +++ b/sound/pci/ctxfi/ctdaio.h | |||
@@ -53,14 +53,14 @@ struct dao { | |||
53 | struct dao_rsc_ops *ops; /* DAO specific operations */ | 53 | struct dao_rsc_ops *ops; /* DAO specific operations */ |
54 | struct imapper **imappers; | 54 | struct imapper **imappers; |
55 | struct daio_mgr *mgr; | 55 | struct daio_mgr *mgr; |
56 | void *hw; | 56 | struct hw *hw; |
57 | void *ctrl_blk; | 57 | void *ctrl_blk; |
58 | }; | 58 | }; |
59 | 59 | ||
60 | struct dai { | 60 | struct dai { |
61 | struct daio daio; | 61 | struct daio daio; |
62 | struct dai_rsc_ops *ops; /* DAI specific operations */ | 62 | struct dai_rsc_ops *ops; /* DAI specific operations */ |
63 | void *hw; | 63 | struct hw *hw; |
64 | void *ctrl_blk; | 64 | void *ctrl_blk; |
65 | }; | 65 | }; |
66 | 66 | ||
@@ -117,7 +117,7 @@ struct daio_mgr { | |||
117 | }; | 117 | }; |
118 | 118 | ||
119 | /* Constructor and destructor of daio resource manager */ | 119 | /* Constructor and destructor of daio resource manager */ |
120 | int daio_mgr_create(void *hw, struct daio_mgr **rdaio_mgr); | 120 | int daio_mgr_create(struct hw *hw, struct daio_mgr **rdaio_mgr); |
121 | int daio_mgr_destroy(struct daio_mgr *daio_mgr); | 121 | int daio_mgr_destroy(struct daio_mgr *daio_mgr); |
122 | 122 | ||
123 | #endif /* CTDAIO_H */ | 123 | #endif /* CTDAIO_H */ |
diff --git a/sound/pci/ctxfi/ctresource.c b/sound/pci/ctxfi/ctresource.c index e49d2be1bfd4..f14cbea433b2 100644 --- a/sound/pci/ctxfi/ctresource.c +++ b/sound/pci/ctxfi/ctresource.c | |||
@@ -134,7 +134,8 @@ static struct rsc_ops rsc_generic_ops = { | |||
134 | .next_conj = rsc_next_conj, | 134 | .next_conj = rsc_next_conj, |
135 | }; | 135 | }; |
136 | 136 | ||
137 | int rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, void *hw) | 137 | int |
138 | rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, struct hw *hw) | ||
138 | { | 139 | { |
139 | int err = 0; | 140 | int err = 0; |
140 | 141 | ||
@@ -206,7 +207,7 @@ int rsc_uninit(struct rsc *rsc) | |||
206 | } | 207 | } |
207 | 208 | ||
208 | int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, | 209 | int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, |
209 | unsigned int amount, void *hw_obj) | 210 | unsigned int amount, struct hw *hw_obj) |
210 | { | 211 | { |
211 | int err = 0; | 212 | int err = 0; |
212 | struct hw *hw = hw_obj; | 213 | struct hw *hw = hw_obj; |
diff --git a/sound/pci/ctxfi/ctresource.h b/sound/pci/ctxfi/ctresource.h index 0838c2e84f8b..9b746c3719e6 100644 --- a/sound/pci/ctxfi/ctresource.h +++ b/sound/pci/ctxfi/ctresource.h | |||
@@ -38,7 +38,7 @@ struct rsc { | |||
38 | u32 conj:12; /* Current conjugate index */ | 38 | u32 conj:12; /* Current conjugate index */ |
39 | u32 msr:4; /* The Master Sample Rate a resource working on */ | 39 | u32 msr:4; /* The Master Sample Rate a resource working on */ |
40 | void *ctrl_blk; /* Chip specific control info block for a resource */ | 40 | void *ctrl_blk; /* Chip specific control info block for a resource */ |
41 | void *hw; /* Chip specific object for hardware access means */ | 41 | struct hw *hw; /* Chip specific object for hardware access means */ |
42 | struct rsc_ops *ops; /* Generic resource operations */ | 42 | struct rsc_ops *ops; /* Generic resource operations */ |
43 | }; | 43 | }; |
44 | 44 | ||
@@ -50,7 +50,8 @@ struct rsc_ops { | |||
50 | int (*output_slot)(const struct rsc *rsc); | 50 | int (*output_slot)(const struct rsc *rsc); |
51 | }; | 51 | }; |
52 | 52 | ||
53 | int rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, void *hw); | 53 | int |
54 | rsc_init(struct rsc *rsc, u32 idx, enum RSCTYP type, u32 msr, struct hw *hw); | ||
54 | int rsc_uninit(struct rsc *rsc); | 55 | int rsc_uninit(struct rsc *rsc); |
55 | 56 | ||
56 | struct rsc_mgr { | 57 | struct rsc_mgr { |
@@ -59,12 +60,12 @@ struct rsc_mgr { | |||
59 | unsigned int avail; /* The amount of currently available resources */ | 60 | unsigned int avail; /* The amount of currently available resources */ |
60 | unsigned char *rscs; /* The bit-map for resource allocation */ | 61 | unsigned char *rscs; /* The bit-map for resource allocation */ |
61 | void *ctrl_blk; /* Chip specific control info block */ | 62 | void *ctrl_blk; /* Chip specific control info block */ |
62 | void *hw; /* Chip specific object for hardware access */ | 63 | struct hw *hw; /* Chip specific object for hardware access */ |
63 | }; | 64 | }; |
64 | 65 | ||
65 | /* Resource management is based on bit-map mechanism */ | 66 | /* Resource management is based on bit-map mechanism */ |
66 | int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, | 67 | int rsc_mgr_init(struct rsc_mgr *mgr, enum RSCTYP type, |
67 | unsigned int amount, void *hw); | 68 | unsigned int amount, struct hw *hw); |
68 | int rsc_mgr_uninit(struct rsc_mgr *mgr); | 69 | int rsc_mgr_uninit(struct rsc_mgr *mgr); |
69 | int mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx); | 70 | int mgr_get_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int *ridx); |
70 | int mgr_put_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int idx); | 71 | int mgr_put_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int idx); |
diff --git a/sound/pci/ctxfi/ctsrc.c b/sound/pci/ctxfi/ctsrc.c index 19df9b4ed800..342008f81f23 100644 --- a/sound/pci/ctxfi/ctsrc.c +++ b/sound/pci/ctxfi/ctsrc.c | |||
@@ -543,7 +543,7 @@ static int src_mgr_commit_write(struct src_mgr *mgr) | |||
543 | return 0; | 543 | return 0; |
544 | } | 544 | } |
545 | 545 | ||
546 | int src_mgr_create(void *hw, struct src_mgr **rsrc_mgr) | 546 | int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr) |
547 | { | 547 | { |
548 | int err, i; | 548 | int err, i; |
549 | struct src_mgr *src_mgr; | 549 | struct src_mgr *src_mgr; |
@@ -825,7 +825,7 @@ static int srcimp_imap_delete(struct srcimp_mgr *mgr, struct imapper *entry) | |||
825 | return err; | 825 | return err; |
826 | } | 826 | } |
827 | 827 | ||
828 | int srcimp_mgr_create(void *hw, struct srcimp_mgr **rsrcimp_mgr) | 828 | int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrcimp_mgr) |
829 | { | 829 | { |
830 | int err; | 830 | int err; |
831 | struct srcimp_mgr *srcimp_mgr; | 831 | struct srcimp_mgr *srcimp_mgr; |
diff --git a/sound/pci/ctxfi/ctsrc.h b/sound/pci/ctxfi/ctsrc.h index 259366aabcac..6d95afbbc852 100644 --- a/sound/pci/ctxfi/ctsrc.h +++ b/sound/pci/ctxfi/ctsrc.h | |||
@@ -140,10 +140,10 @@ struct srcimp_mgr { | |||
140 | }; | 140 | }; |
141 | 141 | ||
142 | /* Constructor and destructor of SRC resource manager */ | 142 | /* Constructor and destructor of SRC resource manager */ |
143 | int src_mgr_create(void *hw, struct src_mgr **rsrc_mgr); | 143 | int src_mgr_create(struct hw *hw, struct src_mgr **rsrc_mgr); |
144 | int src_mgr_destroy(struct src_mgr *src_mgr); | 144 | int src_mgr_destroy(struct src_mgr *src_mgr); |
145 | /* Constructor and destructor of SRCIMP resource manager */ | 145 | /* Constructor and destructor of SRCIMP resource manager */ |
146 | int srcimp_mgr_create(void *hw, struct srcimp_mgr **rsrc_mgr); | 146 | int srcimp_mgr_create(struct hw *hw, struct srcimp_mgr **rsrc_mgr); |
147 | int srcimp_mgr_destroy(struct srcimp_mgr *srcimp_mgr); | 147 | int srcimp_mgr_destroy(struct srcimp_mgr *srcimp_mgr); |
148 | 148 | ||
149 | #endif /* CTSRC_H */ | 149 | #endif /* CTSRC_H */ |