diff options
author | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2012-03-08 19:03:43 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-09 16:21:07 -0500 |
commit | 9658a54dfa86b0c0df7704c8f4315d6e89e95c69 (patch) | |
tree | 700aaad49ca99c9a14f7f68acc229d52c230758b /drivers/staging/tidspbridge | |
parent | 974f9cd50ae72c02490298372a2a64fb47c4de91 (diff) |
staging: tidspbridge: remove chnl_init() and chnl_exit()
The chnl module has a chnl_init() and a chnl_exit() whose only purpose
is to keep a reference counting which is not used at all.
This patch removes these functions and the reference count variable.
There is no functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/tidspbridge')
-rw-r--r-- | drivers/staging/tidspbridge/include/dspbridge/chnl.h | 29 | ||||
-rw-r--r-- | drivers/staging/tidspbridge/pmgr/chnl.c | 28 | ||||
-rw-r--r-- | drivers/staging/tidspbridge/pmgr/dspapi.c | 9 |
3 files changed, 2 insertions, 64 deletions
diff --git a/drivers/staging/tidspbridge/include/dspbridge/chnl.h b/drivers/staging/tidspbridge/include/dspbridge/chnl.h index 92f6a13424f..9b018b1f9bf 100644 --- a/drivers/staging/tidspbridge/include/dspbridge/chnl.h +++ b/drivers/staging/tidspbridge/include/dspbridge/chnl.h | |||
@@ -48,7 +48,6 @@ | |||
48 | * -ECHRNG: This manager cannot handle this many channels. | 48 | * -ECHRNG: This manager cannot handle this many channels. |
49 | * -EEXIST: Channel manager already exists for this device. | 49 | * -EEXIST: Channel manager already exists for this device. |
50 | * Requires: | 50 | * Requires: |
51 | * chnl_init(void) called. | ||
52 | * channel_mgr != NULL. | 51 | * channel_mgr != NULL. |
53 | * mgr_attrts != NULL. | 52 | * mgr_attrts != NULL. |
54 | * Ensures: | 53 | * Ensures: |
@@ -70,7 +69,6 @@ extern int chnl_create(struct chnl_mgr **channel_mgr, | |||
70 | * 0: Success. | 69 | * 0: Success. |
71 | * -EFAULT: hchnl_mgr was invalid. | 70 | * -EFAULT: hchnl_mgr was invalid. |
72 | * Requires: | 71 | * Requires: |
73 | * chnl_init(void) called. | ||
74 | * Ensures: | 72 | * Ensures: |
75 | * 0: Cancels I/O on each open channel. | 73 | * 0: Cancels I/O on each open channel. |
76 | * Closes each open channel. | 74 | * Closes each open channel. |
@@ -79,31 +77,4 @@ extern int chnl_create(struct chnl_mgr **channel_mgr, | |||
79 | */ | 77 | */ |
80 | extern int chnl_destroy(struct chnl_mgr *hchnl_mgr); | 78 | extern int chnl_destroy(struct chnl_mgr *hchnl_mgr); |
81 | 79 | ||
82 | /* | ||
83 | * ======== chnl_exit ======== | ||
84 | * Purpose: | ||
85 | * Discontinue usage of the CHNL module. | ||
86 | * Parameters: | ||
87 | * Returns: | ||
88 | * Requires: | ||
89 | * chnl_init(void) previously called. | ||
90 | * Ensures: | ||
91 | * Resources, if any acquired in chnl_init(void), are freed when the last | ||
92 | * client of CHNL calls chnl_exit(void). | ||
93 | */ | ||
94 | extern void chnl_exit(void); | ||
95 | |||
96 | /* | ||
97 | * ======== chnl_init ======== | ||
98 | * Purpose: | ||
99 | * Initialize the CHNL module's private state. | ||
100 | * Parameters: | ||
101 | * Returns: | ||
102 | * TRUE if initialized; FALSE if error occurred. | ||
103 | * Requires: | ||
104 | * Ensures: | ||
105 | * A requirement for each of the other public CHNL functions. | ||
106 | */ | ||
107 | extern bool chnl_init(void); | ||
108 | |||
109 | #endif /* CHNL_ */ | 80 | #endif /* CHNL_ */ |
diff --git a/drivers/staging/tidspbridge/pmgr/chnl.c b/drivers/staging/tidspbridge/pmgr/chnl.c index 825be200e27..4bd8686f235 100644 --- a/drivers/staging/tidspbridge/pmgr/chnl.c +++ b/drivers/staging/tidspbridge/pmgr/chnl.c | |||
@@ -38,9 +38,6 @@ | |||
38 | /* ----------------------------------- This */ | 38 | /* ----------------------------------- This */ |
39 | #include <dspbridge/chnl.h> | 39 | #include <dspbridge/chnl.h> |
40 | 40 | ||
41 | /* ----------------------------------- Globals */ | ||
42 | static u32 refs; | ||
43 | |||
44 | /* | 41 | /* |
45 | * ======== chnl_create ======== | 42 | * ======== chnl_create ======== |
46 | * Purpose: | 43 | * Purpose: |
@@ -116,28 +113,3 @@ int chnl_destroy(struct chnl_mgr *hchnl_mgr) | |||
116 | 113 | ||
117 | return status; | 114 | return status; |
118 | } | 115 | } |
119 | |||
120 | /* | ||
121 | * ======== chnl_exit ======== | ||
122 | * Purpose: | ||
123 | * Discontinue usage of the CHNL module. | ||
124 | */ | ||
125 | void chnl_exit(void) | ||
126 | { | ||
127 | refs--; | ||
128 | } | ||
129 | |||
130 | /* | ||
131 | * ======== chnl_init ======== | ||
132 | * Purpose: | ||
133 | * Initialize the CHNL module's private state. | ||
134 | */ | ||
135 | bool chnl_init(void) | ||
136 | { | ||
137 | bool ret = true; | ||
138 | |||
139 | if (ret) | ||
140 | refs++; | ||
141 | |||
142 | return ret; | ||
143 | } | ||
diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c b/drivers/staging/tidspbridge/pmgr/dspapi.c index 0a55465b625..5b9dcad7e4b 100644 --- a/drivers/staging/tidspbridge/pmgr/dspapi.c +++ b/drivers/staging/tidspbridge/pmgr/dspapi.c | |||
@@ -268,7 +268,6 @@ void api_exit(void) | |||
268 | if (api_c_refs == 0) { | 268 | if (api_c_refs == 0) { |
269 | /* Release all modules initialized in api_init(). */ | 269 | /* Release all modules initialized in api_init(). */ |
270 | dev_exit(); | 270 | dev_exit(); |
271 | chnl_exit(); | ||
272 | msg_exit(); | 271 | msg_exit(); |
273 | io_exit(); | 272 | io_exit(); |
274 | mgr_exit(); | 273 | mgr_exit(); |
@@ -283,26 +282,22 @@ void api_exit(void) | |||
283 | bool api_init(void) | 282 | bool api_init(void) |
284 | { | 283 | { |
285 | bool ret = true; | 284 | bool ret = true; |
286 | bool fdev, fchnl, fmsg, fio; | 285 | bool fdev, fmsg, fio; |
287 | bool fmgr; | 286 | bool fmgr; |
288 | 287 | ||
289 | if (api_c_refs == 0) { | 288 | if (api_c_refs == 0) { |
290 | /* initialize driver and other modules */ | 289 | /* initialize driver and other modules */ |
291 | fmgr = mgr_init(); | 290 | fmgr = mgr_init(); |
292 | fchnl = chnl_init(); | ||
293 | fmsg = msg_mod_init(); | 291 | fmsg = msg_mod_init(); |
294 | fio = io_init(); | 292 | fio = io_init(); |
295 | fdev = dev_init(); | 293 | fdev = dev_init(); |
296 | ret = fdev && fchnl && fmsg && fio; | 294 | ret = fdev && fmsg && fio; |
297 | ret = ret && fmgr; | 295 | ret = ret && fmgr; |
298 | if (!ret) { | 296 | if (!ret) { |
299 | 297 | ||
300 | if (fmgr) | 298 | if (fmgr) |
301 | mgr_exit(); | 299 | mgr_exit(); |
302 | 300 | ||
303 | if (fchnl) | ||
304 | chnl_exit(); | ||
305 | |||
306 | if (fmsg) | 301 | if (fmsg) |
307 | msg_exit(); | 302 | msg_exit(); |
308 | 303 | ||