diff options
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 | } |