From patchwork Mon Feb 14 03:27:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jammy Huang X-Patchwork-Id: 12744855 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2BE90C433F5 for ; Mon, 14 Feb 2022 03:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=rpb3fSx2iFl3YFfazWZNKYkbvOPCl0WbU2oVa2JTLNw=; b=Y/8tsTuasTYcdn a5oec9UcbaY6aioCECuuDhT1SmwlW5j5tyOTwVMvhlBx3Hw4zDTUnA2gMQC4kYzuMnAkCkuEgynXc KtAt0n5R+qD0KZgCpBXA+gK73py3bpxOMpFeZ9+b7oJGjmYYlUi7No3FmwwIZdik1mCHG25SYszRX r5t0BT/+MJ+qzv11d7hO2USNIB9hoGbx6c5zbl6q0/+7EjupuU6eO4/9yExKZSe9Xz5x5qjt1/99o yTs7L9B7aJ8D07cZkaoVCzYdH0ULreVcT4tuyrJQN0GJfIUI6zQuCCwOztwTI035HOlFTuH9K8P87 d1pFtfEY/LIbnGfGs3lA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJS1u-00D9HL-AV; Mon, 14 Feb 2022 03:27:58 +0000 Received: from twspam01.aspeedtech.com ([211.20.114.71]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJS1q-00D9G4-U7 for linux-arm-kernel@lists.infradead.org; Mon, 14 Feb 2022 03:27:56 +0000 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 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220213_192755_360172_FBD9D3A1 X-CRM114-Status: GOOD ( 10.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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;