diff options
author | Ohad Ben-Cohen <ohad@wizery.com> | 2012-07-04 09:25:06 -0400 |
---|---|---|
committer | Ohad Ben-Cohen <ohad@wizery.com> | 2012-07-05 17:53:27 -0400 |
commit | 160e7c840fe85836040c43e0058d5afced470c85 (patch) | |
tree | 65e91c7aae75ce16fa10dcdd015e664503dec1d5 /Documentation/remoteproc.txt | |
parent | 40e575b1d0b34b38519d361c10bdf8e0c688957b (diff) |
remoteproc: adopt the driver core's alloc/add/del/put naming
To make remoteproc's API more intuitive for developers, we adopt
the driver core's naming, i.e. alloc -> add -> del -> put. We'll also
add register/unregister when their first user shows up.
Otherwise - there's no functional change here.
Suggested by Russell King <linux@arm.linux.org.uk>.
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Fernando Guzman Lugo <fernando.lugo@ti.com>
Cc: Sjur Brændeland <sjur.brandeland@stericsson.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Diffstat (limited to 'Documentation/remoteproc.txt')
-rw-r--r-- | Documentation/remoteproc.txt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Documentation/remoteproc.txt b/Documentation/remoteproc.txt index f33c3bbbc867..23a09b884bc7 100644 --- a/Documentation/remoteproc.txt +++ b/Documentation/remoteproc.txt | |||
@@ -90,21 +90,21 @@ int dummy_rproc_example(struct rproc *my_rproc) | |||
90 | This function should be used by rproc implementations during | 90 | This function should be used by rproc implementations during |
91 | initialization of the remote processor. | 91 | initialization of the remote processor. |
92 | After creating an rproc handle using this function, and when ready, | 92 | After creating an rproc handle using this function, and when ready, |
93 | implementations should then call rproc_register() to complete | 93 | implementations should then call rproc_add() to complete |
94 | the registration of the remote processor. | 94 | the registration of the remote processor. |
95 | On success, the new rproc is returned, and on failure, NULL. | 95 | On success, the new rproc is returned, and on failure, NULL. |
96 | 96 | ||
97 | Note: _never_ directly deallocate @rproc, even if it was not registered | 97 | Note: _never_ directly deallocate @rproc, even if it was not registered |
98 | yet. Instead, when you need to unroll rproc_alloc(), use rproc_free(). | 98 | yet. Instead, when you need to unroll rproc_alloc(), use rproc_put(). |
99 | 99 | ||
100 | void rproc_free(struct rproc *rproc) | 100 | void rproc_put(struct rproc *rproc) |
101 | - Free an rproc handle that was allocated by rproc_alloc. | 101 | - Free an rproc handle that was allocated by rproc_alloc. |
102 | This function essentially unrolls rproc_alloc(), by decrementing the | 102 | This function essentially unrolls rproc_alloc(), by decrementing the |
103 | rproc's refcount. It doesn't directly free rproc; that would happen | 103 | rproc's refcount. It doesn't directly free rproc; that would happen |
104 | only if there are no other references to rproc and its refcount now | 104 | only if there are no other references to rproc and its refcount now |
105 | dropped to zero. | 105 | dropped to zero. |
106 | 106 | ||
107 | int rproc_register(struct rproc *rproc) | 107 | int rproc_add(struct rproc *rproc) |
108 | - Register @rproc with the remoteproc framework, after it has been | 108 | - Register @rproc with the remoteproc framework, after it has been |
109 | allocated with rproc_alloc(). | 109 | allocated with rproc_alloc(). |
110 | This is called by the platform-specific rproc implementation, whenever | 110 | This is called by the platform-specific rproc implementation, whenever |
@@ -117,15 +117,15 @@ int dummy_rproc_example(struct rproc *my_rproc) | |||
117 | of registering this remote processor, additional virtio drivers might get | 117 | of registering this remote processor, additional virtio drivers might get |
118 | probed. | 118 | probed. |
119 | 119 | ||
120 | int rproc_unregister(struct rproc *rproc) | 120 | int rproc_del(struct rproc *rproc) |
121 | - Unroll rproc_register(). | 121 | - Unroll rproc_add(). |
122 | This function should be called when the platform specific rproc | 122 | This function should be called when the platform specific rproc |
123 | implementation decides to remove the rproc device. it should | 123 | implementation decides to remove the rproc device. it should |
124 | _only_ be called if a previous invocation of rproc_register() | 124 | _only_ be called if a previous invocation of rproc_add() |
125 | has completed successfully. | 125 | has completed successfully. |
126 | 126 | ||
127 | After rproc_unregister() returns, @rproc is still valid, and its | 127 | After rproc_del() returns, @rproc is still valid, and its |
128 | last refcount should be decremented by calling rproc_free(). | 128 | last refcount should be decremented by calling rproc_put(). |
129 | 129 | ||
130 | Returns 0 on success and -EINVAL if @rproc isn't valid. | 130 | Returns 0 on success and -EINVAL if @rproc isn't valid. |
131 | 131 | ||