Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2086258ybb; Thu, 2 Apr 2020 12:50:28 -0700 (PDT) X-Google-Smtp-Source: APiQypJXNSYdRDqcs/xZ5UZdakLXOanBiUx49O+kAIPcjGqkh9MJNf7LuBuaOD7UFBV00mvxiqGU X-Received: by 2002:aca:2817:: with SMTP id 23mr534489oix.67.1585857028108; Thu, 02 Apr 2020 12:50:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585857028; cv=none; d=google.com; s=arc-20160816; b=HjO8OYwVflhlRm7K7ush52OpqT79/wQoZPdUQ0IqibpvyL1MmlS9ur08iYfmnWCVik kA/vqSIViDLD583Kso59lO6JKl95rKErjfCm4PXlNYE1Yk3n8F9AMQ3FcFOYAJybXDRN 9In7/bnTa4pk7Q9voFC5MffBQ6EnlS91AQEUxYJutfr9NOHtv9xYXYGZ+J4iJqIUqMn2 QXC+3yTXGjWYw1S7cDwQZdLQLQmJiyUcndikWz/WCHSttG8m2JaV8qwCgTHhjb+qWTtB yXqJ4b8k9wRMRm9Hiq7ynCwp957632G5873jF7CgEA0jNIAgOYatHZM8ZR3WvO3tUUMX Yajg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rTlvIHZAt9bV0f2qYH+9NWvE1pD/QOSALwHdVYCS13I=; b=SnYUfLOO4SWHxn7wTY4rK/ka6+Q3GGNmcPn+sMs20+szrCVeuuj2VCN9qWHQrntYLv I+L7zCrJh8iUXqivzrTmzC6fRNPaxyMDO/12e262BlDlDh9I5havj1ztsFzmTQsh40R6 A8USRWYWsO/XvASJi8bCx0RiTmiHYNICpeJP9QmGNx9vL0WZbR1lBCZm+79SgDrdDvVC bLgujP8juvSfToS7S18QW0W9NTiy5vvuc4wzwhCS2d4cm6eMSpqt7QC1f0v/gEDcodtF UpS7LNdFTNN3qJ2I/27gmw0y1aHMLnXQOqUGmSD9yWZ0QYU/xkrdNuUjrF2HtjDC1Av1 PF2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 96si2767685otn.253.2020.04.02.12.50.15; Thu, 02 Apr 2020 12:50:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388755AbgDBTpW (ORCPT + 99 others); Thu, 2 Apr 2020 15:45:22 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:46372 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729033AbgDBTpW (ORCPT ); Thu, 2 Apr 2020 15:45:22 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id BF10F290B60 From: Ezequiel Garcia To: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@collabora.com, Hans Verkuil , Helen Koike , Robin Murphy , Ezequiel Garcia Subject: [PATCH v2 1/3] rkisp1: Get rid of unused variable warning Date: Thu, 2 Apr 2020 16:45:02 -0300 Message-Id: <20200402194504.5331-2-ezequiel@collabora.com> X-Mailer: git-send-email 2.26.0.rc2 In-Reply-To: <20200402194504.5331-1-ezequiel@collabora.com> References: <20200402194504.5331-1-ezequiel@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Robin Murphy Signed-off-by: Ezequiel Garcia --- drivers/staging/media/rkisp1/rkisp1-dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c index b1b3c058e957..3f6285709352 100644 --- a/drivers/staging/media/rkisp1/rkisp1-dev.c +++ b/drivers/staging/media/rkisp1/rkisp1-dev.c @@ -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]; -- 2.26.0.rc2