From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: g.liakhovetski@gmx.de, linux-media@vger.kernel.org,
rob.herring@calxeda.com, thomas.abraham@linaro.org,
t.figa@samsung.com, sw0312.kim@samsung.com,
kyungmin.park@samsung.com, devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 05/13] of: Add empty for_each_available_child_of_node() macro definition
Date: Tue, 11 Dec 2012 17:09:57 +0100 [thread overview]
Message-ID: <50C75AD5.2040105@samsung.com> (raw)
In-Reply-To: <20121211085707.8D4F03E076D@localhost>
On 12/11/2012 09:57 AM, Grant Likely wrote:
> On Mon, 10 Dec 2012 20:41:31 +0100, Sylwester Nawrocki <s.nawrocki@samsung.com> wrote:
>> Add this empty macro definition so users can be compiled without
>> excluding this macro call with preprocessor directives when CONFIG_OF
>> is disabled.
>>
>> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>
> What non-OF code is calling this function?
It is used in a driver [1] in an OF specific function. The patch is
in my second series that depends this one.
"[PATCH RFC 00/12] Device tree support for Exynos4 SoC camera drivers"
I thought it was better to add this empty macro definition rather
than using #ifdef CONFIG_OF in the code. However, in this case
the local variables would remain unused, so it's not really any
good solution. It just looked cumbersome to me to have in the code
something like
#ifdef CONFIG_OF
int func(void)
{
int x;
....
return x;
}
#else
#define func() (-ENOSYS)
#endif
After all it's not that bad and allows to compile out all OF code
when it's unused.
Please ignore patches 05..07/13, I'll drop them in next iteration.
And sorry for the noise.
[1] http://patchwork.linuxtv.org/patch/15852/
>> ---
>> include/linux/of.h | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/include/linux/of.h b/include/linux/of.h
>> index 2fb0dbe..7df42cc 100644
>> --- a/include/linux/of.h
>> +++ b/include/linux/of.h
>> @@ -332,6 +332,9 @@ static inline bool of_have_populated_dt(void)
>> #define for_each_child_of_node(parent, child) \
>> while (0)
>>
>> +#define for_each_available_child_of_node(parent, child) \
>> + while (0)
>> +
>> static inline struct device_node *of_get_child_by_name(
>> const struct device_node *node,
>> const char *name)
>> --
>> 1.7.9.5
Thanks,
Sylwester
next prev parent reply other threads:[~2012-12-11 16:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-10 19:41 [PATCH RFC 00/13] Common video input interfaces bindings and V4L2 OF helpers Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 01/13] i2c: add dummy inline functions for when CONFIG_OF_I2C(_MODULE) isn't defined Sylwester Nawrocki
2012-12-11 8:39 ` Grant Likely
2012-12-10 19:41 ` [PATCH RFC 02/13] of: add a dummy inline function for when CONFIG_OF is not defined Sylwester Nawrocki
2012-12-11 8:42 ` Grant Likely
2012-12-10 19:41 ` [PATCH RFC 03/13] OF: define of_*_cmp() macros also if CONFIG_OF isn't set Sylwester Nawrocki
2012-12-11 8:45 ` Grant Likely
2012-12-10 19:41 ` [PATCH RFC 04/13] OF: make a function pointer argument const Sylwester Nawrocki
2012-12-11 8:51 ` Grant Likely
2012-12-10 19:41 ` [PATCH RFC 05/13] of: Add empty for_each_available_child_of_node() macro definition Sylwester Nawrocki
2012-12-11 8:57 ` Grant Likely
2012-12-11 16:09 ` Sylwester Nawrocki [this message]
2012-12-10 19:41 ` [PATCH RFC 06/13] of: Add empty of_find_device_by_node() function definition Sylwester Nawrocki
2012-12-11 8:59 ` Grant Likely
2012-12-10 19:41 ` [PATCH RFC 07/13] of: Add empty of_get_next_child() " Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 08/13] media: add V4L2 DT binding documentation Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 09/13] media: add a V4L2 OF parser Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 10/13] v4l2-of: Support variable length of data-lanes property Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 11/13] v4l2-of: Add v4l2_of_parse_data_lanes() function Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 12/13] v4l2-of: Corrected v4l2_of_parse_link() function declaration Sylwester Nawrocki
2012-12-10 19:41 ` [PATCH RFC 13/13] v4l2-of: Replace "remote" property with "remote-endpoint" Sylwester Nawrocki
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=50C75AD5.2040105@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=g.liakhovetski@gmx.de \
--cc=grant.likely@secretlab.ca \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=sw0312.kim@samsung.com \
--cc=t.figa@samsung.com \
--cc=thomas.abraham@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