From patchwork Tue Mar 1 16:37:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 8466911 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0055A9F2F0 for ; Tue, 1 Mar 2016 16:37:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6391B20251 for ; Tue, 1 Mar 2016 16:37:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BBEAA2024F for ; Tue, 1 Mar 2016 16:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751322AbcCAQh5 (ORCPT ); Tue, 1 Mar 2016 11:37:57 -0500 Received: from sauhun.de ([89.238.76.85]:59981 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751026AbcCAQh4 (ORCPT ); Tue, 1 Mar 2016 11:37:56 -0500 Received: from p5082e975.dip0.t-ipconnect.de ([80.130.233.117]:52912 helo=localhost) by pokefinder.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1aanJ3-0004LJ-Fe; Tue, 01 Mar 2016 17:37:54 +0100 From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Wolfram Sang , Laurent Pinchart , David Airlie , dri-devel@lists.freedesktop.org Subject: [PATCH] gpu: drm: rcar-du: rcar_du_drv: don't open code of_device_get_match_data() Date: Tue, 1 Mar 2016 17:37:34 +0100 Message-Id: <1456850269-8290-1-git-send-email-wsa@the-dreams.de> X-Mailer: git-send-email 2.7.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wolfram Sang 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 Acked-by: Laurent Pinchart Tested-by: Laurent Pinchart --- Compile tested only. I am on the road and can't test the multimedia drivers because of no cables :( If someone could test it, that would be much appreciated. Or I'll do it next week. The pattern worked for other drivers I could actually test, though. 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 ed6006bf6bd893..ac95509e80bb7c 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -318,7 +318,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 (!ddev)