Re: [PATCH] gpiolib: Add 'struct gpio_chip' forward declaration for !GPIOLIB case

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Grant Likely
Date: Tuesday, August 31, 2010 - 9:44 am

On Tue, Aug 31, 2010 at 2:37 AM, Anton Vorontsov <cbouatmailru@gmail.com> wrote:

Looking even closer, we're both wrong.  You're right I didn't look
carefully enough, and the error is in of_gpio.h, not the .c file.

However, it is not okay to get the definitions from of_gpio.h when
CONFIG_GPIOLIB=n.  If GPIOLIB, or more specifically OF_GPIO isn't set,
then the of_gpio.h definitions should either not be defined, or should
be defined as empty stubs (where appropriate).

So, instead of adding a forward declarations of the struct, the
correct thing I think to do is to #ifdef out the contents of of_gpio.h
when GPIOLIB isn't selected so that extra #includes are completely
benign.  I've been doing the same thing on the other linux/of*.h
headers.  I've got a patch in my tree that I'm testing right now and
I'll post later today.

g.




-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] gpiolib: Add 'struct gpio_chip' forward declar ..., Grant Likely, (Tue Aug 31, 9:44 am)