diff options
author | Ohad Ben-Cohen <ohad@wizery.com> | 2012-05-30 15:02:24 -0400 |
---|---|---|
committer | Ohad Ben-Cohen <ohad@wizery.com> | 2012-07-05 17:53:25 -0400 |
commit | 7183a2a799b81490354973117ecd810c23cdc668 (patch) | |
tree | cfd720d9a745f8d010120ca434246336423aea32 /drivers/remoteproc/remoteproc_virtio.c | |
parent | b5ab5e24e960b9f780a4cc96815cfd4b0d412720 (diff) |
remoteproc: remove the now-redundant kref
Now that every rproc instance contains a device, we don't need a
kref anymore to maintain the refcount of the rproc instances:
that's what device are good with!
This patch removes the now-redundant kref, and switches to
{get, put}_device instead of kref_{get, put}.
We also don't need the kref's release function anymore, and instead,
we just utilize the class's release handler (which is now responsible
for all memory de-allocations).
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Fernando Guzman Lugo <fernando.lugo@ti.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Diffstat (limited to 'drivers/remoteproc/remoteproc_virtio.c')
-rw-r--r-- | drivers/remoteproc/remoteproc_virtio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c index b6621831a58a..3541b4492f64 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c | |||
@@ -225,7 +225,7 @@ static struct virtio_config_ops rproc_virtio_config_ops = { | |||
225 | 225 | ||
226 | /* | 226 | /* |
227 | * This function is called whenever vdev is released, and is responsible | 227 | * This function is called whenever vdev is released, and is responsible |
228 | * to decrement the remote processor's refcount taken when vdev was | 228 | * to decrement the remote processor's refcount which was taken when vdev was |
229 | * added. | 229 | * added. |
230 | * | 230 | * |
231 | * Never call this function directly; it will be called by the driver | 231 | * Never call this function directly; it will be called by the driver |
@@ -240,7 +240,7 @@ static void rproc_vdev_release(struct device *dev) | |||
240 | list_del(&rvdev->node); | 240 | list_del(&rvdev->node); |
241 | kfree(rvdev); | 241 | kfree(rvdev); |
242 | 242 | ||
243 | kref_put(&rproc->refcount, rproc_release); | 243 | put_device(&rproc->dev); |
244 | } | 244 | } |
245 | 245 | ||
246 | /** | 246 | /** |
@@ -272,11 +272,11 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id) | |||
272 | * Therefore we must increment the rproc refcount here, and decrement | 272 | * Therefore we must increment the rproc refcount here, and decrement |
273 | * it _only_ when the vdev is released. | 273 | * it _only_ when the vdev is released. |
274 | */ | 274 | */ |
275 | kref_get(&rproc->refcount); | 275 | get_device(&rproc->dev); |
276 | 276 | ||
277 | ret = register_virtio_device(vdev); | 277 | ret = register_virtio_device(vdev); |
278 | if (ret) { | 278 | if (ret) { |
279 | kref_put(&rproc->refcount, rproc_release); | 279 | put_device(&rproc->dev); |
280 | dev_err(dev, "failed to register vdev: %d\n", ret); | 280 | dev_err(dev, "failed to register vdev: %d\n", ret); |
281 | goto out; | 281 | goto out; |
282 | } | 282 | } |