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>
This commit is contained in:
Ohad Ben-Cohen 2012-05-30 22:02:24 +03:00
parent b5ab5e24e9
commit 7183a2a799
3 changed files with 15 additions and 46 deletions

View file

@ -36,7 +36,6 @@
#define REMOTEPROC_H
#include <linux/types.h>
#include <linux/kref.h>
#include <linux/klist.h>
#include <linux/mutex.h>
#include <linux/virtio.h>
@ -370,7 +369,6 @@ enum rproc_state {
* @priv: private data which belongs to the platform-specific rproc module
* @ops: platform-specific start/stop rproc handlers
* @dev: virtual device for refcounting and common remoteproc behavior
* @refcount: refcount of users that have a valid pointer to this rproc
* @power: refcount of users who need this rproc powered up
* @state: state of the device
* @lock: lock which protects concurrent manipulations of the rproc
@ -393,7 +391,6 @@ struct rproc {
void *priv;
const struct rproc_ops *ops;
struct device dev;
struct kref refcount;
atomic_t power;
unsigned int state;
struct mutex lock;