Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5521544pxb; Mon, 14 Feb 2022 00:39:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZySxNUJ0cH1hreEYDomc5PsGFevEeL1mGb4gccaRS5rFkWPxS+WuUynmCeHc7BGwro8BA X-Received: by 2002:a05:6402:5113:: with SMTP id m19mr14128619edd.325.1644827948900; Mon, 14 Feb 2022 00:39:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644827948; cv=none; d=google.com; s=arc-20160816; b=v1lrE0mVXGEZRlnqL2zX2nwq3jYpja0xWNo7oocAzIJCVvhwDsHX4m2zBjJxlQAQNJ uWcDd0o+EyKi2oyrH8NKBUiWNhyY9rTLHhFHLAx/9kEc+PNeAkPUVpQUqUZNJalEDk0Q o1cf+JOvqgbWWhUAdAk33ZX+nc1yrej/6805cBa1txMP+NVz2vHrndDABtiXcY41NP5C 2wISz2V/WRZXxsQOVqqJh2xT+tm233JOhPXrMwa4gKLKeMSv1N7jS7h1cN5utHjUYr4V FLNovE8yppJWuGKrlC/q5vXLuOikj6OqpMrSGpkqYPnRRTNCJQfXXmjminAQp7RlsSr2 Tlfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from; bh=41jZjMDtrO/4M6RD70pLlAmBab8AQySnzUiku6/af34=; b=Nr5sMDnLlCBiE0uDXKpaUWmTZNYokIcsRMUiKPtA7V3d/Tuvbn0xMjSfsEnTyGoC7A 6HoJ1674t5M0P/GSAKI8jMt+GFNFoF0khHqezUFSbCEB2KnbVg9Y8mlxq5oWxtU+kWXY JjOahky2HTPL2yqhmVdEzPom+hV5Lyce9xGEsQUGvvzmcUCUkP2fn9cOLxuP9Vbd+fHc 1BixhwbOFjssl3ag69Mgpw8EwuAhF/uDNUq/Z7s4bQjgdeuXTeD/VEOZMCh+PmpEnDZo Mr7PY56K3g+n3DTzOPPnYH93ieWANcCr2HvLerVfOlU1/n0DJQshTG4ew+8wV7cY1dCW Q/qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb17si17118271ejc.456.2022.02.14.00.38.46; Mon, 14 Feb 2022 00:39:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239978AbiBND1a (ORCPT + 99 others); Sun, 13 Feb 2022 22:27:30 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:55436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233121AbiBND13 (ORCPT ); Sun, 13 Feb 2022 22:27:29 -0500 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBB5C55489 for ; Sun, 13 Feb 2022 19:27:19 -0800 (PST) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 21E3IjpJ039545; Mon, 14 Feb 2022 11:18:45 +0800 (GMT-8) (envelope-from jammy_huang@aspeedtech.com) Received: from JammyHuang-PC.aspeed.com (192.168.2.115) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 14 Feb 2022 11:27:11 +0800 From: Jammy Huang To: , , , , , , , , Subject: [PATCH] media: aspeed: Use of_device_get_match_data() helper Date: Mon, 14 Feb 2022 11:27:08 +0800 Message-ID: <20220214032708.854-1-jammy_huang@aspeedtech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.2.115] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 21E3IjpJ039545 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use of_device_get_match_data() to simplify the code. Signed-off-by: Jammy Huang --- drivers/media/platform/aspeed-video.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c index 3904ded2052a..d4acf84cda9b 100644 --- a/drivers/media/platform/aspeed-video.c +++ b/drivers/media/platform/aspeed-video.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -2451,7 +2452,6 @@ MODULE_DEVICE_TABLE(of, aspeed_video_of_match); static int aspeed_video_probe(struct platform_device *pdev) { const struct aspeed_video_config *config; - const struct of_device_id *match; struct aspeed_video *video; int rc; @@ -2463,11 +2463,7 @@ static int aspeed_video_probe(struct platform_device *pdev) if (IS_ERR(video->base)) return PTR_ERR(video->base); - match = of_match_node(aspeed_video_of_match, pdev->dev.of_node); - if (!match) - return -EINVAL; - - config = match->data; + config = of_device_get_match_data(&pdev->dev); video->version = config->version; video->jpeg_mode = config->jpeg_mode; video->comp_size_read = config->comp_size_read; -- 2.25.1