linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Rockchip ISP1 minor fixes
@ 2020-04-01 21:37 Ezequiel Garcia
  2020-04-01 21:37 ` [PATCH 1/3] rkisp1: Get rid of unused variable warning Ezequiel Garcia
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Ezequiel Garcia @ 2020-04-01 21:37 UTC (permalink / raw)
  To: linux-media, linux-rockchip, linux-kernel
  Cc: kernel, Hans Verkuil, Ezequiel Garcia

A small series of minor fixes I stumbled upon while
doing compile testing.

Patch 1 gets rid of an 'unused variable' warning, triggered
by building without CONFIG_OF.

Patches 2 and 3 cleanup the dependency of phy-rockchip-dphy-rx0
and rkisp1 drivers.

Ezequiel Garcia (3):
  rkisp1: Get rid of unused variable warning
  phy-rockchip-dphy-rx0: Drop unneeded CONFIG_OF dependency
  rkisp1: Fix wrong PHY config dependency

 drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig | 2 +-
 drivers/staging/media/rkisp1/Kconfig                | 2 +-
 drivers/staging/media/rkisp1/rkisp1-dev.c           | 3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)

-- 
2.26.0.rc2


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

* [PATCH 1/3] rkisp1: Get rid of unused variable warning
  2020-04-01 21:37 [PATCH 0/3] Rockchip ISP1 minor fixes Ezequiel Garcia
@ 2020-04-01 21:37 ` Ezequiel Garcia
  2020-04-02  9:47   ` Robin Murphy
  2020-04-02 13:58   ` Helen Koike
  2020-04-01 21:37 ` [PATCH 2/3] phy-rockchip-dphy-rx0: Drop unneeded CONFIG_OF dependency Ezequiel Garcia
  2020-04-01 21:37 ` [PATCH 3/3] rkisp1: Fix wrong PHY config dependency Ezequiel Garcia
  2 siblings, 2 replies; 10+ messages in thread
From: Ezequiel Garcia @ 2020-04-01 21:37 UTC (permalink / raw)
  To: linux-media, linux-rockchip, linux-kernel
  Cc: kernel, Hans Verkuil, Ezequiel Garcia

If CONFIG_OF is not selected, the compiler will complain:

drivers/staging/media/rkisp1/rkisp1-dev.c: In function ‘rkisp1_probe’:
drivers/staging/media/rkisp1/rkisp1-dev.c:457:22: warning: unused variable ‘node’ [-Wunused-variable]
  457 |  struct device_node *node = pdev->dev.of_node;

