Rockchip ISP1 minor fixes
Subsystems (3)
v2 cover Rockchip ISP1 minor fixes
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.
Compile-tested only.
v2:
* Use of_device_get_match_data as suggested by Robin.
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 | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
Signature · 1 line
2.26.0.rc2
PATCH v2 1/3 rkisp1: Get rid of unused variable warning
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.
--- drivers/staging/media/rkisp1/rkisp1-dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/rkisp1/rkisp1-dev.c +4 -4
@@ -454,16 +454,17 @@ 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;struct rkisp1_device *rkisp1;struct v4l2_device *v4l2_dev;unsigned int i;int ret, irq; - match =of_match_node (rkisp1_of_match, node); + clk_data =of_device_get_match_data (&pdev->dev); +if (!clk_data) +return -ENODEV ; + rkisp1 =devm_kzalloc (dev,sizeof (*rkisp1),GFP_KERNEL );if (!rkisp1)return -ENOMEM ;
@@ -487,7 +488,6 @@ static int rkisp1_probe(struct platform_device *pdev) } rkisp1->irq = irq; - clk_data = match->data;for (i =0 ; i < clk_data->size; i++) rkisp1->clks[i].id = clk_data->clks[i];
Signature · 1 line
2.26.0.rc2
Re: [PATCH v2 1/3] rkisp1: Get rid of unused variable warning
Quoted 10 lines · Ezequiel Garcia
If
CONFIG_OFis 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 | structdevice_node*node =pdev->dev.of_node;Rework the code slightly and make the compiler happy.
Suggested-by Robin Murphy <[email protected]>Signed-off-by Ezequiel Garcia <[email protected]>
Quoted 38 lines
--- drivers/staging/media/rkisp1/rkisp1-dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/staging/media/rkisp1/rkisp1-dev.c +4
-4@@ -454,16 +454,17 @@ 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;struct rkisp1_device *rkisp1;struct v4l2_device *v4l2_dev;unsigned int i;int ret, irq; - match =of_match_node (rkisp1_of_match, node); + clk_data =of_device_get_match_data (&pdev->dev); +if (!clk_data) +return -ENODEV ; + rkisp1 =devm_kzalloc (dev,sizeof (*rkisp1),GFP_KERNEL );if (!rkisp1)return -ENOMEM ;@@ -487,7 +488,6 @@ static int rkisp1_probe(struct platform_device *pdev) } rkisp1->irq = irq; - clk_data = match->data;for (i =0 ; i < clk_data->size; i++) rkisp1->clks[i].id = clk_data->clks[i];
PATCH v2 2/3 phy-rockchip-dphy-rx0: Drop unneeded CONFIG_OF dependency
In reply to Ezequiel GarciaThe driver is perfectly capable of being built without CONFIG_OF. Remove this dependency, which is useful for compile-only tests.
--- drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig +1 -1
@@ -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
Signature · 1 line
2.26.0.rc2
PATCH v2 3/3 rkisp1: Fix wrong PHY config dependency
In reply to Ezequiel GarciaInstead 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.
--- drivers/staging/media/rkisp1/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/rkisp1/Kconfig +1 -1
@@ -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
Signature · 1 line
2.26.0.rc2