Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1363060
| From | Moritz Fischer <moritz.fischer@ettus.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFC 2/2] staging: android: ion: Add of_ion_device_get function |
| Date | 2016-03-22 23:40 +0100 |
| Message-ID | <rfD7Y-2AF-13@gated-at.bofh.it> (permalink) |
| References | <rfD7Y-2AF-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC 0/2] staging: ion: of_ion_device_get Moritz Fischer <moritz.fischer@ettus.com> - 2016-03-22 23:40 +0100
[RFC 2/2] staging: android: ion: Add of_ion_device_get function Moritz Fischer <moritz.fischer@ettus.com> - 2016-03-22 23:40 +0100
Re: [RFC 2/2] staging: android: ion: Add of_ion_device_get function Moritz Fischer <moritz.fischer@ettus.com> - 2016-03-23 00:00 +0100
Re: [RFC 2/2] staging: android: ion: Add of_ion_device_get function Dan Carpenter <dan.carpenter@oracle.com> - 2016-03-23 06:00 +0100
Re: [RFC 0/2] staging: ion: of_ion_device_get Laura Abbott <labbott@redhat.com> - 2016-03-23 00:00 +0100
Re: [RFC 0/2] staging: ion: of_ion_device_get Moritz Fischer <moritz.fischer@ettus.com> - 2016-03-23 00:10 +0100
Re: [RFC 0/2] staging: ion: of_ion_device_get Laura Abbott <labbott@redhat.com> - 2016-03-23 00:30 +0100
Re: [RFC 0/2] staging: ion: of_ion_device_get Moritz Fischer <moritz.fischer@ettus.com> - 2016-03-23 00:40 +0100
Re: [RFC 0/2] staging: ion: of_ion_device_get Moritz Fischer <moritz.fischer@ettus.com> - 2016-03-23 00:50 +0100
csiph-web