Commit f661aaa0 authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Mauro Carvalho Chehab

media: 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.
Suggested-by: default avatarRobin Murphy <robin.murphy@arm.com>
Signed-off-by: default avatarEzequiel Garcia <ezequiel@collabora.com>
Acked-by: default avatarHelen Koike <helen.koike@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent d6ef0719
...@@ -454,16 +454,17 @@ static void rkisp1_debug_init(struct rkisp1_device *rkisp1) ...@@ -454,16 +454,17 @@ static void rkisp1_debug_init(struct rkisp1_device *rkisp1)
static int rkisp1_probe(struct platform_device *pdev) 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 rkisp1_match_data *clk_data;
const struct of_device_id *match;
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct rkisp1_device *rkisp1; struct rkisp1_device *rkisp1;
struct v4l2_device *v4l2_dev; struct v4l2_device *v4l2_dev;
unsigned int i; unsigned int i;
int ret, irq; 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); rkisp1 = devm_kzalloc(dev, sizeof(*rkisp1), GFP_KERNEL);
if (!rkisp1) if (!rkisp1)
return -ENOMEM; return -ENOMEM;
...@@ -487,7 +488,6 @@ static int rkisp1_probe(struct platform_device *pdev) ...@@ -487,7 +488,6 @@ static int rkisp1_probe(struct platform_device *pdev)
} }
rkisp1->irq = irq; rkisp1->irq = irq;
clk_data = match->data;
for (i = 0; i < clk_data->size; i++) for (i = 0; i < clk_data->size; i++)
rkisp1->clks[i].id = clk_data->clks[i]; rkisp1->clks[i].id = clk_data->clks[i];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment