Re: [PATCH] leds-alix2: add support for button connected to J15

From: Daniel Mack
Date: Tue Oct 20 2009 - 06:14:19 EST


Hi Dmitry,

On Mon, Oct 19, 2009 at 06:38:53PM -0700, Dmitry Torokhov wrote:
> On Mon, Oct 19, 2009 at 09:37:28AM +0200, Daniel Mack wrote:
> > +#else
> > +#define alix_button_register() (0)
> > +#endif
> > +
> > static int __init alix_led_probe(struct platform_device *pdev)
> > {
> > int i;
> > @@ -89,6 +139,11 @@ static int __init alix_led_probe(struct platform_device *pdev)
> > if (ret < 0)
> > goto fail;
> > }
> > +
> > + ret = alix_button_register();
> > + if (ret)
> > + goto fail;
> > +
> > return 0;
> >
> > fail:
> > @@ -103,6 +158,10 @@ static int alix_led_remove(struct platform_device *pdev)
> >
> > for (i = 0; i < ARRAY_SIZE(alix_leds); i++)
> > led_classdev_unregister(&alix_leds[i].cdev);
> > +
> > + if (ipdev)
> > + input_unregister_polled_device(ipdev);
> > +
>
>
> I think it will bomb on !CONFIG_LEDS_ALIX2_BUTTON... You need
> alix_button_register() and a dummy wrapper for it as well.

There is one actually - lazyly implemented as #define in this case. But
you're right, it does bomb, but due to an undefined reference to ipdev
in alix_led_remove(). Below is a new patch the finally works fine for
both configs.

Daniel