From: Jiri Kosina on

[ adding Bruno to CC ]

On Mon, 5 Apr 2010, Randy Dunlap wrote:

> From: Randy Dunlap <randy.dunlap(a)oracle.com>
>
> HID_PICOLCD should depend on LCD_CLASS_DEVICE, otherwise the
> build fails when HID_PICOLCD=y and LCD_CLASS_DEVICE=m:
>
> hid-picolcd.c:(.text+0x84523f): undefined reference to `lcd_device_unregister'
> hid-picolcd.c:(.text+0x8478ab): undefined reference to `lcd_device_register'
> hid-picolcd.c:(.text+0x84c15f): undefined reference to `lcd_device_unregister'
>
> Signed-off-by: Randy Dunlap <randy.dunlap(a)oracle.com>
> ---
> drivers/hid/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> --- mmotm-2010-0405-1609.orig/drivers/hid/Kconfig
> +++ mmotm-2010-0405-1609/drivers/hid/Kconfig
> @@ -265,6 +265,7 @@ config HID_PETALYNX
> config HID_PICOLCD
> tristate "PicoLCD (graphic version)"
> depends on USB_HID
> + depends on LCD_CLASS_DEVICE
> select FB_DEFERRED_IO if FB
> select FB_SYS_FILLRECT if FB
> select FB_SYS_COPYAREA if FB

Thanks Randy. We'll have to take care of the other dependencies as well
though (CONFIG_LCD_CLASS_DEVICE, CONFIG_LEDS_CLASS).

--
Jiri Kosina
SUSE Labs, Novell Inc.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Bruno Prémont on
On Tue, 6 Apr 2010 10:40:06 +0200 Jiri Kosina <jkosina(a)suse.cz> wrote:
>
> [ adding Bruno to CC ]
>
> On Mon, 5 Apr 2010, Randy Dunlap wrote:
>
> > From: Randy Dunlap <randy.dunlap(a)oracle.com>
> >
> > HID_PICOLCD should depend on LCD_CLASS_DEVICE, otherwise the
> > build fails when HID_PICOLCD=y and LCD_CLASS_DEVICE=m:
> >
> > hid-picolcd.c:(.text+0x84523f): undefined reference to `lcd_device_unregister'
> > hid-picolcd.c:(.text+0x8478ab): undefined reference to `lcd_device_register'
> > hid-picolcd.c:(.text+0x84c15f): undefined reference to `lcd_device_unregister'

That is weird, the

#if defined(CONFIG_LCD_CLASS_DEVICE) || defined(CONFIG_LCD_CLASS_DEVICE_MODULE)
feature support code
#else
empty stubs
#endif

blocks should have prevented LCD_CLASS support from being built if it
was not enabled in configuration.

Do you have the .config matching your build?

When I did my test-build with LCD support enabled/disabled I didn't get
any linker errors as those mentioned above.


Thanks,
Bruno


> > Signed-off-by: Randy Dunlap <randy.dunlap(a)oracle.com>
> > ---
> > drivers/hid/Kconfig | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > --- mmotm-2010-0405-1609.orig/drivers/hid/Kconfig
> > +++ mmotm-2010-0405-1609/drivers/hid/Kconfig
> > @@ -265,6 +265,7 @@ config HID_PETALYNX
> > config HID_PICOLCD
> > tristate "PicoLCD (graphic version)"
> > depends on USB_HID
> > + depends on LCD_CLASS_DEVICE
> > select FB_DEFERRED_IO if FB
> > select FB_SYS_FILLRECT if FB
> > select FB_SYS_COPYAREA if FB
>
> Thanks Randy. We'll have to take care of the other dependencies as well
> though (CONFIG_LCD_CLASS_DEVICE, CONFIG_LEDS_CLASS).
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Randy Dunlap on
On Tue, 6 Apr 2010 10:56:35 +0200 Bruno Prémont wrote:

