mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Jingoo Han <jg1.han@samsung.com>
Cc: "'LKML'" <linux-kernel@vger.kernel.org>,
	"'Richard Purdie'" <rpurdie@rpsys.net>
Subject: Re: [PATCH] backlight: platform-lcd: Add support for device tree based probe
Date: Fri, 21 Sep 2012 14:52:09 -0700	[thread overview]
Message-ID: <20120921145209.b57cad16.akpm@linux-foundation.org> (raw)
In-Reply-To: <000e01cd9798$370acbd0$a5206370$%han@samsung.com>

On Fri, 21 Sep 2012 10:27:07 +0900
Jingoo Han <jg1.han@samsung.com> wrote:

> This patch adds the of_match_table to platform-lcd driver to be
> probed when platform-lcd device node is found in the device tree.
> 
> Cc: Richard Purdie <rpurdie@rpsys.net>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
> ---
>  drivers/video/backlight/platform_lcd.c |    9 +++++++++
>  1 files changed, 9 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/video/backlight/platform_lcd.c b/drivers/video/backlight/platform_lcd.c
> index b667234..574d5ee 100644
> --- a/drivers/video/backlight/platform_lcd.c
> +++ b/drivers/video/backlight/platform_lcd.c
> @@ -145,6 +145,14 @@ static SIMPLE_DEV_PM_OPS(platform_lcd_pm_ops, platform_lcd_suspend,
>  			platform_lcd_resume);
>  #endif
>  
> +#ifdef CONFIG_OF
> +static const struct of_device_id platform_lcd_of_match[] = {
> +	{ .compatible = "platform-lcd" },
> +	{},
> +};
> +MODULE_DEVICE_TABLE(of, platform_lcd_of_match);
> +#endif
> +
>  static struct platform_driver platform_lcd_driver = {
>  	.driver		= {
>  		.name	= "platform-lcd",
> @@ -152,6 +160,7 @@ static struct platform_driver platform_lcd_driver = {
>  #ifdef CONFIG_PM
>  		.pm	= &platform_lcd_pm_ops,
>  #endif
> +		.of_match_table = of_match_ptr(platform_lcd_of_match),
>  	},
>  	.probe		= platform_lcd_probe,
>  	.remove		= __devexit_p(platform_lcd_remove),

This .c file includes no open-firmware headers.

It does happen to get a copy of of.h via fb.h->i2c.h->of.h, but that
was just luck.

I did this:

--- a/drivers/video/backlight/platform_lcd.c~backlight-platform-lcd-add-support-for-device-tree-based-probe-fix
+++ a/drivers/video/backlight/platform_lcd.c
@@ -16,6 +16,7 @@
 #include <linux/fb.h>
 #include <linux/backlight.h>
 #include <linux/lcd.h>
+#include <linux/of.h>
 #include <linux/slab.h>
 
 #include <video/platform_lcd.h>
_


      reply	other threads:[~2012-09-21 21:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21  1:27 Jingoo Han
2012-09-21 21:52 ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120921145209.b57cad16.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=jg1.han@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome