2010-02-26 12:22:25

by Bruno Prémont

[permalink] [raw]
Subject: [PATCH] backlight, classmate-laptop: fix missing registration failure handling

Check newly registered backlight_device for error and properly
return error to parent.
Mark struct backlight_ops as const.

Signed-off-by: Bruno Prémont <[email protected]>
---
drivers/platform/x86/classmate-laptop.c | 2 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
index bfae789..66f6aad 100644
--- a/drivers/platform/x86/classmate-laptop.c
+++ b/drivers/platform/x86/classmate-laptop.c
@@ -452,7 +452,7 @@ static int cmpc_bl_update_status(struct backlight_device *bd)
return -1;
}

-static struct backlight_ops cmpc_bl_ops = {
+static const struct backlight_ops cmpc_bl_ops = {
.get_brightness = cmpc_bl_get_brightness,
.update_status = cmpc_bl_update_status
};
@@ -463,6 +463,8 @@ static int cmpc_bl_add(struct acpi_device *acpi)

bd = backlight_device_register("cmpc_bl", &acpi->dev,
acpi->handle, &cmpc_bl_ops);
+ if (IS_ERR(bd))
+ return PTR_ERR(bd);
bd->props.max_brightness = 7;
dev_set_drvdata(&acpi->dev, bd);
return 0;
--
1.6.4.4


Subject: Re: [PATCH] backlight, classmate-laptop: fix missing registration failure handling

Mathew,

Please apply the following patch.

Acked-by: Thadeu Lima de Souza Cascardo <[email protected]>

On Fri, Feb 26, 2010 at 12:59:39PM +0100, Bruno Prémont wrote:
> Check newly registered backlight_device for error and properly
> return error to parent.
> Mark struct backlight_ops as const.
>
> Signed-off-by: Bruno Prémont <[email protected]>
> ---
> drivers/platform/x86/classmate-laptop.c | 2 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
> index bfae789..66f6aad 100644
> --- a/drivers/platform/x86/classmate-laptop.c
> +++ b/drivers/platform/x86/classmate-laptop.c
> @@ -452,7 +452,7 @@ static int cmpc_bl_update_status(struct backlight_device *bd)
> return -1;
> }
>
> -static struct backlight_ops cmpc_bl_ops = {
> +static const struct backlight_ops cmpc_bl_ops = {
> .get_brightness = cmpc_bl_get_brightness,
> .update_status = cmpc_bl_update_status
> };
> @@ -463,6 +463,8 @@ static int cmpc_bl_add(struct acpi_device *acpi)
>
> bd = backlight_device_register("cmpc_bl", &acpi->dev,
> acpi->handle, &cmpc_bl_ops);
> + if (IS_ERR(bd))
> + return PTR_ERR(bd);
> bd->props.max_brightness = 7;
> dev_set_drvdata(&acpi->dev, bd);
> return 0;
> --
> 1.6.4.4
>


Attachments:
(No filename) (1.31 kB)
signature.asc (198.00 B)
Digital signature
Download all attachments

2010-02-26 16:33:01

by Matthew Garrett

[permalink] [raw]
Subject: Re: [PATCH] backlight, classmate-laptop: fix missing registration failure handling

If Richard applies my patch to rework backlight registration, this won't
apply. Richard, what's the situation there?

--
Matthew Garrett | [email protected]

2010-02-26 16:45:37

by Richard Purdie

[permalink] [raw]
Subject: Re: [PATCH] backlight, classmate-laptop: fix missing registration failure handling

On Fri, 2010-02-26 at 16:32 +0000, Matthew Garrett wrote:
> If Richard applies my patch to rework backlight registration, this won't
> apply. Richard, what's the situation there?

Your patch has priority, publishing new patches at this point in time is
getting a bit late.

Cheers,

Richard

2010-02-26 22:26:23

by Bruno Prémont

[permalink] [raw]
Subject: Re: [PATCH] backlight, classmate-laptop: fix missing registration failure handling

Hi Richard,

On Fri, 26 February 2010 Richard Purdie <[email protected]> wrote:
> On Fri, 2010-02-26 at 16:32 +0000, Matthew Garrett wrote:
> > If Richard applies my patch to rework backlight registration, this
> > won't apply. Richard, what's the situation there?
>
> Your patch has priority, publishing new patches at this point in time
> is getting a bit late.

I've been resending them, though I got no feedback from you on first
submission about a week ago. (on any of the backlight patches, so
I'm wondering if they reached you at all...)

Regards,
Bruno