> On Tue, 6 Apr 2010 10:40:06 +0200 Jiri Kosina <jkosina(a)suse.cz> wrote:
> >
> > [ adding Bruno to CC ]
> >
> > On Mon, 5 Apr 2010, Randy Dunlap wrote:
> >
> > > From: Randy Dunlap <randy.dunlap(a)oracle.com>
> > >
> > > HID_PICOLCD should depend on LCD_CLASS_DEVICE, otherwise the
> > > build fails when HID_PICOLCD=y and LCD_CLASS_DEVICE=m:
> > >
> > > hid-picolcd.c:(.text+0x84523f): undefined reference to `lcd_device_unregister'
> > > hid-picolcd.c:(.text+0x8478ab): undefined reference to `lcd_device_register'
> > > hid-picolcd.c:(.text+0x84c15f): undefined reference to `lcd_device_unregister'
>
> That is weird, the
>
> #if defined(CONFIG_LCD_CLASS_DEVICE) || defined(CONFIG_LCD_CLASS_DEVICE_MODULE)
> feature support code
> #else
> empty stubs
> #endif
>
> blocks should have prevented LCD_CLASS support from being built if it
> was not enabled in configuration.
>
> Do you have the .config matching your build?

Yes, it's attached.


> When I did my test-build with LCD support enabled/disabled I didn't get
> any linker errors as those mentioned above.
>
>
> Thanks,
> Bruno
>
>
> > > Signed-off-by: Randy Dunlap <randy.dunlap(a)oracle.com>
> > > ---
> > > drivers/hid/Kconfig | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > --- mmotm-2010-0405-1609.orig/drivers/hid/Kconfig
> > > +++ mmotm-2010-0405-1609/drivers/hid/Kconfig
> > > @@ -265,6 +265,7 @@ config HID_PETALYNX
> > > config HID_PICOLCD
> > > tristate "PicoLCD (graphic version)"
> > > depends on USB_HID
> > > + depends on LCD_CLASS_DEVICE
> > > select FB_DEFERRED_IO if FB
> > > select FB_SYS_FILLRECT if FB
> > > select FB_SYS_COPYAREA if FB
> >
> > Thanks Randy. We'll have to take care of the other dependencies as well
> > though (CONFIG_LCD_CLASS_DEVICE, CONFIG_LEDS_CLASS).
> --


---
~Randy
(re)read Documentation/ManagementStyle
From: Bruno Prémont on
On Tue, 06 April 2010 Randy Dunlap <randy.dunlap(a)oracle.com> wrote:
> On Tue, 6 Apr 2010 10:56:35 +0200 Bruno Prémont wrote:
>
> > On Tue, 6 Apr 2010 10:40:06 +0200 Jiri Kosina <jkosina(a)suse.cz> wrote:
> > >
> > > [ adding Bruno to CC ]
> > >
> > > On Mon, 5 Apr 2010, Randy Dunlap wrote:
> > >
> > > > From: Randy Dunlap <randy.dunlap(a)oracle.com>
> > > >
> > > > HID_PICOLCD should depend on LCD_CLASS_DEVICE, otherwise the
> > > > build fails when HID_PICOLCD=y and LCD_CLASS_DEVICE=m:
> > > >
> > > > hid-picolcd.c:(.text+0x84523f): undefined reference to `lcd_device_unregister'
> > > > hid-picolcd.c:(.text+0x8478ab): undefined reference to `lcd_device_register'
> > > > hid-picolcd.c:(.text+0x84c15f): undefined reference to `lcd_device_unregister'
> >
> > That is weird, the
> >
> > #if defined(CONFIG_LCD_CLASS_DEVICE) || defined(CONFIG_LCD_CLASS_DEVICE_MODULE)
> > feature support code
> > #else
> > empty stubs
> > #endif
> >
> > blocks should have prevented LCD_CLASS support from being built if it
> > was not enabled in configuration.
> >
> > Do you have the .config matching your build?
>
> Yes, it's attached.

Thanks, here is the extract (only the pertinent items):
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_LCD_CLASS_DEVICE=m
CONFIG_BACKLIGHT_CLASS_DEVICE=y
CONFIG_HID_PICOLCD=y

It triggers the issue by having PicoLCD built-in while one of the
optional dependencies as a module.

