diff mbox

[RFC,2/4] sh: ecovec24: conditionally register backlight device

Message ID 20180315224202.96668-3-dmitry.torokhov@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dmitry Torokhov March 15, 2018, 10:42 p.m. UTC
Commit fe79f919f47e ("sh: ecovec24: Use gpio-backlight") removed custom
backlight support and switched over to generic gpio-backlight driver. The
comment when we run with DVI states "no backlight", but setting
gpio_backlight_data.fbdev to NULL actually makes gpio-backlight to react to
events from any framebuffer device, not ignore them.

We want to get rid of platform data in favor of generic device properties
in gpio_backlight driver, so we can not have kernel pointers passed around
to tie the framebuffer device to backlight. Assuming that the intent of the
above referenced commit was to indeed not export backlight when using DVI,
let's switch to conditionally registering backlight device so it is not
present at all in DVI case.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 arch/sh/boards/mach-ecovec24/setup.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

Comments

Jacopo Mondi March 16, 2018, 10:07 a.m. UTC | #1
Hello Dmitry

FYI I am brushing the ecovec board these days as well
https://www.spinics.net/lists/linux-sh/msg52536.html

And I have a board to test with but without any display panel, I'm
afraid.

On Thu, Mar 15, 2018 at 03:42:00PM -0700, Dmitry Torokhov wrote:
> Commit fe79f919f47e ("sh: ecovec24: Use gpio-backlight") removed custom
> backlight support and switched over to generic gpio-backlight driver. The
> comment when we run with DVI states "no backlight", but setting
> gpio_backlight_data.fbdev to NULL actually makes gpio-backlight to react to
> events from any framebuffer device, not ignore them.
>
> We want to get rid of platform data in favor of generic device properties
> in gpio_backlight driver, so we can not have kernel pointers passed around
> to tie the framebuffer device to backlight. Assuming that the intent of the
> above referenced commit was to indeed not export backlight when using DVI,
> let's switch to conditionally registering backlight device so it is not
> present at all in DVI case.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>  arch/sh/boards/mach-ecovec24/setup.c | 24 +++++++++++++++++-------
>  1 file changed, 17 insertions(+), 7 deletions(-)
>
> diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
> index 6f929abe0b50f..67633d2d42390 100644
> --- a/arch/sh/boards/mach-ecovec24/setup.c
> +++ b/arch/sh/boards/mach-ecovec24/setup.c
> @@ -368,7 +368,6 @@ static struct platform_device lcdc_device = {
>  };
>
>  static struct gpio_backlight_platform_data gpio_backlight_data = {
> -	.fbdev = &lcdc_device.dev,
>  	.gpio = GPIO_PTR1,
>  	.def_value = 1,
>  	.name = "backlight",
> @@ -987,7 +986,6 @@ static struct platform_device *ecovec_devices[] __initdata = {
>  	&usb1_common_device,
>  	&usbhs_device,
>  	&lcdc_device,
> -	&gpio_backlight_device,
>  	&ceu0_device,
>  	&ceu1_device,
>  	&keysc_device,
> @@ -1077,6 +1075,8 @@ static int __init arch_setup(void)
>  {
>  	struct clk *clk;
>  	bool cn12_enabled = false;
> +	bool use_backlight = false;
> +	int error;
>
>  	/* register board specific self-refresh code */
>  	sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
> @@ -1193,9 +1193,6 @@ static int __init arch_setup(void)
>  		lcdc_info.ch[0].lcd_modes		= ecovec_dvi_modes;
>  		lcdc_info.ch[0].num_modes		= ARRAY_SIZE(ecovec_dvi_modes);
>
> -		/* No backlight */
> -		gpio_backlight_data.fbdev = NULL;
> -
>  		gpio_set_value(GPIO_PTA2, 1);
>  		gpio_set_value(GPIO_PTU1, 1);
>  	} else {
> @@ -1217,6 +1214,8 @@ static int __init arch_setup(void)
>  		/* enable TouchScreen */
>  		i2c_register_board_info(0, &ts_i2c_clients, 1);
>  		irq_set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
> +
> +		use_backlight = true;
>  	}
>
>  	/* enable CEU0 */
> @@ -1431,8 +1430,19 @@ static int __init arch_setup(void)
>  	gpio_set_value(GPIO_PTG4, 1);
>  #endif
>
> -	return platform_add_devices(ecovec_devices,
> -				    ARRAY_SIZE(ecovec_devices));
> +	error = platform_add_devices(ecovec_devices,
> +				      ARRAY_SIZE(ecovec_devices));

I would invert this.
Register the backlight first, then all other devices.


> +	if (error)
> +		return error;
> +
> +	if (use_backlight) {
> +		error = platform_device_add(&gpio_backlight_device);
> +		if (error)
> +			pr_warn("%s: failed to register backlight: %d\n",
> +				error);

Could you use dev_warn here? Also the format is wrong, I assume you
are missing a '__func__' as second function argument.

Also, you may want to return error.

Thanks
   j

> +	}
> +
> +	return 0;
>  }
>  arch_initcall(arch_setup);
>
> --
> 2.16.2.804.g6dcf76e118-goog
>
Dmitry Torokhov March 16, 2018, 11:38 p.m. UTC | #2
Hi Jacopo,

On Fri, Mar 16, 2018 at 11:07:48AM +0100, jacopo mondi wrote:
> Hello Dmitry
> 
> FYI I am brushing the ecovec board these days as well
> https://www.spinics.net/lists/linux-sh/msg52536.html
> 

What is the ecovec board BTW? Is it some devkit or what? It seems quite
old to me.

> And I have a board to test with but without any display panel, I'm
> afraid.
> 
> On Thu, Mar 15, 2018 at 03:42:00PM -0700, Dmitry Torokhov wrote:
> > Commit fe79f919f47e ("sh: ecovec24: Use gpio-backlight") removed custom
> > backlight support and switched over to generic gpio-backlight driver. The
> > comment when we run with DVI states "no backlight", but setting
> > gpio_backlight_data.fbdev to NULL actually makes gpio-backlight to react to
> > events from any framebuffer device, not ignore them.
> >
> > We want to get rid of platform data in favor of generic device properties
> > in gpio_backlight driver, so we can not have kernel pointers passed around
> > to tie the framebuffer device to backlight. Assuming that the intent of the
> > above referenced commit was to indeed not export backlight when using DVI,
> > let's switch to conditionally registering backlight device so it is not
> > present at all in DVI case.
> >
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > ---
> >  arch/sh/boards/mach-ecovec24/setup.c | 24 +++++++++++++++++-------
> >  1 file changed, 17 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
> > index 6f929abe0b50f..67633d2d42390 100644
> > --- a/arch/sh/boards/mach-ecovec24/setup.c
> > +++ b/arch/sh/boards/mach-ecovec24/setup.c
> > @@ -368,7 +368,6 @@ static struct platform_device lcdc_device = {
> >  };
> >
> >  static struct gpio_backlight_platform_data gpio_backlight_data = {
> > -	.fbdev = &lcdc_device.dev,
> >  	.gpio = GPIO_PTR1,
> >  	.def_value = 1,
> >  	.name = "backlight",
> > @@ -987,7 +986,6 @@ static struct platform_device *ecovec_devices[] __initdata = {
> >  	&usb1_common_device,
> >  	&usbhs_device,
> >  	&lcdc_device,
> > -	&gpio_backlight_device,
> >  	&ceu0_device,
> >  	&ceu1_device,
> >  	&keysc_device,
> > @@ -1077,6 +1075,8 @@ static int __init arch_setup(void)
> >  {
> >  	struct clk *clk;
> >  	bool cn12_enabled = false;
> > +	bool use_backlight = false;
> > +	int error;
> >
> >  	/* register board specific self-refresh code */
> >  	sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
> > @@ -1193,9 +1193,6 @@ static int __init arch_setup(void)
> >  		lcdc_info.ch[0].lcd_modes		= ecovec_dvi_modes;
> >  		lcdc_info.ch[0].num_modes		= ARRAY_SIZE(ecovec_dvi_modes);
> >
> > -		/* No backlight */
> > -		gpio_backlight_data.fbdev = NULL;
> > -
> >  		gpio_set_value(GPIO_PTA2, 1);
> >  		gpio_set_value(GPIO_PTU1, 1);
> >  	} else {
> > @@ -1217,6 +1214,8 @@ static int __init arch_setup(void)
> >  		/* enable TouchScreen */
> >  		i2c_register_board_info(0, &ts_i2c_clients, 1);
> >  		irq_set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
> > +
> > +		use_backlight = true;
> >  	}
> >
> >  	/* enable CEU0 */
> > @@ -1431,8 +1430,19 @@ static int __init arch_setup(void)
> >  	gpio_set_value(GPIO_PTG4, 1);
> >  #endif
> >
> > -	return platform_add_devices(ecovec_devices,
> > -				    ARRAY_SIZE(ecovec_devices));
> > +	error = platform_add_devices(ecovec_devices,
> > +				      ARRAY_SIZE(ecovec_devices));
> 
> I would invert this.
> Register the backlight first, then all other devices.

We could do that, but why would that be better?

> 
> 
> > +	if (error)
> > +		return error;
> > +
> > +	if (use_backlight) {
> > +		error = platform_device_add(&gpio_backlight_device);
> > +		if (error)
> > +			pr_warn("%s: failed to register backlight: %d\n",
> > +				error);
> 
> Could you use dev_warn here? Also the format is wrong, I assume you

I would rather not, as the backlight device would be in unknown state
here, and using dev_warn with device that has not been fully registered
does not give any benefits. There is also no ambiguity as there is only
one backlight.

> are missing a '__func__' as second function argument.

I'll fix this.

> 
> Also, you may want to return error.

How would caller handle this error? Should we kill all successfully
registered devices on error adding backlight?

Thanks.
Jacopo Mondi March 17, 2018, 9:25 a.m. UTC | #3
Hi Dmitry,

On Fri, Mar 16, 2018 at 04:38:00PM -0700, Dmitry Torokhov wrote:
> Hi Jacopo,
> 
> On Fri, Mar 16, 2018 at 11:07:48AM +0100, jacopo mondi wrote:
> > Hello Dmitry
> > 
> > FYI I am brushing the ecovec board these days as well
> > https://www.spinics.net/lists/linux-sh/msg52536.html
> > 
> 
> What is the ecovec board BTW? Is it some devkit or what? It seems quite
> old to me.

Yes, it is a SuperH 4 based development board. It is old for sure. I'm
also working on removing some stuff the ecovec board file is the only
user of...

> > And I have a board to test with but without any display panel, I'm
> > afraid.
> > 
> > On Thu, Mar 15, 2018 at 03:42:00PM -0700, Dmitry Torokhov wrote:
> > > Commit fe79f919f47e ("sh: ecovec24: Use gpio-backlight") removed custom
> > > backlight support and switched over to generic gpio-backlight driver. The
> > > comment when we run with DVI states "no backlight", but setting
> > > gpio_backlight_data.fbdev to NULL actually makes gpio-backlight to react to
> > > events from any framebuffer device, not ignore them.
> > >
> > > We want to get rid of platform data in favor of generic device properties
> > > in gpio_backlight driver, so we can not have kernel pointers passed around
> > > to tie the framebuffer device to backlight. Assuming that the intent of the
> > > above referenced commit was to indeed not export backlight when using DVI,
> > > let's switch to conditionally registering backlight device so it is not
> > > present at all in DVI case.
> > >
> > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > > ---
> > >  arch/sh/boards/mach-ecovec24/setup.c | 24 +++++++++++++++++-------
> > >  1 file changed, 17 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
> > > index 6f929abe0b50f..67633d2d42390 100644
> > > --- a/arch/sh/boards/mach-ecovec24/setup.c
> > > +++ b/arch/sh/boards/mach-ecovec24/setup.c
> > > @@ -368,7 +368,6 @@ static struct platform_device lcdc_device = {
> > >  };
> > >
> > >  static struct gpio_backlight_platform_data gpio_backlight_data = {
> > > -	.fbdev = &lcdc_device.dev,
> > >  	.gpio = GPIO_PTR1,
> > >  	.def_value = 1,
> > >  	.name = "backlight",
> > > @@ -987,7 +986,6 @@ static struct platform_device *ecovec_devices[] __initdata = {
> > >  	&usb1_common_device,
> > >  	&usbhs_device,
> > >  	&lcdc_device,
> > > -	&gpio_backlight_device,
> > >  	&ceu0_device,
> > >  	&ceu1_device,
> > >  	&keysc_device,
> > > @@ -1077,6 +1075,8 @@ static int __init arch_setup(void)
> > >  {
> > >  	struct clk *clk;
> > >  	bool cn12_enabled = false;
> > > +	bool use_backlight = false;
> > > +	int error;
> > >
> > >  	/* register board specific self-refresh code */
> > >  	sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
> > > @@ -1193,9 +1193,6 @@ static int __init arch_setup(void)
> > >  		lcdc_info.ch[0].lcd_modes		= ecovec_dvi_modes;
> > >  		lcdc_info.ch[0].num_modes		= ARRAY_SIZE(ecovec_dvi_modes);
> > >
> > > -		/* No backlight */
> > > -		gpio_backlight_data.fbdev = NULL;
> > > -
> > >  		gpio_set_value(GPIO_PTA2, 1);
> > >  		gpio_set_value(GPIO_PTU1, 1);
> > >  	} else {
> > > @@ -1217,6 +1214,8 @@ static int __init arch_setup(void)
> > >  		/* enable TouchScreen */
> > >  		i2c_register_board_info(0, &ts_i2c_clients, 1);
> > >  		irq_set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
> > > +
> > > +		use_backlight = true;
> > >  	}
> > >
> > >  	/* enable CEU0 */
> > > @@ -1431,8 +1430,19 @@ static int __init arch_setup(void)
> > >  	gpio_set_value(GPIO_PTG4, 1);
> > >  #endif
> > >
> > > -	return platform_add_devices(ecovec_devices,
> > > -				    ARRAY_SIZE(ecovec_devices));
> > > +	error = platform_add_devices(ecovec_devices,
> > > +				      ARRAY_SIZE(ecovec_devices));
> > 
> > I would invert this.
> > Register the backlight first, then all other devices.
> 
> We could do that, but why would that be better?
> 

That if backlight device registration fails we do not register all
other devices. But yes that may be a bit too harsh, isn't it?

> > 
> > 
> > > +	if (error)
> > > +		return error;
> > > +
> > > +	if (use_backlight) {
> > > +		error = platform_device_add(&gpio_backlight_device);
> > > +		if (error)
> > > +			pr_warn("%s: failed to register backlight: %d\n",
> > > +				error);
> > 
> > Could you use dev_warn here? Also the format is wrong, I assume you
> 
> I would rather not, as the backlight device would be in unknown state
> here, and using dev_warn with device that has not been fully registered
> does not give any benefits. There is also no ambiguity as there is only
> one backlight.

You are very correct, sorry for the fuss.

> 
> > are missing a '__func__' as second function argument.
> 
> I'll fix this.
> 
> > 
> > Also, you may want to return error.
> 
> How would caller handle this error? Should we kill all successfully
> registered devices on error adding backlight?

As the function returned an error code for 'platform_add_devices()' I
thought we may want to return one as well. That's why I proposed to
invert the registration order :)

All minor nits btw,  sorry for jumping up, I understand this is an
RFC and ecovec board file is not the real juice of this series ;)

Ping me if I can help with testing as I've the board.

Thanks
   j

> 
> Thanks.
> 
> -- 
> Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
John Paul Adrian Glaubitz March 17, 2018, 10:21 a.m. UTC | #4
> On Mar 17, 2018, at 6:25 PM, jacopo mondi <jacopo@jmondi.org> wrote:
> 
> Hi Dmitry,
> 
>> On Fri, Mar 16, 2018 at 04:38:00PM -0700, Dmitry Torokhov wrote:
>> Hi Jacopo,
>> 
>>> On Fri, Mar 16, 2018 at 11:07:48AM +0100, jacopo mondi wrote:
>>> Hello Dmitry
>>> 
>>> FYI I am brushing the ecovec board these days as well
>>> https://www.spinics.net/lists/linux-sh/msg52536.html
>>> 
>> 
>> What is the ecovec board BTW? Is it some devkit or what? It seems quite
>> old to me.
> 
> Yes, it is a SuperH 4 based development board. It is old for sure. I'm
> also working on removing some stuff the ecovec board file is the only
> user of...

Umh, but I’m still using the SH7724 Evovec board. Please don’t remove support for that.

The SuperH port of the Linux kernel is still maintained.

Adrian

> 
>>> And I have a board to test with but without any display panel, I'm
>>> afraid.
>>> 
>>>> On Thu, Mar 15, 2018 at 03:42:00PM -0700, Dmitry Torokhov wrote:
>>>> Commit fe79f919f47e ("sh: ecovec24: Use gpio-backlight") removed custom
>>>> backlight support and switched over to generic gpio-backlight driver. The
>>>> comment when we run with DVI states "no backlight", but setting
>>>> gpio_backlight_data.fbdev to NULL actually makes gpio-backlight to react to
>>>> events from any framebuffer device, not ignore them.
>>>> 
>>>> We want to get rid of platform data in favor of generic device properties
>>>> in gpio_backlight driver, so we can not have kernel pointers passed around
>>>> to tie the framebuffer device to backlight. Assuming that the intent of the
>>>> above referenced commit was to indeed not export backlight when using DVI,
>>>> let's switch to conditionally registering backlight device so it is not
>>>> present at all in DVI case.
>>>> 
>>>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>>>> ---
>>>> arch/sh/boards/mach-ecovec24/setup.c | 24 +++++++++++++++++-------
>>>> 1 file changed, 17 insertions(+), 7 deletions(-)
>>>> 
>>>> diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
>>>> index 6f929abe0b50f..67633d2d42390 100644
>>>> --- a/arch/sh/boards/mach-ecovec24/setup.c
>>>> +++ b/arch/sh/boards/mach-ecovec24/setup.c
>>>> @@ -368,7 +368,6 @@ static struct platform_device lcdc_device = {
>>>> };
>>>> 
>>>> static struct gpio_backlight_platform_data gpio_backlight_data = {
>>>> -    .fbdev = &lcdc_device.dev,
>>>>    .gpio = GPIO_PTR1,
>>>>    .def_value = 1,
>>>>    .name = "backlight",
>>>> @@ -987,7 +986,6 @@ static struct platform_device *ecovec_devices[] __initdata = {
>>>>    &usb1_common_device,
>>>>    &usbhs_device,
>>>>    &lcdc_device,
>>>> -    &gpio_backlight_device,
>>>>    &ceu0_device,
>>>>    &ceu1_device,
>>>>    &keysc_device,
>>>> @@ -1077,6 +1075,8 @@ static int __init arch_setup(void)
>>>> {
>>>>    struct clk *clk;
>>>>    bool cn12_enabled = false;
>>>> +    bool use_backlight = false;
>>>> +    int error;
>>>> 
>>>>    /* register board specific self-refresh code */
>>>>    sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
>>>> @@ -1193,9 +1193,6 @@ static int __init arch_setup(void)
>>>>        lcdc_info.ch[0].lcd_modes        = ecovec_dvi_modes;
>>>>        lcdc_info.ch[0].num_modes        = ARRAY_SIZE(ecovec_dvi_modes);
>>>> 
>>>> -        /* No backlight */
>>>> -        gpio_backlight_data.fbdev = NULL;
>>>> -
>>>>        gpio_set_value(GPIO_PTA2, 1);
>>>>        gpio_set_value(GPIO_PTU1, 1);
>>>>    } else {
>>>> @@ -1217,6 +1214,8 @@ static int __init arch_setup(void)
>>>>        /* enable TouchScreen */
>>>>        i2c_register_board_info(0, &ts_i2c_clients, 1);
>>>>        irq_set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
>>>> +
>>>> +        use_backlight = true;
>>>>    }
>>>> 
>>>>    /* enable CEU0 */
>>>> @@ -1431,8 +1430,19 @@ static int __init arch_setup(void)
>>>>    gpio_set_value(GPIO_PTG4, 1);
>>>> #endif
>>>> 
>>>> -    return platform_add_devices(ecovec_devices,
>>>> -                    ARRAY_SIZE(ecovec_devices));
>>>> +    error = platform_add_devices(ecovec_devices,
>>>> +                      ARRAY_SIZE(ecovec_devices));
>>> 
>>> I would invert this.
>>> Register the backlight first, then all other devices.
>> 
>> We could do that, but why would that be better?
>> 
> 
> That if backlight device registration fails we do not register all
> other devices. But yes that may be a bit too harsh, isn't it?
> 
>>> 
>>> 
>>>> +    if (error)
>>>> +        return error;
>>>> +
>>>> +    if (use_backlight) {
>>>> +        error = platform_device_add(&gpio_backlight_device);
>>>> +        if (error)
>>>> +            pr_warn("%s: failed to register backlight: %d\n",
>>>> +                error);
>>> 
>>> Could you use dev_warn here? Also the format is wrong, I assume you
>> 
>> I would rather not, as the backlight device would be in unknown state
>> here, and using dev_warn with device that has not been fully registered
>> does not give any benefits. There is also no ambiguity as there is only
>> one backlight.
> 
> You are very correct, sorry for the fuss.
> 
>> 
>>> are missing a '__func__' as second function argument.
>> 
>> I'll fix this.
>> 
>>> 
>>> Also, you may want to return error.
>> 
>> How would caller handle this error? Should we kill all successfully
>> registered devices on error adding backlight?
> 
> As the function returned an error code for 'platform_add_devices()' I
> thought we may want to return one as well. That's why I proposed to
> invert the registration order :)
> 
> All minor nits btw,  sorry for jumping up, I understand this is an
> RFC and ecovec board file is not the real juice of this series ;)
> 
> Ping me if I can help with testing as I've the board.
> 
> Thanks
>   j
> 
>> 
>> Thanks.
>> 
>> -- 
>> Dmitry
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
dalias@libc.org March 17, 2018, 5:16 p.m. UTC | #5
On Sat, Mar 17, 2018 at 07:21:17PM +0900, John Paul Adrian Glaubitz wrote:
> 
> 
> > On Mar 17, 2018, at 6:25 PM, jacopo mondi <jacopo@jmondi.org> wrote:
> > 
> > Hi Dmitry,
> > 
> >> On Fri, Mar 16, 2018 at 04:38:00PM -0700, Dmitry Torokhov wrote:
> >> Hi Jacopo,
> >> 
> >>> On Fri, Mar 16, 2018 at 11:07:48AM +0100, jacopo mondi wrote:
> >>> Hello Dmitry
> >>> 
> >>> FYI I am brushing the ecovec board these days as well
> >>> https://www.spinics.net/lists/linux-sh/msg52536.html
> >>> 
> >> 
> >> What is the ecovec board BTW? Is it some devkit or what? It seems quite
> >> old to me.
> > 
> > Yes, it is a SuperH 4 based development board. It is old for sure. I'm
> > also working on removing some stuff the ecovec board file is the only
> > user of...
> 
> Umh, but I’m still using the SH7724 Evovec board. Please don’t
> remove support for that.
> 
> The SuperH port of the Linux kernel is still maintained.

Thanks. At some point it would be nice to remove the board file, but
only once the conversion to device tree happens. If anyone has a list
of boards that people are still using or have access to and who can do
testing, it would be nice to compile that somewhere so we can figure
out what needs to be tested and who can test it.

Rich
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dmitry Torokhov March 17, 2018, 5:33 p.m. UTC | #6
On Sat, Mar 17, 2018 at 01:16:31PM -0400, Rich Felker wrote:
> On Sat, Mar 17, 2018 at 07:21:17PM +0900, John Paul Adrian Glaubitz wrote:
> > 
> > 
> > > On Mar 17, 2018, at 6:25 PM, jacopo mondi <jacopo@jmondi.org> wrote:
> > > 
> > > Hi Dmitry,
> > > 
> > >> On Fri, Mar 16, 2018 at 04:38:00PM -0700, Dmitry Torokhov wrote:
> > >> Hi Jacopo,
> > >> 
> > >>> On Fri, Mar 16, 2018 at 11:07:48AM +0100, jacopo mondi wrote:
> > >>> Hello Dmitry
> > >>> 
> > >>> FYI I am brushing the ecovec board these days as well
> > >>> https://www.spinics.net/lists/linux-sh/msg52536.html
> > >>> 
> > >> 
> > >> What is the ecovec board BTW? Is it some devkit or what? It seems quite
> > >> old to me.
> > > 
> > > Yes, it is a SuperH 4 based development board. It is old for sure. I'm
> > > also working on removing some stuff the ecovec board file is the only
> > > user of...
> > 
> > Umh, but I’m still using the SH7724 Evovec board. Please don’t
> > remove support for that.
> > 
> > The SuperH port of the Linux kernel is still maintained.
> 
> Thanks. At some point it would be nice to remove the board file, but
> only once the conversion to device tree happens. If anyone has a list
> of boards that people are still using or have access to and who can do
> testing, it would be nice to compile that somewhere so we can figure
> out what needs to be tested and who can test it.

For me I simply want to remove the custom "pen down" handler for tsc2007
from ecovec24. Unfortunately it seems with the current code you have to
switch from interrupt delivery to GPIO access on the board and it is not
really compatible with common handler and ecovec24 is the only board
that needs this custom handler support. If we can remove it then we can
switch the driver to use generic device properties only.

Note that the driver is still functional without the pendown handler, it
uses alternative methods for detecting lifting the pen, but they are
less reliable. I wonder how many people use ecovec24 with the
touchscreen.

Thanks.
Dmitry Torokhov March 17, 2018, 5:37 p.m. UTC | #7
On Sat, Mar 17, 2018 at 10:25:16AM +0100, jacopo mondi wrote:
> Hi Dmitry,
> 
> On Fri, Mar 16, 2018 at 04:38:00PM -0700, Dmitry Torokhov wrote:
> > Hi Jacopo,
> > 
> > On Fri, Mar 16, 2018 at 11:07:48AM +0100, jacopo mondi wrote:
> > > Hello Dmitry
> > > 
> > > FYI I am brushing the ecovec board these days as well
> > > https://www.spinics.net/lists/linux-sh/msg52536.html
> > > 
> > 
> > What is the ecovec board BTW? Is it some devkit or what? It seems quite
> > old to me.
> 
> Yes, it is a SuperH 4 based development board. It is old for sure. I'm
> also working on removing some stuff the ecovec board file is the only
> user of...
> 
> > > And I have a board to test with but without any display panel, I'm
> > > afraid.
> > > 
> > > On Thu, Mar 15, 2018 at 03:42:00PM -0700, Dmitry Torokhov wrote:
> > > > Commit fe79f919f47e ("sh: ecovec24: Use gpio-backlight") removed custom
> > > > backlight support and switched over to generic gpio-backlight driver. The
> > > > comment when we run with DVI states "no backlight", but setting
> > > > gpio_backlight_data.fbdev to NULL actually makes gpio-backlight to react to
> > > > events from any framebuffer device, not ignore them.
> > > >
> > > > We want to get rid of platform data in favor of generic device properties
> > > > in gpio_backlight driver, so we can not have kernel pointers passed around
> > > > to tie the framebuffer device to backlight. Assuming that the intent of the
> > > > above referenced commit was to indeed not export backlight when using DVI,
> > > > let's switch to conditionally registering backlight device so it is not
> > > > present at all in DVI case.
> > > >
> > > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > > > ---
> > > >  arch/sh/boards/mach-ecovec24/setup.c | 24 +++++++++++++++++-------
> > > >  1 file changed, 17 insertions(+), 7 deletions(-)
> > > >
> > > > diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
> > > > index 6f929abe0b50f..67633d2d42390 100644
> > > > --- a/arch/sh/boards/mach-ecovec24/setup.c
> > > > +++ b/arch/sh/boards/mach-ecovec24/setup.c
> > > > @@ -368,7 +368,6 @@ static struct platform_device lcdc_device = {
> > > >  };
> > > >
> > > >  static struct gpio_backlight_platform_data gpio_backlight_data = {
> > > > -	.fbdev = &lcdc_device.dev,
> > > >  	.gpio = GPIO_PTR1,
> > > >  	.def_value = 1,
> > > >  	.name = "backlight",
> > > > @@ -987,7 +986,6 @@ static struct platform_device *ecovec_devices[] __initdata = {
> > > >  	&usb1_common_device,
> > > >  	&usbhs_device,
> > > >  	&lcdc_device,
> > > > -	&gpio_backlight_device,
> > > >  	&ceu0_device,
> > > >  	&ceu1_device,
> > > >  	&keysc_device,
> > > > @@ -1077,6 +1075,8 @@ static int __init arch_setup(void)
> > > >  {
> > > >  	struct clk *clk;
> > > >  	bool cn12_enabled = false;
> > > > +	bool use_backlight = false;
> > > > +	int error;
> > > >
> > > >  	/* register board specific self-refresh code */
> > > >  	sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
> > > > @@ -1193,9 +1193,6 @@ static int __init arch_setup(void)
> > > >  		lcdc_info.ch[0].lcd_modes		= ecovec_dvi_modes;
> > > >  		lcdc_info.ch[0].num_modes		= ARRAY_SIZE(ecovec_dvi_modes);
> > > >
> > > > -		/* No backlight */
> > > > -		gpio_backlight_data.fbdev = NULL;
> > > > -
> > > >  		gpio_set_value(GPIO_PTA2, 1);
> > > >  		gpio_set_value(GPIO_PTU1, 1);
> > > >  	} else {
> > > > @@ -1217,6 +1214,8 @@ static int __init arch_setup(void)
> > > >  		/* enable TouchScreen */
> > > >  		i2c_register_board_info(0, &ts_i2c_clients, 1);
> > > >  		irq_set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
> > > > +
> > > > +		use_backlight = true;
> > > >  	}
> > > >
> > > >  	/* enable CEU0 */
> > > > @@ -1431,8 +1430,19 @@ static int __init arch_setup(void)
> > > >  	gpio_set_value(GPIO_PTG4, 1);
> > > >  #endif
> > > >
> > > > -	return platform_add_devices(ecovec_devices,
> > > > -				    ARRAY_SIZE(ecovec_devices));
> > > > +	error = platform_add_devices(ecovec_devices,
> > > > +				      ARRAY_SIZE(ecovec_devices));
> > > 
> > > I would invert this.
> > > Register the backlight first, then all other devices.
> > 
> > We could do that, but why would that be better?
> > 
> 
> That if backlight device registration fails we do not register all
> other devices. But yes that may be a bit too harsh, isn't it?

Yes, that was my reasoning. With platform_add_devices() that unwinds all
the devices it created successfully we do not really have any option but
return error (which is either ignored or fatal). Here we can simply warn
and still let the device boot so users have easier way to see what went
wrong.

> 
> > > 
> > > 
> > > > +	if (error)
> > > > +		return error;
> > > > +
> > > > +	if (use_backlight) {
> > > > +		error = platform_device_add(&gpio_backlight_device);
> > > > +		if (error)
> > > > +			pr_warn("%s: failed to register backlight: %d\n",
> > > > +				error);
> > > 
> > > Could you use dev_warn here? Also the format is wrong, I assume you
> > 
> > I would rather not, as the backlight device would be in unknown state
> > here, and using dev_warn with device that has not been fully registered
> > does not give any benefits. There is also no ambiguity as there is only
> > one backlight.
> 
> You are very correct, sorry for the fuss.
> 
> > 
> > > are missing a '__func__' as second function argument.
> > 
> > I'll fix this.
> > 
> > > 
> > > Also, you may want to return error.
> > 
> > How would caller handle this error? Should we kill all successfully
> > registered devices on error adding backlight?
> 
> As the function returned an error code for 'platform_add_devices()' I
> thought we may want to return one as well. That's why I proposed to
> invert the registration order :)
> 
> All minor nits btw,  sorry for jumping up, I understand this is an
> RFC and ecovec board file is not the real juice of this series ;)
> 
> Ping me if I can help with testing as I've the board.

Yes, I'll fix up the other mess ups and I'll post a v2.

Thanks!
John Paul Adrian Glaubitz March 17, 2018, 5:55 p.m. UTC | #8
On 03/18/2018 02:16 AM, Rich Felker wrote:
>> Umh, but I’m still using the SH7724 Evovec board. Please don’t
>> remove support for that.
>>
>> The SuperH port of the Linux kernel is still maintained.
> 
> Thanks. At some point it would be nice to remove the board file, but
> only once the conversion to device tree happens. If anyone has a list
> of boards that people are still using or have access to and who can do
> testing, it would be nice to compile that somewhere so we can figure
> out what needs to be tested and who can test it.

We should maybe create a wiki page somewhere. Either in the kernel wiki
(I don't have an account for that) or the Debian Wiki.

Here's what I still use:

- Renesas SH7724 Evovec
- Renesas SH7786LCR Evaluation Board
- LANDISK SH7751
- Sega Dreamcast (although I currently don't use that)
- NextVoD (currently not in the kernel)

Adrian
Jacopo Mondi March 18, 2018, 10:54 a.m. UTC | #9
Hi Andrian,

On Sat, Mar 17, 2018 at 07:21:17PM +0900, John Paul Adrian Glaubitz wrote:
>
>
> > On Mar 17, 2018, at 6:25 PM, jacopo mondi <jacopo@jmondi.org> wrote:
> >
> > Hi Dmitry,
> >
> >> On Fri, Mar 16, 2018 at 04:38:00PM -0700, Dmitry Torokhov wrote:
> >> Hi Jacopo,
> >>
> >>> On Fri, Mar 16, 2018 at 11:07:48AM +0100, jacopo mondi wrote:
> >>> Hello Dmitry
> >>>
> >>> FYI I am brushing the ecovec board these days as well
> >>> https://www.spinics.net/lists/linux-sh/msg52536.html
> >>>
> >>
> >> What is the ecovec board BTW? Is it some devkit or what? It seems quite
> >> old to me.
> >
> > Yes, it is a SuperH 4 based development board. It is old for sure. I'm
> > also working on removing some stuff the ecovec board file is the only
> > user of...
>
> Umh, but I’m still using the SH7724 Evovec board. Please don’t remove support for that.
>
> The SuperH port of the Linux kernel is still maintained.

Sorry if I was not clear here, it is not anyone's intention to remove any
support for any SH board. The media subsystem is working to replace
some components (the legacy camera drivers) a few SH boards (ecovec
included) are the only remaining user of. Nobody is working to remove
support for those boards.

I have access to a few SH boards, if you're planning to collect that
informations in some wiki, I'll list myself there.

Thanks
   j

>
> Adrian
>
> >
> >>> And I have a board to test with but without any display panel, I'm
> >>> afraid.
> >>>
> >>>> On Thu, Mar 15, 2018 at 03:42:00PM -0700, Dmitry Torokhov wrote:
> >>>> Commit fe79f919f47e ("sh: ecovec24: Use gpio-backlight") removed custom
> >>>> backlight support and switched over to generic gpio-backlight driver. The
> >>>> comment when we run with DVI states "no backlight", but setting
> >>>> gpio_backlight_data.fbdev to NULL actually makes gpio-backlight to react to
> >>>> events from any framebuffer device, not ignore them.
> >>>>
> >>>> We want to get rid of platform data in favor of generic device properties
> >>>> in gpio_backlight driver, so we can not have kernel pointers passed around
> >>>> to tie the framebuffer device to backlight. Assuming that the intent of the
> >>>> above referenced commit was to indeed not export backlight when using DVI,
> >>>> let's switch to conditionally registering backlight device so it is not
> >>>> present at all in DVI case.
> >>>>
> >>>> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> >>>> ---
> >>>> arch/sh/boards/mach-ecovec24/setup.c | 24 +++++++++++++++++-------
> >>>> 1 file changed, 17 insertions(+), 7 deletions(-)
> >>>>
> >>>> diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
> >>>> index 6f929abe0b50f..67633d2d42390 100644
> >>>> --- a/arch/sh/boards/mach-ecovec24/setup.c
> >>>> +++ b/arch/sh/boards/mach-ecovec24/setup.c
> >>>> @@ -368,7 +368,6 @@ static struct platform_device lcdc_device = {
> >>>> };
> >>>>
> >>>> static struct gpio_backlight_platform_data gpio_backlight_data = {
> >>>> -    .fbdev = &lcdc_device.dev,
> >>>>    .gpio = GPIO_PTR1,
> >>>>    .def_value = 1,
> >>>>    .name = "backlight",
> >>>> @@ -987,7 +986,6 @@ static struct platform_device *ecovec_devices[] __initdata = {
> >>>>    &usb1_common_device,
> >>>>    &usbhs_device,
> >>>>    &lcdc_device,
> >>>> -    &gpio_backlight_device,
> >>>>    &ceu0_device,
> >>>>    &ceu1_device,
> >>>>    &keysc_device,
> >>>> @@ -1077,6 +1075,8 @@ static int __init arch_setup(void)
> >>>> {
> >>>>    struct clk *clk;
> >>>>    bool cn12_enabled = false;
> >>>> +    bool use_backlight = false;
> >>>> +    int error;
> >>>>
> >>>>    /* register board specific self-refresh code */
> >>>>    sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
> >>>> @@ -1193,9 +1193,6 @@ static int __init arch_setup(void)
> >>>>        lcdc_info.ch[0].lcd_modes        = ecovec_dvi_modes;
> >>>>        lcdc_info.ch[0].num_modes        = ARRAY_SIZE(ecovec_dvi_modes);
> >>>>
> >>>> -        /* No backlight */
> >>>> -        gpio_backlight_data.fbdev = NULL;
> >>>> -
> >>>>        gpio_set_value(GPIO_PTA2, 1);
> >>>>        gpio_set_value(GPIO_PTU1, 1);
> >>>>    } else {
> >>>> @@ -1217,6 +1214,8 @@ static int __init arch_setup(void)
> >>>>        /* enable TouchScreen */
> >>>>        i2c_register_board_info(0, &ts_i2c_clients, 1);
> >>>>        irq_set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
> >>>> +
> >>>> +        use_backlight = true;
> >>>>    }
> >>>>
> >>>>    /* enable CEU0 */
> >>>> @@ -1431,8 +1430,19 @@ static int __init arch_setup(void)
> >>>>    gpio_set_value(GPIO_PTG4, 1);
> >>>> #endif
> >>>>
> >>>> -    return platform_add_devices(ecovec_devices,
> >>>> -                    ARRAY_SIZE(ecovec_devices));
> >>>> +    error = platform_add_devices(ecovec_devices,
> >>>> +                      ARRAY_SIZE(ecovec_devices));
> >>>
> >>> I would invert this.
> >>> Register the backlight first, then all other devices.
> >>
> >> We could do that, but why would that be better?
> >>
> >
> > That if backlight device registration fails we do not register all
> > other devices. But yes that may be a bit too harsh, isn't it?
> >
> >>>
> >>>
> >>>> +    if (error)
> >>>> +        return error;
> >>>> +
> >>>> +    if (use_backlight) {
> >>>> +        error = platform_device_add(&gpio_backlight_device);
> >>>> +        if (error)
> >>>> +            pr_warn("%s: failed to register backlight: %d\n",
> >>>> +                error);
> >>>
> >>> Could you use dev_warn here? Also the format is wrong, I assume you
> >>
> >> I would rather not, as the backlight device would be in unknown state
> >> here, and using dev_warn with device that has not been fully registered
> >> does not give any benefits. There is also no ambiguity as there is only
> >> one backlight.
> >
> > You are very correct, sorry for the fuss.
> >
> >>
> >>> are missing a '__func__' as second function argument.
> >>
> >> I'll fix this.
> >>
> >>>
> >>> Also, you may want to return error.
> >>
> >> How would caller handle this error? Should we kill all successfully
> >> registered devices on error adding backlight?
> >
> > As the function returned an error code for 'platform_add_devices()' I
> > thought we may want to return one as well. That's why I proposed to
> > invert the registration order :)
> >
> > All minor nits btw,  sorry for jumping up, I understand this is an
> > RFC and ecovec board file is not the real juice of this series ;)
> >
> > Ping me if I can help with testing as I've the board.
> >
> > Thanks
> >   j
> >
> >>
> >> Thanks.
> >>
> >> --
> >> Dmitry
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
John Paul Adrian Glaubitz March 18, 2018, 11:12 a.m. UTC | #10
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi Jacopo!

On 03/18/2018 07:54 PM, jacopo mondi wrote:
> Sorry if I was not clear here, it is not anyone's intention to remove any support for any SH board. The media subsystem is working to replace some
> components (the legacy camera drivers) a few SH boards (ecovec included) are the only remaining user of. Nobody is working to remove support for those
> boards.

Ok, I am very relieved to hear that. I have invested a lot of work and
effort into Debian's SuperH port and I therefore hope we can still
keep it for a while.

FWIW, I will send out free ST-40 SuperH development boxes to anyone
who is is willing to work on the SH kernel :-).

> I have access to a few SH boards, if you're planning to collect that informations in some wiki, I'll list myself there.

I'll find the proper wiki to post this information. I need to figure
out what I need to get an account for the kernel.org wiki.

Adrian

- -- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEYv+KdYTgKVaVRgAGdCY7N/W1+RMFAlquSYcACgkQdCY7N/W1
+RPkZBAAt2dXvx99JoE/X2O3Gsg+v5w682u/bglBBN+IBtFtlE4ARMBrJnyd9I7L
x/a0pDsEBuU1AIy2I6gcLc84ekd1A42qfsh4pISXKhMfDFFVBsxhbk0wbH7tyAqk
EWI7aQsBUVrrDl4pn0CRy0tirRBBabG6U+AiVYVdrxbNBKVMrQlfwf+Y1Ez7fAsP
3gEet5qNYJsQ0ofzQIXIr6i/sXYPL+rovPIRIBsvuvmmaGGvKmbe8PgFehcX1dbj
uPij8bgvfrEcT85hOi3MoCnBd5o1vEbtvfh5aBK4DIIZaAKMXmhDS0fhgQEYerv2
EaxzPkdMmhbd8N5T/DcIbaCoVPPDDDn/PFK1hSwN/lpL4n7ouQPjjA87qwPLbX7o
vfyoAsohtp1qKtepbp+x5CfjCwqeWu7qzaxjUF3tzAorH+wUUDsOKn2dKGHv7Vlr
LtE+IdO2eJPzZpcmZ0e86bn0YNk7ZtVmDMhdyUfbkI4ZkrO3ANJz4Ed+9vJPzAo7
YKZXI1DHJSd33bpAUtNE1Os9DMLqpuMIYxxGPENhEwcvVo5Ftix8NkviHbQxwLbY
GH36VySCqzkYSt6HUavv5W+N9v4T24pvHx9r+D4f6ACiMT17OtVwS5PMjPcARM5/
Ftp3D9JX8ZRMpktGMuUx18Hhm9wnAwhXK28vFoq6u5TLvVkmnu8=
=2O6i
-----END PGP SIGNATURE-----
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 6f929abe0b50f..67633d2d42390 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -368,7 +368,6 @@  static struct platform_device lcdc_device = {
 };
 
 static struct gpio_backlight_platform_data gpio_backlight_data = {
-	.fbdev = &lcdc_device.dev,
 	.gpio = GPIO_PTR1,
 	.def_value = 1,
 	.name = "backlight",
@@ -987,7 +986,6 @@  static struct platform_device *ecovec_devices[] __initdata = {
 	&usb1_common_device,
 	&usbhs_device,
 	&lcdc_device,
-	&gpio_backlight_device,
 	&ceu0_device,
 	&ceu1_device,
 	&keysc_device,
@@ -1077,6 +1075,8 @@  static int __init arch_setup(void)
 {
 	struct clk *clk;
 	bool cn12_enabled = false;
+	bool use_backlight = false;
+	int error;
 
 	/* register board specific self-refresh code */
 	sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
@@ -1193,9 +1193,6 @@  static int __init arch_setup(void)
 		lcdc_info.ch[0].lcd_modes		= ecovec_dvi_modes;
 		lcdc_info.ch[0].num_modes		= ARRAY_SIZE(ecovec_dvi_modes);
 
-		/* No backlight */
-		gpio_backlight_data.fbdev = NULL;
-
 		gpio_set_value(GPIO_PTA2, 1);
 		gpio_set_value(GPIO_PTU1, 1);
 	} else {
@@ -1217,6 +1214,8 @@  static int __init arch_setup(void)
 		/* enable TouchScreen */
 		i2c_register_board_info(0, &ts_i2c_clients, 1);
 		irq_set_irq_type(IRQ0, IRQ_TYPE_LEVEL_LOW);
+
+		use_backlight = true;
 	}
 
 	/* enable CEU0 */
@@ -1431,8 +1430,19 @@  static int __init arch_setup(void)
 	gpio_set_value(GPIO_PTG4, 1);
 #endif
 
-	return platform_add_devices(ecovec_devices,
-				    ARRAY_SIZE(ecovec_devices));
+	error = platform_add_devices(ecovec_devices,
+				      ARRAY_SIZE(ecovec_devices));
+	if (error)
+		return error;
+
+	if (use_backlight) {
+		error = platform_device_add(&gpio_backlight_device);
+		if (error)
+			pr_warn("%s: failed to register backlight: %d\n",
+				error);
+	}
+
+	return 0;
 }
 arch_initcall(arch_setup);