From: Moritz Fischer <moritz.fischer@ettus.com>
To: arnd@arndb.de
Cc: gregkh@linuxfoundation.org, arve@android.com,
riandrews@android.com, labbott@redhat.com, gioh.kim@lge.com,
sumit.semwal@linaro.org, dan.carpenter@oracle.com,
sriram@marirs.net.in, linux-kernel@vger.kernel.org,
devel@driverdev.osuosl.org,
Moritz Fischer <moritz.fischer@ettus.com>
Subject: [RFC 2/2] staging: android: ion: Add of_ion_device_get function
Date: Tue, 22 Mar 2016 15:33:51 -0700 [thread overview]
Message-ID: <1458686031-31031-3-git-send-email-moritz.fischer@ettus.com> (raw)
In-Reply-To: <1458686031-31031-1-git-send-email-moritz.fischer@ettus.com>
Allows to obtain a reference to the global /dev/ion backing
struct ion_device via devicetree.
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
---
drivers/staging/android/ion/ion.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c
index e237e9f..cea264e0 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -64,6 +64,16 @@ struct ion_device {
struct dentry *clients_debug_root;
};
+struct ion_device *of_ion_device_get(struct device_node *node)
+{
+ struct miscdevice *mdev = of_misc_get(node);
+
+ if (IS_ERR(mdev))
+ return ERR_PTR(PTR_ERR(mdev));
+
+ return container_of(mdev, struct ion_device, dev);
+}
+
/**
* struct ion_client - a process/hw block local address space
* @node: node in the tree of all clients
--
2.7.4
next prev parent reply other threads:[~2016-03-22 22:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-22 22:33 [RFC 0/2] staging: ion: of_ion_device_get Moritz Fischer
2016-03-22 22:33 ` [RFC 1/2] misc: Add of_get_misc get a reference from devicetree Moritz Fischer
2016-03-22 22:54 ` Moritz Fischer
2016-03-22 22:33 ` Moritz Fischer [this message]
2016-03-22 22:50 ` [RFC 2/2] staging: android: ion: Add of_ion_device_get function Moritz Fischer
2016-03-23 4:55 ` Dan Carpenter
2016-03-22 22:51 ` [RFC 0/2] staging: ion: of_ion_device_get Laura Abbott
2016-03-22 23:08 ` Moritz Fischer
2016-03-22 23:20 ` Laura Abbott
2016-03-22 23:38 ` Moritz Fischer
2016-03-22 23:40 ` Moritz Fischer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1458686031-31031-3-git-send-email-moritz.fischer@ettus.com \
--to=moritz.fischer@ettus.com \
--cc=arnd@arndb.de \
--cc=arve@android.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gioh.kim@lge.com \
--cc=gregkh@linuxfoundation.org \
--cc=labbott@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=riandrews@android.com \
--cc=sriram@marirs.net.in \
--cc=sumit.semwal@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®