From: Mika Westerberg <mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
To: Sakari Ailus <sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Cc: linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
sudeep.holla-5wv7dgnIgG8@public.gmane.org,
lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org,
rafael-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
ahs3-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
kieran.bingham-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org
Subject: Re: [PATCH v5 2/6] device property: Move FW type specific functionality to FW specific files
Date: Wed, 31 May 2017 15:19:11 +0300 [thread overview]
Message-ID: <20170531121911.GG2784@lahna.fi.intel.com> (raw)
In-Reply-To: <1496231532-23601-3-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
On Wed, May 31, 2017 at 02:52:08PM +0300, Sakari Ailus wrote:
> +static int fwnode_property_read_int_array(
> + struct fwnode_handle *fwnode, const char *propname,
> + unsigned int elem_size, void *val, size_t nval)
You forgot this one :)
> +{
> + int ret;
> +
> + ret = fwnode_call_int_op(fwnode, property_read_int_array, propname,
> + elem_size, val, nval);
> + if (ret == -EINVAL && !IS_ERR_OR_NULL(fwnode) &&
> + !IS_ERR_OR_NULL(fwnode->secondary))
> + ret = fwnode_call_int_op(
> + fwnode->secondary, property_read_int_array, propname,
> + elem_size, val, nval);
> +
> + return ret;
> +}
[...]
> +/**
> + * struct fwnode_operations - Operations for fwnode interface
> + * @get: Get a reference to an fwnode.
> + * @put: Put a reference to an fwnode.
> + * @property_present: Return true if a property is present.
> + * @property_read_integer_array: Read an array of integer properties. Return
> + * zero on success, a negative error code
> + * otherwise.
> + * @property_read_string_array: Read an array of string properties. Return zero
> + * on success, a negative error code otherwise.
> + * @get_parent: Return the parent of an fwnode.
> + * @get_next_child_node: Return the next child node in an iteration.
> + * @get_named_child_node: Return a child node with a given name.
> + */
> +struct fwnode_operations {
> + void (*get)(struct fwnode_handle *fwnode);
> + void (*put)(struct fwnode_handle *fwnode);
> + bool (*property_present)(struct fwnode_handle *fwnode,
> + const char *propname);
> + int (*property_read_int_array)(struct fwnode_handle *fwnode,
> + const char *propname,
> + unsigned int elem_size, void *val,
> + size_t nval);
> + int (*property_read_string_array)(struct fwnode_handle *fwnode_handle,
> + const char *propname,
> + const char **val, size_t nval);
> + struct fwnode_handle *(*get_parent)(struct fwnode_handle *fwnode);
> + struct fwnode_handle *
> + (*get_next_child_node)(struct fwnode_handle *fwnode,
> + struct fwnode_handle *child);
I would do the following instead
struct fwnode_handle *(*get_next_child_node)(struct fwnode_handle *fwnode,
struct fwnode_handle *child);
struct fwnode_handle *(*get_named_child_node)(struct fwnode_handle *fwnode,
const char *name);
Yes, it is over 80 chars but it is more readable this way.
Just saying :) I'll leave this up to you.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-05-31 12:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-31 11:52 [PATCH v5 0/6] Move firmware specific code to firmware specific locations Sakari Ailus
2017-05-31 11:52 ` [PATCH v5 1/6] ACPI: Constify argument to acpi_device_is_present() Sakari Ailus
2017-05-31 11:52 ` [PATCH v5 2/6] device property: Move FW type specific functionality to FW specific files Sakari Ailus
[not found] ` <1496231532-23601-3-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-05-31 12:19 ` Mika Westerberg [this message]
[not found] ` <1496231532-23601-1-git-send-email-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-05-31 11:52 ` [PATCH v5 3/6] device property: Move fwnode graph ops to firmware specific locations Sakari Ailus
2017-05-31 11:52 ` [PATCH v5 4/6] device property: Introduce fwnode_device_is_available() Sakari Ailus
2017-05-31 11:52 ` [PATCH v5 5/6] device property: Add FW type agnostic fwnode_graph_get_remote_node Sakari Ailus
2017-05-31 11:52 ` [PATCH v5 6/6] device property: Add fwnode_graph_get_port_parent Sakari Ailus
2017-05-31 12:23 ` [PATCH v5 0/6] Move firmware specific code to firmware specific locations Mika Westerberg
2017-05-31 12:27 ` Sakari Ailus
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=20170531121911.GG2784@lahna.fi.intel.com \
--to=mika.westerberg-vuqaysv1563yd54fqh9/ca@public.gmane.org \
--cc=ahs3-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=kieran.bingham-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
--cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lorenzo.pieralisi-5wv7dgnIgG8@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=rafael-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=sudeep.holla-5wv7dgnIgG8@public.gmane.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