* [PATCH] media: mt9m111: fix fw-node refactoring
@ 2019-06-03 20:01 Robert Jarzmik
2019-06-20 10:17 ` Sakari Ailus
0 siblings, 1 reply; 4+ messages in thread
From: Robert Jarzmik @ 2019-06-03 20:01 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Enrico Scholz
Cc: linux-media, linux-kernel, Robert Jarzmik
In the patch refactoring the fw-node, the mt9m111 was broken for all
platform_data based platforms, which were the first aim of this
driver. Only the devicetree platform are still functional, probably
because the testing was done on these.
The result is that -EINVAL is systematically return for such platforms,
what this patch fixes.
Fixes: 98480d65c48c ("media: mt9m111: allow to setup pixclk polarity")
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
drivers/media/i2c/mt9m111.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c
index 168a5c74f368..d65c23301498 100644
--- a/drivers/media/i2c/mt9m111.c
+++ b/drivers/media/i2c/mt9m111.c
@@ -1209,7 +1209,7 @@ static int mt9m111_probe(struct i2c_client *client,
{
struct mt9m111 *mt9m111;
struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
- int ret;
+ int ret = 0;
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) {
dev_warn(&adapter->dev,
@@ -1221,7 +1221,8 @@ static int mt9m111_probe(struct i2c_client *client,
if (!mt9m111)
return -ENOMEM;
- ret = mt9m111_probe_fw(client, mt9m111);
+ if (client->dev.of_node)
+ ret = mt9m111_probe_fw(client, mt9m111);
if (ret)
return ret;
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] media: mt9m111: fix fw-node refactoring 2019-06-03 20:01 [PATCH] media: mt9m111: fix fw-node refactoring Robert Jarzmik @ 2019-06-20 10:17 ` Sakari Ailus 2019-06-20 12:35 ` Sakari Ailus 0 siblings, 1 reply; 4+ messages in thread From: Sakari Ailus @ 2019-06-20 10:17 UTC (permalink / raw) To: Robert Jarzmik Cc: Mauro Carvalho Chehab, Enrico Scholz, linux-media, linux-kernel Hi Robert, On Mon, Jun 03, 2019 at 10:01:55PM +0200, Robert Jarzmik wrote: > In the patch refactoring the fw-node, the mt9m111 was broken for all > platform_data based platforms, which were the first aim of this > driver. Only the devicetree platform are still functional, probably > because the testing was done on these. > > The result is that -EINVAL is systematically return for such platforms, > what this patch fixes. > > Fixes: 98480d65c48c ("media: mt9m111: allow to setup pixclk polarity") > Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> > --- > drivers/media/i2c/mt9m111.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c > index 168a5c74f368..d65c23301498 100644 > --- a/drivers/media/i2c/mt9m111.c > +++ b/drivers/media/i2c/mt9m111.c > @@ -1209,7 +1209,7 @@ static int mt9m111_probe(struct i2c_client *client, > { > struct mt9m111 *mt9m111; > struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); > - int ret; > + int ret = 0; > > if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_WORD_DATA)) { > dev_warn(&adapter->dev, > @@ -1221,7 +1221,8 @@ static int mt9m111_probe(struct i2c_client *client, > if (!mt9m111) > return -ENOMEM; > > - ret = mt9m111_probe_fw(client, mt9m111); > + if (client->dev.of_node) > + ret = mt9m111_probe_fw(client, mt9m111); > if (ret) > return ret; > This didn't quite apply with the i2c adapter cleanups. I applied it, reworking the ret check, and the patch became: diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c index bd3a51c3b081..9761a6105407 100644 --- a/drivers/media/i2c/mt9m111.c +++ b/drivers/media/i2c/mt9m111.c @@ -1263,9 +1263,11 @@ static int mt9m111_probe(struct i2c_client *client, if (!mt9m111) return -ENOMEM; - ret = mt9m111_probe_fw(client, mt9m111); - if (ret) - return ret; + if (dev_fwnode(client->dev)) { + ret = mt9m111_probe_fw(client, mt9m111); + if (ret) + return ret; + } mt9m111->clk = v4l2_clk_get(&client->dev, "mclk"); if (IS_ERR(mt9m111->clk)) I hope this is fine. -- Kind regards, Sakari Ailus ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] media: mt9m111: fix fw-node refactoring 2019-06-20 10:17 ` Sakari Ailus @ 2019-06-20 12:35 ` Sakari Ailus 2019-06-24 20:03 ` Robert Jarzmik 0 siblings, 1 reply; 4+ messages in thread From: Sakari Ailus @ 2019-06-20 12:35 UTC (permalink / raw) To: Robert Jarzmik Cc: Mauro Carvalho Chehab, Enrico Scholz, linux-media, linux-kernel On Thu, Jun 20, 2019 at 01:17:17PM +0300, Sakari Ailus wrote: > diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c > index bd3a51c3b081..9761a6105407 100644 > --- a/drivers/media/i2c/mt9m111.c > +++ b/drivers/media/i2c/mt9m111.c > @@ -1263,9 +1263,11 @@ static int mt9m111_probe(struct i2c_client *client, > if (!mt9m111) > return -ENOMEM; > > - ret = mt9m111_probe_fw(client, mt9m111); > - if (ret) > - return ret; > + if (dev_fwnode(client->dev)) { &client->dev > + ret = mt9m111_probe_fw(client, mt9m111); > + if (ret) > + return ret; > + } > > mt9m111->clk = v4l2_clk_get(&client->dev, "mclk"); > if (IS_ERR(mt9m111->clk)) -- Sakari Ailus ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] media: mt9m111: fix fw-node refactoring 2019-06-20 12:35 ` Sakari Ailus @ 2019-06-24 20:03 ` Robert Jarzmik 0 siblings, 0 replies; 4+ messages in thread From: Robert Jarzmik @ 2019-06-24 20:03 UTC (permalink / raw) To: Sakari Ailus Cc: Mauro Carvalho Chehab, Enrico Scholz, linux-media, linux-kernel Sakari Ailus <sakari.ailus@iki.fi> writes: > On Thu, Jun 20, 2019 at 01:17:17PM +0300, Sakari Ailus wrote: >> diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c >> index bd3a51c3b081..9761a6105407 100644 >> --- a/drivers/media/i2c/mt9m111.c >> +++ b/drivers/media/i2c/mt9m111.c >> @@ -1263,9 +1263,11 @@ static int mt9m111_probe(struct i2c_client *client, >> if (!mt9m111) >> return -ENOMEM; >> >> - ret = mt9m111_probe_fw(client, mt9m111); >> - if (ret) >> - return ret; >> + if (dev_fwnode(client->dev)) { > > &client->dev > >> + ret = mt9m111_probe_fw(client, mt9m111); >> + if (ret) >> + return ret; >> + } >> >> mt9m111->clk = v4l2_clk_get(&client->dev, "mclk"); >> if (IS_ERR(mt9m111->clk)) Sure, you can take the patch as yours, or sign off my modified patch, whatever pleases you. Cheers. -- Robert ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-24 20:03 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-06-03 20:01 [PATCH] media: mt9m111: fix fw-node refactoring Robert Jarzmik 2019-06-20 10:17 ` Sakari Ailus 2019-06-20 12:35 ` Sakari Ailus 2019-06-24 20:03 ` Robert Jarzmik
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox