diff options
Diffstat (limited to 'Documentation/remoteproc.txt')
-rw-r--r-- | Documentation/remoteproc.txt | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/Documentation/remoteproc.txt b/Documentation/remoteproc.txt index 70a048cd3fa3..ad6ded4bca5c 100644 --- a/Documentation/remoteproc.txt +++ b/Documentation/remoteproc.txt | |||
@@ -120,14 +120,14 @@ int dummy_rproc_example(struct rproc *my_rproc) | |||
120 | On success, the new rproc is returned, and on failure, NULL. | 120 | On success, the new rproc is returned, and on failure, NULL. |
121 | 121 | ||
122 | Note: _never_ directly deallocate @rproc, even if it was not registered | 122 | Note: _never_ directly deallocate @rproc, even if it was not registered |
123 | yet. Instead, if you just need to unroll rproc_alloc(), use rproc_free(). | 123 | yet. Instead, when you need to unroll rproc_alloc(), use rproc_free(). |
124 | 124 | ||
125 | void rproc_free(struct rproc *rproc) | 125 | void rproc_free(struct rproc *rproc) |
126 | - Free an rproc handle that was allocated by rproc_alloc. | 126 | - Free an rproc handle that was allocated by rproc_alloc. |
127 | This function should _only_ be used if @rproc was only allocated, | 127 | This function essentially unrolls rproc_alloc(), by decrementing the |
128 | but not registered yet. | 128 | rproc's refcount. It doesn't directly free rproc; that would happen |
129 | If @rproc was already successfully registered (by calling | 129 | only if there are no other references to rproc and its refcount now |
130 | rproc_register()), then use rproc_unregister() instead. | 130 | dropped to zero. |
131 | 131 | ||
132 | int rproc_register(struct rproc *rproc) | 132 | int rproc_register(struct rproc *rproc) |
133 | - Register @rproc with the remoteproc framework, after it has been | 133 | - Register @rproc with the remoteproc framework, after it has been |
@@ -143,19 +143,14 @@ int dummy_rproc_example(struct rproc *my_rproc) | |||
143 | probed. | 143 | probed. |
144 | 144 | ||
145 | int rproc_unregister(struct rproc *rproc) | 145 | int rproc_unregister(struct rproc *rproc) |
146 | - Unregister a remote processor, and decrement its refcount. | 146 | - Unroll rproc_register(). |
147 | If its refcount drops to zero, then @rproc will be freed. If not, | ||
148 | it will be freed later once the last reference is dropped. | ||
149 | |||
150 | This function should be called when the platform specific rproc | 147 | This function should be called when the platform specific rproc |
151 | implementation decides to remove the rproc device. it should | 148 | implementation decides to remove the rproc device. it should |
152 | _only_ be called if a previous invocation of rproc_register() | 149 | _only_ be called if a previous invocation of rproc_register() |
153 | has completed successfully. | 150 | has completed successfully. |
154 | 151 | ||
155 | After rproc_unregister() returns, @rproc is _not_ valid anymore and | 152 | After rproc_unregister() returns, @rproc is still valid, and its |
156 | it shouldn't be used. More specifically, don't call rproc_free() | 153 | last refcount should be decremented by calling rproc_free(). |
157 | or try to directly free @rproc after rproc_unregister() returns; | ||
158 | none of these are needed, and calling them is a bug. | ||
159 | 154 | ||
160 | Returns 0 on success and -EINVAL if @rproc isn't valid. | 155 | Returns 0 on success and -EINVAL if @rproc isn't valid. |
161 | 156 | ||