[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200408155325.2077345-1-arnd@arndb.de>
Date: Wed, 8 Apr 2020 17:52:44 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Helen Koike <helen.koike@...labora.com>
Cc: Arnd Bergmann <arnd@...db.de>,
Jacob Chen <jacob2.chen@...k-chips.com>,
Shunqian Zheng <zhengsq@...k-chips.com>,
Yichong Zhong <zyc@...k-chips.com>,
Jacob Chen <cc@...k-chips.com>,
Eddie Cai <eddie.cai.linux@...il.com>,
Jeffy Chen <jeffy.chen@...k-chips.com>,
Allon Huang <allon.huang@...k-chips.com>,
Tomasz Figa <tfiga@...omium.org>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Ezequiel Garcia <ezequiel@...labora.com>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Heiko Stuebner <heiko@...ech.de>,
Dafna Hirschfeld <dafna.hirschfeld@...labora.com>,
linux-media@...r.kernel.org, devel@...verdev.osuosl.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] media: staging: rkisp1: avoid unused variable warning
When compile-testing with CONFIG_OF disabled, we get a warning
about an unused variable, and about inconsistent Kconfig dependencies:
WARNING: unmet direct dependencies detected for PHY_ROCKCHIP_DPHY_RX0
Depends on [n]: STAGING [=y] && STAGING_MEDIA [=y] && MEDIA_SUPPORT [=m] && (ARCH_ROCKCHIP [=n] || COMPILE_TEST [=y]) && OF [=n]
Selected by [m]:
- VIDEO_ROCKCHIP_ISP1 [=m] && STAGING [=y] && STAGING_MEDIA [=y] && MEDIA_SUPPORT [=m] && VIDEO_V4L2 [=m] && VIDEO_V4L2_SUBDEV_API [=y] && (ARCH_ROCKCHIP [=n] || COMPILE_TEST [=y])
drivers/staging/media/rkisp1/rkisp1-dev.c: In function 'rkisp1_probe':
drivers/staging/media/rkisp1/rkisp1-dev.c:457:22: error: unused variable 'node' [-Werror=unused-variable]
457 | struct device_node *node = pdev->dev.of_node;
Simply open-coding the pointer dereference in the only place
the variable is used avoids the warning in all configurations,
so we can allow compile-testing as well.
Fixes: d65dd85281fb ("media: staging: rkisp1: add Rockchip ISP1 base driver")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig | 2 +-
drivers/staging/media/rkisp1/rkisp1-dev.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig b/drivers/staging/media/phy-rockchip-dphy-rx0/Kconfig
index bd0147624de1..dd5d4d741bdd 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 && OF) || COMPILE_TEST
select GENERIC_PHY_MIPI_DPHY
select GENERIC_PHY
help
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
Powered by blists - more mailing lists