From patchwork Sun Oct 16 08:01:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 9378357 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4D4DB607FD for ; Mon, 17 Oct 2016 00:57:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43CF928E17 for ; Mon, 17 Oct 2016 00:57:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 388D328E3F; Mon, 17 Oct 2016 00:57:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4026E28E17 for ; Mon, 17 Oct 2016 00:57:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F19EC6E1EA; Mon, 17 Oct 2016 00:57:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1797 seconds by postgrey-1.35 at gabe; Sun, 16 Oct 2016 08:32:00 UTC Received: from pokefinder.org (sauhun.de [89.238.76.85]) by gabe.freedesktop.org (Postfix) with ESMTPS id 34BE16E52A for ; Sun, 16 Oct 2016 08:32:00 +0000 (UTC) Received: from p5b385e04.dip0.t-ipconnect.de ([91.56.94.4]:48534 helo=localhost) by pokefinder.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1bvgOL-0001Al-Qc; Sun, 16 Oct 2016 10:01:58 +0200 From: Wolfram Sang To: dri-devel@lists.freedesktop.org Subject: [PATCH RESEND] gpu: drm: rcar-du: rcar_du_drv: don't open code of_device_get_match_data() Date: Sun, 16 Oct 2016 10:01:47 +0200 Message-Id: <20161016080147.2215-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.9.3 X-Mailman-Approved-At: Mon, 17 Oct 2016 00:57:05 +0000 Cc: linux-renesas-soc@vger.kernel.org, Daniel Vetter , Laurent Pinchart , Geert Uytterhoeven , Wolfram Sang X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This change will also make Coverity happy by avoiding a theoretical NULL pointer dereference; yet another reason is to use the above helper function to tighten the code and make it more readable. Signed-off-by: Wolfram Sang Acked-by: Geert Uytterhoeven --- Found this in one of my old branches. Plain resend, only ack from Geert added. drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 73c971e39b1c72..50755f2f2bd3e4 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -313,7 +313,7 @@ static int rcar_du_probe(struct platform_device *pdev) init_waitqueue_head(&rcdu->commit.wait); rcdu->dev = &pdev->dev; - rcdu->info = of_match_device(rcar_du_of_table, rcdu->dev)->data; + rcdu->info = of_device_get_match_data(rcdu->dev); ddev = drm_dev_alloc(&rcar_du_driver, &pdev->dev); if (IS_ERR(ddev))