All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: leds: as3645a: Add CONFIG_OF support
@ 2018-01-25  7:34 ` Akash Gajjar
  0 siblings, 0 replies; 4+ messages in thread
From: Akash Gajjar @ 2018-01-25  7:34 UTC (permalink / raw)
  Cc: gajjar04akash, Akash Gajjar, Laurent Pinchart,
	Mauro Carvalho Chehab, linux-media, linux-kernel

From: Akash Gajjar <Akash_Gajjar@mentor.com>

Witth this changes, the driver builds with CONFIG_OF support

Signed-off-by: Akash Gajjar <gajjar04akash@gmail.com>
---
 drivers/media/i2c/as3645a.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/media/i2c/as3645a.c b/drivers/media/i2c/as3645a.c
index af5db71..24233fa 100644
--- a/drivers/media/i2c/as3645a.c
+++ b/drivers/media/i2c/as3645a.c
@@ -858,6 +858,14 @@ static int as3645a_remove(struct i2c_client *client)
 };
 MODULE_DEVICE_TABLE(i2c, as3645a_id_table);
 
+#if IS_ENABLED(CONFIG_OF)
+static const struct of_device_id as3645a_of_match[] = {
+	{ .compatible = "ams,as3645a", },
+	{ /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, as3645a_of_match);
+#endif
+
 static const struct dev_pm_ops as3645a_pm_ops = {
 	.suspend = as3645a_suspend,
 	.resume = as3645a_resume,
@@ -867,6 +875,7 @@ static int as3645a_remove(struct i2c_client *client)
 	.driver	= {
 		.name = AS3645A_NAME,
 		.pm   = &as3645a_pm_ops,
+		.of_match_table = of_match_ptr(as3645a_of_match),
 	},
 	.probe	= as3645a_probe,
 	.remove	= as3645a_remove,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] media: leds: as3645a: Add CONFIG_OF support
@ 2018-01-25  7:34 ` Akash Gajjar
  0 siblings, 0 replies; 4+ messages in thread
From: Akash Gajjar @ 2018-01-25  7:34 UTC (permalink / raw)
  Cc: gajjar04akash, Akash Gajjar, Laurent Pinchart,
	Mauro Carvalho Chehab, linux-media, linux-kernel

From: Akash Gajjar <Akash_Gajjar@mentor.com>

Witth this changes, the driver builds with CONFIG_OF support

Signed-off-by: Akash Gajjar <gajjar04akash@gmail.com>
---
 drivers/media/i2c/as3645a.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/media/i2c/as3645a.c b/drivers/media/i2c/as3645a.c
index af5db71..24233fa 100644
--- a/drivers/media/i2c/as3645a.c
+++ b/drivers/media/i2c/as3645a.c
@@ -858,6 +858,14 @@ static int as3645a_remove(struct i2c_client *client)
 };
 MODULE_DEVICE_TABLE(i2c, as3645a_id_table);
 
+#if IS_ENABLED(CONFIG_OF)
+static const struct of_device_id as3645a_of_match[] = {
+	{ .compatible = "ams,as3645a", },
+	{ /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, as3645a_of_match);
+#endif
+
 static const struct dev_pm_ops as3645a_pm_ops = {
 	.suspend = as3645a_suspend,
 	.resume = as3645a_resume,
@@ -867,6 +875,7 @@ static int as3645a_remove(struct i2c_client *client)
 	.driver	= {
 		.name = AS3645A_NAME,
 		.pm   = &as3645a_pm_ops,
+		.of_match_table = of_match_ptr(as3645a_of_match),
 	},
 	.probe	= as3645a_probe,
 	.remove	= as3645a_remove,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: leds: as3645a: Add CONFIG_OF support
  2018-01-25  7:34 ` Akash Gajjar
  (?)
@ 2018-01-25  8:41 ` Laurent Pinchart
  -1 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2018-01-25  8:41 UTC (permalink / raw)
  To: Akash Gajjar
  Cc: Akash Gajjar, Mauro Carvalho Chehab, linux-media, linux-kernel

Hi Akash,

Thank you for the patch.

On Thursday, 25 January 2018 09:34:36 EET Akash Gajjar wrote:
> From: Akash Gajjar <Akash_Gajjar@mentor.com>
> 
> Witth this changes, the driver builds with CONFIG_OF support

Does the driver fail to build with CONFIG_OF at the moment ?

> Signed-off-by: Akash Gajjar <gajjar04akash@gmail.com>
> ---
>  drivers/media/i2c/as3645a.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/media/i2c/as3645a.c b/drivers/media/i2c/as3645a.c
> index af5db71..24233fa 100644
> --- a/drivers/media/i2c/as3645a.c
> +++ b/drivers/media/i2c/as3645a.c
> @@ -858,6 +858,14 @@ static int as3645a_remove(struct i2c_client *client)
>  };
>  MODULE_DEVICE_TABLE(i2c, as3645a_id_table);
> 
> +#if IS_ENABLED(CONFIG_OF)
> +static const struct of_device_id as3645a_of_match[] = {
> +	{ .compatible = "ams,as3645a", },

As far as I know I2C can match the compatible string's device name after the 
comma with the I2C device IDs table without requiring an of_device_id array.

Furthermore, given the following check

        if (client->dev.platform_data == NULL)
                return -ENODEV;

at the beginning of the probe function, I doubt the driver will be functional.

> +	{ /* sentinel */ },
> +};
> +MODULE_DEVICE_TABLE(of, as3645a_of_match);
> +#endif
> +
>  static const struct dev_pm_ops as3645a_pm_ops = {
>  	.suspend = as3645a_suspend,
>  	.resume = as3645a_resume,
> @@ -867,6 +875,7 @@ static int as3645a_remove(struct i2c_client *client)
>  	.driver	= {
>  		.name = AS3645A_NAME,
>  		.pm   = &as3645a_pm_ops,
> +		.of_match_table = of_match_ptr(as3645a_of_match),
>  	},
>  	.probe	= as3645a_probe,
>  	.remove	= as3645a_remove,

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] media: leds: as3645a: Add CONFIG_OF support
  2018-01-25  7:34 ` Akash Gajjar
  (?)
  (?)
@ 2018-01-25 10:52 ` Sakari Ailus
  -1 siblings, 0 replies; 4+ messages in thread
From: Sakari Ailus @ 2018-01-25 10:52 UTC (permalink / raw)
  To: Akash Gajjar
  Cc: Akash Gajjar, Laurent Pinchart, Mauro Carvalho Chehab,
	linux-media, linux-kernel

Hi Akash,

On Thu, Jan 25, 2018 at 01:04:36PM +0530, Akash Gajjar wrote:
> From: Akash Gajjar <Akash_Gajjar@mentor.com>
> 
> Witth this changes, the driver builds with CONFIG_OF support
> 
> Signed-off-by: Akash Gajjar <gajjar04akash@gmail.com>

Sorry; this driver has been removed in favour of the LED framework driver
for the same device. It can be found in drivers/leds/leds-as3645a.c

-- 
Regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-25 10:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-25  7:34 [PATCH] media: leds: as3645a: Add CONFIG_OF support Akash Gajjar
2018-01-25  7:34 ` Akash Gajjar
2018-01-25  8:41 ` Laurent Pinchart
2018-01-25 10:52 ` Sakari Ailus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.