Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] imxfb: correct location of callbacks in suspend and resume

0 views
Skip to first unread message

Uwe Kleine-König

unread,
Jan 25, 2010, 10:40:02 AM1/25/10
to
The probe function passes a pointer to a struct fb_info to
platform_set_drvdata, so don't interpret the return value of
platform_get_drvdata as a pointer to struct imxfb_info.

Signed-off-by: Uwe Kleine-König <u.klein...@pengutronix.de>
Acked-by: Sascha Hauer <ker...@pengutronix.de>
Cc: linux-ar...@lists.infradead.org
---
drivers/video/imxfb.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
index 66358fa..b4b6dec 100644
--- a/drivers/video/imxfb.c
+++ b/drivers/video/imxfb.c
@@ -593,7 +593,8 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
*/
static int imxfb_suspend(struct platform_device *dev, pm_message_t state)
{
- struct imxfb_info *fbi = platform_get_drvdata(dev);
+ struct fb_info *info = platform_get_drvdata(dev);
+ struct imxfb_info *fbi = info->par;

pr_debug("%s\n", __func__);

@@ -603,7 +604,8 @@ static int imxfb_suspend(struct platform_device *dev, pm_message_t state)

static int imxfb_resume(struct platform_device *dev)
{
- struct imxfb_info *fbi = platform_get_drvdata(dev);
+ struct fb_info *info = platform_get_drvdata(dev);
+ struct imxfb_info *fbi = info->par;

pr_debug("%s\n", __func__);

--
1.6.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Andrew Morton

unread,
Jan 27, 2010, 7:00:02 PM1/27/10
to
On Mon, 25 Jan 2010 16:37:34 +0100
Uwe Kleine-K__nig <u.klein...@pengutronix.de> wrote:

> The probe function passes a pointer to a struct fb_info to
> platform_set_drvdata, so don't interpret the return value of
> platform_get_drvdata as a pointer to struct imxfb_info.
>

> Signed-off-by: Uwe Kleine-K__nig <u.klein...@pengutronix.de>


> Acked-by: Sascha Hauer <ker...@pengutronix.de>
> Cc: linux-ar...@lists.infradead.org
> ---
> drivers/video/imxfb.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c
> index 66358fa..b4b6dec 100644
> --- a/drivers/video/imxfb.c
> +++ b/drivers/video/imxfb.c
> @@ -593,7 +593,8 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
> */
> static int imxfb_suspend(struct platform_device *dev, pm_message_t state)
> {
> - struct imxfb_info *fbi = platform_get_drvdata(dev);
> + struct fb_info *info = platform_get_drvdata(dev);
> + struct imxfb_info *fbi = info->par;
>
> pr_debug("%s\n", __func__);
>
> @@ -603,7 +604,8 @@ static int imxfb_suspend(struct platform_device *dev, pm_message_t state)
>
> static int imxfb_resume(struct platform_device *dev)
> {
> - struct imxfb_info *fbi = platform_get_drvdata(dev);
> + struct fb_info *info = platform_get_drvdata(dev);
> + struct imxfb_info *fbi = info->par;
>
> pr_debug("%s\n", __func__);
>

What were the runtime effects of this bug?

Uwe Kleine-König

unread,
Jan 28, 2010, 2:50:02 AM1/28/10
to
Hello,

For me it was that in the original imxfb_info *fbi backlight_power was
NULL but in imxfb_suspend it was 4 resulting in an oops as imxfb_suspend
calls imxfb_disable_controller(fbi) which in turn has

if (fbi->backlight_power)
fbi->backlight_power(0);

.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-K�nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |

Andrew Morton

unread,
Jan 28, 2010, 3:30:01 AM1/28/10
to
On Thu, 28 Jan 2010 08:41:01 +0100 Uwe Kleine-K__nig <u.klein...@pengutronix.de> wrote:

> > What were the runtime effects of this bug?
> For me it was that in the original imxfb_info *fbi backlight_power was
> NULL but in imxfb_suspend it was 4 resulting in an oops as imxfb_suspend
> calls imxfb_disable_controller(fbi) which in turn has
>
> if (fbi->backlight_power)
> fbi->backlight_power(0);

OK, thanks, that was important info.

I rescheduled the patch for 2.6.33 and marked it for 2.6.32.x backporting.

0 new messages