Any idea of how this can be solved with kbuild in order to keep the
dependencies optional?

Something that would satisfy the following pseudocode:
if CONFIG_HID_PICOLCD == y
assert(CONFIG_LCD_CLASS_DEVICE != m)


One of my attempts did end up with a circular loop with regard to FB
(some of the FB drivers did select INPUT)?

I had something like:

config HID_PICOLCD
tristate ...

config HID_PICOLCD_FB
bool ...
depends on HID_PICOLCD
select FB
select FB_...

....

Then in the code I checked for CONFIG_HID_PICOLCD_FB instead of
(CONFIG_FB or CONFIG_FB_MODULE).

Thanks,
Bruno
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Randy Dunlap on
On Tue, 6 Apr 2010 18:35:35 +0200 Bruno Pr�mont wrote:

> On Tue, 06 April 2010 Randy Dunlap <randy.dunlap(a)oracle.com> wrote:
> > On Tue, 6 Apr 2010 10:56:35 +0200 Bruno Pr�mont wrote:
> >
> > > On Tue, 6 Apr 2010 10:40:06 +0200 Jiri Kosina <jkosina(a)suse.cz> wrote:
> > > >
> > > > [ adding Bruno to CC ]
> > > >
> > > > On Mon, 5 Apr 2010, Randy Dunlap wrote:
> > > >
> > > > > From: Randy Dunlap <randy.dunlap(a)oracle.com>
> > > > >
> > > > > HID_PICOLCD should depend on LCD_CLASS_DEVICE, otherwise the
> > > > > build fails when HID_PICOLCD=y and LCD_CLASS_DEVICE=m:
> > > > >
> > > > > hid-picolcd.c:(.text+0x84523f): undefined reference to `lcd_device_unregister'
> > > > > hid-picolcd.c:(.text+0x8478ab): undefined reference to `lcd_device_register'
> > > > > hid-picolcd.c:(.text+0x84c15f): undefined reference to `lcd_device_unregister'
> > >
> > > That is weird, the
> > >
> > > #if defined(CONFIG_LCD_CLASS_DEVICE) || defined(CONFIG_LCD_CLASS_DEVICE_MODULE)
> > > feature support code
> > > #else
> > > empty stubs
> > > #endif
> > >
> > > blocks should have prevented LCD_CLASS support from being built if it
> > > was not enabled in configuration.
> > >
> > > Do you have the .config matching your build?
> >
> > Yes, it's attached.
>
> Thanks, here is the extract (only the pertinent items):
> CONFIG_BACKLIGHT_LCD_SUPPORT=y
> CONFIG_LCD_CLASS_DEVICE=m
> CONFIG_BACKLIGHT_CLASS_DEVICE=y
> CONFIG_HID_PICOLCD=y
>
> It triggers the issue by having PicoLCD built-in while one of the
> optional dependencies as a module.

Yes, basically what the patch description said.

> Any idea of how this can be solved with kbuild in order to keep the
> dependencies optional?
>
> Something that would satisfy the following pseudocode:
> if CONFIG_HID_PICOLCD == y
> assert(CONFIG_LCD_CLASS_DEVICE != m)
>

If you don't want the kconfig machinery to do that (it appears that you don't),
then I guess that you'll need to expand the source code to handle
CONFIG_LCD_CLASS_DEVICE=y and CONFIG_LCD_CLASS_DEVICE=m differently.
Or only handle them differently if HID_PICOLCD=y. :(


>
> One of my attempts did end up with a circular loop with regard to FB
> (some of the FB drivers did select INPUT)?

(not that I can find)

CONFIG_VT does select INPUT
and CONFIG_DRM_I915 does
select INPUT if ACPI


> I had something like:
>
> config HID_PICOLCD
> tristate ...
>
> config HID_PICOLCD_FB
> bool ...
> depends on HID_PICOLCD
> select FB
> select FB_...
>
> ...
>
> Then in the code I checked for CONFIG_HID_PICOLCD_FB instead of
> (CONFIG_FB or CONFIG_FB_MODULE).



---
~Randy
(re)read Documentation/ManagementStyle
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/