Rework the code slightly and make the compiler happy.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/staging/media/rkisp1/rkisp1-dev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c
index b1b3c058e957..5e7e797aad71 100644
--- a/drivers/staging/media/rkisp1/rkisp1-dev.c
+++ b/drivers/staging/media/rkisp1/rkisp1-dev.c
@@ -454,7 +454,6 @@ static void rkisp1_debug_init(struct rkisp1_device *rkisp1)
 
 static int rkisp1_probe(struct platform_device *pdev)
 {
-	struct device_node *node = pdev->dev.of_node;
 	const struct rkisp1_match_data *clk_data;
 	const struct of_device_id *match;
 	struct device *dev = &pdev->dev;
@@ -463,7 +462,7 @@ static int rkisp1_probe(struct platform_device *pdev)
 	unsigned int i;
 	int ret, irq;
 
-	match = of_match_node(rkisp1_of_match, node);
+	match = of_match_node(rkisp1_of_match, pdev->dev.of_node);
 	rkisp1 = devm_kzalloc(dev, sizeof(*rkisp1), GFP_KERNEL);
 	if (!rkisp1)
 		return -ENOMEM;
-- 
2.26.0.rc2


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

* [PATCH 2/3] phy-rockchip-dphy-rx0: Drop unneeded CONFIG_OF dependency
  2020-04-01 21:37 [PATCH 0/3] Rockchip ISP1 minor fixes Ezequiel Garcia
  2020-04-01 21:37 ` [PATCH 1/3] rkisp1: Get rid of unused variable warning Ezequiel Garcia
@ 2020-04-01 21:37 ` Ezequiel Garcia
  2020-04-02 13:59   ` Helen Koike
  2020-04-01 21:37 ` [PATCH 3/3] rkisp1: Fix wrong PHY config dependency Ezequiel Garcia
  2 siblings, 1 reply; 10+ messages in thread
From: Ezequiel Garcia @ 2020-04-01 21:37 UTC (permalink / raw)
  To: linux-media, linux-rockchip, linux-kernel
  Cc: kernel, Hans Verkuil, Ezequiel Garcia

The driver is perfectly capable of being built without CONFIG_OF.
Remove this dependency, which is useful for compile-only tests.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig b/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig
index bd0147624de1..fb74df829371 100644
--- a/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig
+++ b/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig
@@ -2,7 +2,7 @@
 
 config PHY_ROCKCHIP_DPHY_RX0
 	tristate "Rockchip MIPI Synopsys DPHY RX0 driver"
-	depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF
+	depends on ARCH_ROCKCHIP || COMPILE_TEST
 	select GENERIC_PHY_MIPI_DPHY
 	select GENERIC_PHY
 	help
-- 
2.26.0.rc2


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

* [PATCH 3/3] rkisp1: Fix wrong PHY config dependency
  2020-04-01 21:37 [PATCH 0/3] Rockchip ISP1 minor fixes Ezequiel Garcia
  2020-04-01 21:37 ` [PATCH 1/3] rkisp1: Get rid of unused variable warning Ezequiel Garcia
  2020-04-01 21:37 ` [PATCH 2/3] phy-rockchip-dphy-rx0: Drop unneeded CONFIG_OF dependency Ezequiel Garcia
@ 2020-04-01 21:37 ` Ezequiel Garcia
  2020-04-02 13:59   ` Helen Koike
  2 siblings, 1 reply; 10+ messages in thread
From: Ezequiel Garcia @ 2020-04-01 21:37 UTC (permalink / raw)
  To: linux-media, linux-rockchip, linux-kernel
  Cc: kernel, Hans Verkuil, Ezequiel Garcia

Instead of depending on the Rockchip PHY driver the ISP driver
should really depend on CONFIG_GENERIC_PHY_MIPI_DPHY,
given all it needs is the phy_mipi_dphy_get_default_config() symbol.

Fix it.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
 drivers/staging/media/rkisp1/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/rkisp1/Kconfig b/drivers/staging/media/rkisp1/Kconfig
index b859a493caba..e3ba6826fbb0 100644
--- a/drivers/staging/media/rkisp1/Kconfig
+++ b/drivers/staging/media/rkisp1/Kconfig
@@ -7,7 +7,7 @@ config VIDEO_ROCKCHIP_ISP1
 	select VIDEOBUF2_DMA_CONTIG
 	select VIDEOBUF2_VMALLOC
 	select V4L2_FWNODE
-	select PHY_ROCKCHIP_DPHY_RX0
+	select GENERIC_PHY_MIPI_DPHY
 	default n
 	help
 	  Enable this to support the Image Signal Processing (ISP) module
-- 
2.26.0.rc2


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

* Re: [PATCH 1/3] rkisp1: Get rid of unused variable warning
  2020-04-01 21:37 ` [PATCH 1/3] rkisp1: Get rid of unused variable warning Ezequiel Garcia
@ 2020-04-02  9:47   ` Robin Murphy
  2020-04-02 16:31     ` Ezequiel Garcia
  2020-04-02 13:58   ` Helen Koike
  1 sibling, 1 reply; 10+ messages in thread
From: Robin Murphy @ 2020-04-02  9:47 UTC (permalink / raw)
  To: Ezequiel Garcia, linux-media, linux-rockchip, linux-kernel
  Cc: Hans Verkuil, kernel

On 2020-04-01 10:37 pm, Ezequiel Garcia wrote:
> If CONFIG_OF is not selected, the compiler will complain:
> 
> drivers/staging/media/rkisp1/rkisp1-dev.c: In function ‘rkisp1_probe’:
> drivers/staging/media/rkisp1/rkisp1-dev.c:457:22: warning: unused variable ‘node’ [-Wunused-variable]
>    457 |  struct device_node *node = pdev->dev.of_node;
> 
> Rework the code slightly and make the compiler happy.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
> ---
>   drivers/staging/media/rkisp1/rkisp1-dev.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c
> index b1b3c058e957..5e7e797aad71 100644
> --- a/drivers/staging/media/rkisp1/rkisp1-dev.c
> +++ b/drivers/staging/media/rkisp1/rkisp1-dev.c
> @@ -454,7 +454,6 @@ static void rkisp1_debug_init(struct rkisp1_device *rkisp1)
>   
>   static int rkisp1_probe(struct platform_device *pdev)
>   {
> -	struct device_node *node = pdev->dev.of_node;
>   	const struct rkisp1_match_data *clk_data;
>   	const struct of_device_id *match;
>   	struct device *dev = &pdev->dev;
> @@ -463,7 +462,7 @@ static int rkisp1_probe(struct platform_device *pdev)
>   	unsigned int i;
>   	int ret, irq;
>   
> -	match = of_match_node(rkisp1_of_match, node);
> +	match = of_match_node(rkisp1_of_match, pdev->dev.of_node);

FWIW you could clean up "match" too by using of_device_get_match_data().

Robin.

>   	rkisp1 = devm_kzalloc(dev, sizeof(*rkisp1), GFP_KERNEL);
>   	if (!rkisp1)
>   		return -ENOMEM;
> 

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

* Re: [PATCH 1/3] rkisp1: Get rid of unused variable warning
  2020-04-01 21:37 ` [PATCH 1/3] rkisp1: Get rid of unused variable warning Ezequiel Garcia
  2020-04-02  9:47   ` Robin Murphy
@ 2020-04-02 13:58   ` Helen Koike
  1 sibling, 0 replies; 10+ messages in thread
From: Helen Koike @ 2020-04-02 13:58 UTC (permalink / raw)
  To: Ezequiel Garcia, linux-media, linux-rockchip, linux-kernel
  Cc: kernel, Hans Verkuil



On 4/1/20 6:37 PM, Ezequiel Garcia wrote:
> If CONFIG_OF is not selected, the compiler will complain:
> 
> drivers/staging/media/rkisp1/rkisp1-dev.c: In function ‘rkisp1_probe’:
> drivers/staging/media/rkisp1/rkisp1-dev.c:457:22: warning: unused variable ‘node’ [-Wunused-variable]
>   457 |  struct device_node *node = pdev->dev.of_node;
> 
> Rework the code slightly and make the compiler happy.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>

Acked-by: Helen Koike <helen.koike@collabora.com>

> ---
>  drivers/staging/media/rkisp1/rkisp1-dev.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c
> index b1b3c058e957..5e7e797aad71 100644
> --- a/drivers/staging/media/rkisp1/rkisp1-dev.c
> +++ b/drivers/staging/media/rkisp1/rkisp1-dev.c
> @@ -454,7 +454,6 @@ static void rkisp1_debug_init(struct rkisp1_device *rkisp1)
>  
>  static int rkisp1_probe(struct platform_device *pdev)
>  {
> -	struct device_node *node = pdev->dev.of_node;
>  	const struct rkisp1_match_data *clk_data;
>  	const struct of_device_id *match;
>  	struct device *dev = &pdev->dev;
> @@ -463,7 +462,7 @@ static int rkisp1_probe(struct platform_device *pdev)
>  	unsigned int i;
>  	int ret, irq;
>  
> -	match = of_match_node(rkisp1_of_match, node);
> +	match = of_match_node(rkisp1_of_match, pdev->dev.of_node);
>  	rkisp1 = devm_kzalloc(dev, sizeof(*rkisp1), GFP_KERNEL);
>  	if (!rkisp1)
>  		return -ENOMEM;
> 

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

* Re: [PATCH 2/3] phy-rockchip-dphy-rx0: Drop unneeded CONFIG_OF dependency
  2020-04-01 21:37 ` [PATCH 2/3] phy-rockchip-dphy-rx0: Drop unneeded CONFIG_OF dependency Ezequiel Garcia
@ 2020-04-02 13:59   ` Helen Koike
  2020-04-21  3:55     ` Ezequiel Garcia
  0 siblings, 1 reply; 10+ messages in thread
From: Helen Koike @ 2020-04-02 13:59 UTC (permalink / raw)
  To: Ezequiel Garcia, linux-media, linux-rockchip, linux-kernel
  Cc: kernel, Hans Verkuil



On 4/1/20 6:37 PM, Ezequiel Garcia wrote:
> The driver is perfectly capable of being built without CONFIG_OF.
> Remove this dependency, which is useful for compile-only tests.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>

Acked-by: Helen Koike <helen.koike@collabora.com>

> ---
>  drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig b/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig
> index bd0147624de1..fb74df829371 100644
> --- a/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig
> +++ b/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig
> @@ -2,7 +2,7 @@
>  
>  config PHY_ROCKCHIP_DPHY_RX0
>  	tristate "Rockchip MIPI Synopsys DPHY RX0 driver"
> -	depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF
> +	depends on ARCH_ROCKCHIP || COMPILE_TEST
>  	select GENERIC_PHY_MIPI_DPHY
>  	select GENERIC_PHY
>  	help
> 

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

* Re: [PATCH 3/3] rkisp1: Fix wrong PHY config dependency
  2020-04-01 21:37 ` [PATCH 3/3] rkisp1: Fix wrong PHY config dependency Ezequiel Garcia
@ 2020-04-02 13:59   ` Helen Koike
  0 siblings, 0 replies; 10+ messages in thread
From: Helen Koike @ 2020-04-02 13:59 UTC (permalink / raw)
  To: Ezequiel Garcia, linux-media, linux-rockchip, linux-kernel
  Cc: kernel, Hans Verkuil



On 4/1/20 6:37 PM, Ezequiel Garcia wrote:
> Instead of depending on the Rockchip PHY driver the ISP driver
> should really depend on CONFIG_GENERIC_PHY_MIPI_DPHY,
> given all it needs is the phy_mipi_dphy_get_default_config() symbol.
> 
> Fix it.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>

Acked-by: Helen Koike <helen.koike@collabora.com>

> ---
>  drivers/staging/media/rkisp1/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/rkisp1/Kconfig b/drivers/staging/media/rkisp1/Kconfig
> index b859a493caba..e3ba6826fbb0 100644
> --- a/drivers/staging/media/rkisp1/Kconfig
> +++ b/drivers/staging/media/rkisp1/Kconfig
> @@ -7,7 +7,7 @@ config VIDEO_ROCKCHIP_ISP1
>  	select VIDEOBUF2_DMA_CONTIG
>  	select VIDEOBUF2_VMALLOC
>  	select V4L2_FWNODE
> -	select PHY_ROCKCHIP_DPHY_RX0
> +	select GENERIC_PHY_MIPI_DPHY
>  	default n
>  	help
>  	  Enable this to support the Image Signal Processing (ISP) module
> 

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

* Re: [PATCH 1/3] rkisp1: Get rid of unused variable warning
  2020-04-02  9:47   ` Robin Murphy
@ 2020-04-02 16:31     ` Ezequiel Garcia
  0 siblings, 0 replies; 10+ messages in thread
From: Ezequiel Garcia @ 2020-04-02 16:31 UTC (permalink / raw)
  To: Robin Murphy, linux-media, linux-rockchip, linux-kernel
  Cc: Hans Verkuil, kernel

On Thu, 2020-04-02 at 10:47 +0100, Robin Murphy wrote:
> On 2020-04-01 10:37 pm, Ezequiel Garcia wrote:
> > If CONFIG_OF is not selected, the compiler will complain:
> > 
> > drivers/staging/media/rkisp1/rkisp1-dev.c: In function ‘rkisp1_probe’:
> > drivers/staging/media/rkisp1/rkisp1-dev.c:457:22: warning: unused variable ‘node’ [-Wunused-variable]
> >    457 |  struct device_node *node = pdev->dev.of_node;
> > 
> > Rework the code slightly and make the compiler happy.
> > 
> > Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
> > ---
> >   drivers/staging/media/rkisp1/rkisp1-dev.c | 3 +--
> >   1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c
> > index b1b3c058e957..5e7e797aad71 100644
> > --- a/drivers/staging/media/rkisp1/rkisp1-dev.c
> > +++ b/drivers/staging/media/rkisp1/rkisp1-dev.c
> > @@ -454,7 +454,6 @@ static void rkisp1_debug_init(struct rkisp1_device *rkisp1)
> >   
> >   static int rkisp1_probe(struct platform_device *pdev)
> >   {
> > -	struct device_node *node = pdev->dev.of_node;
> >   	const struct rkisp1_match_data *clk_data;
> >   	const struct of_device_id *match;
> >   	struct device *dev = &pdev->dev;
> > @@ -463,7 +462,7 @@ static int rkisp1_probe(struct platform_device *pdev)
> >   	unsigned int i;
> >   	int ret, irq;
> >   
> > -	match = of_match_node(rkisp1_of_match, node);
> > +	match = of_match_node(rkisp1_of_match, pdev->dev.of_node);
> 
> FWIW you could clean up "match" too by using of_device_get_match_data().
> 

Ah, that's nicer.

Thanks,
Ezequiel


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

* Re: [PATCH 2/3] phy-rockchip-dphy-rx0: Drop unneeded CONFIG_OF dependency
  2020-04-02 13:59   ` Helen Koike
@ 2020-04-21  3:55     ` Ezequiel Garcia
  0 siblings, 0 replies; 10+ messages in thread
From: Ezequiel Garcia @ 2020-04-21  3:55 UTC (permalink / raw)
  To: Helen Koike, linux-media, linux-rockchip, linux-kernel
  Cc: kernel, Hans Verkuil

On Thu, 2020-04-02 at 10:59 -0300, Helen Koike wrote:
> 
> On 4/1/20 6:37 PM, Ezequiel Garcia wrote:
> > The driver is perfectly capable of being built without CONFIG_OF.
> > Remove this dependency, which is useful for compile-only tests.
> > 
> > Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
> 
> Acked-by: Helen Koike <helen.koike@collabora.com>
> 
> > ---
> >  drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig b/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig
> > index bd0147624de1..fb74df829371 100644
> > --- a/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig
> > +++ b/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig
> > @@ -2,7 +2,7 @@
> >  
> >  config PHY_ROCKCHIP_DPHY_RX0
> >  	tristate "Rockchip MIPI Synopsys DPHY RX0 driver"
> > -	depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF
> > +	depends on ARCH_ROCKCHIP || COMPILE_TEST

After discussing other similar patches, I'm starting to
think this was a bad idea.

Instead, we want to do have (ARCH_ROCKCHIP && OF) || COMPILE_TEST
as the other Rockchip PHYs.

Thanks,
Ezequiel


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

end of thread, other threads:[~2020-04-21  3:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-01 21:37 [PATCH 0/3] Rockchip ISP1 minor fixes Ezequiel Garcia
2020-04-01 21:37 ` [PATCH 1/3] rkisp1: Get rid of unused variable warning Ezequiel Garcia
2020-04-02  9:47   ` Robin Murphy
2020-04-02 16:31     ` Ezequiel Garcia
2020-04-02 13:58   ` Helen Koike
2020-04-01 21:37 ` [PATCH 2/3] phy-rockchip-dphy-rx0: Drop unneeded CONFIG_OF dependency Ezequiel Garcia
2020-04-02 13:59   ` Helen Koike
2020-04-21  3:55     ` Ezequiel Garcia
2020-04-01 21:37 ` [PATCH 3/3] rkisp1: Fix wrong PHY config dependency Ezequiel Garcia
2020-04-02 13:59   ` Helen Koike

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).