[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tgsuqxirofyrbz4cg2ougwa2auhs57qzlheqj4sbt36rxi4o5r@gfi3mypt2rdv>
Date: Mon, 11 Sep 2023 11:07:38 +0200
From: Jacopo Mondi <jacopo.mondi@...asonboard.com>
To: Biju Das <biju.das.jz@...renesas.com>
Cc: Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
Biju Das <biju.das.au@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH 2/2] media: mt9p031: Drop CONFIG_OF ifdeffery
Hi Biju
On Sun, Sep 10, 2023 at 05:01:26PM +0100, Biju Das wrote:
> Drop of_match_ptr() from mt9p031_i2c_driver and get rid of ugly CONFIG_OF
> if check. This slightly increases the size of mt9p031_i2c_driver on non-OF
> system and shouldn't be an issue.
>
> Add mod_devicetable.h include.
>
> It also allows, in case if needed, to enumerate this device via ACPI with
> PRP0001 magic.
>
> Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@...asonboard.com>
Thanks
j
> ---
> drivers/media/i2c/mt9p031.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
> index 540cb519915c..91d5de5b95f0 100644
> --- a/drivers/media/i2c/mt9p031.c
> +++ b/drivers/media/i2c/mt9p031.c
> @@ -15,6 +15,7 @@
> #include <linux/gpio/consumer.h>
> #include <linux/i2c.h>
> #include <linux/log2.h>
> +#include <linux/mod_devicetable.h>
> #include <linux/module.h>
> #include <linux/of.h>
> #include <linux/of_graph.h>
> @@ -1222,7 +1223,6 @@ static const struct i2c_device_id mt9p031_id[] = {
> };
> MODULE_DEVICE_TABLE(i2c, mt9p031_id);
>
> -#if IS_ENABLED(CONFIG_OF)
> static const struct of_device_id mt9p031_of_match[] = {
> { .compatible = "aptina,mt9p006", .data = (void *)MEDIA_BUS_FMT_SGRBG12_1X12 },
> { .compatible = "aptina,mt9p031", .data = (void *)MEDIA_BUS_FMT_SGRBG12_1X12 },
> @@ -1230,11 +1230,10 @@ static const struct of_device_id mt9p031_of_match[] = {
> { /* sentinel */ }
> };
> MODULE_DEVICE_TABLE(of, mt9p031_of_match);
> -#endif
>
> static struct i2c_driver mt9p031_i2c_driver = {
> .driver = {
> - .of_match_table = of_match_ptr(mt9p031_of_match),
> + .of_match_table = mt9p031_of_match,
> .name = "mt9p031",
> },
> .probe = mt9p031_probe,
> --
> 2.25.1
>
Powered by blists - more mailing lists