[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAtXAHenOZHqoLDCOp5j7LM8NVWKOKk-fsg0PgK6_UMr+fsQwQ@mail.gmail.com>
Date: Tue, 22 Mar 2016 15:50:50 -0700
From: Moritz Fischer <moritz.fischer@...us.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: Greg KH <gregkh@...uxfoundation.org>, arve@...roid.com,
riandrews@...roid.com, labbott@...hat.com, sumit.semwal@...aro.org,
dan.carpenter@...cle.com, sriram@...irs.net.in,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
devel@...verdev.osuosl.org,
Moritz Fischer <moritz.fischer@...us.com>
Subject: Re: [RFC 2/2] staging: android: ion: Add of_ion_device_get function
Derp,
On Tue, Mar 22, 2016 at 3:33 PM, Moritz Fischer
<moritz.fischer@...us.com> wrote:
> Allows to obtain a reference to the global /dev/ion backing
> struct ion_device via devicetree.
>
> Signed-off-by: Moritz Fischer <moritz.fischer@...us.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
>
It's missing the header file ... if it's deemed useful at all I'll
clean up and resubmit.
Moritz
Powered by blists - more mailing lists