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: 80715 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1nJS26-000c1Z-EV; Mon, 14 Feb 2022 03:28:15 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234397AbiBND2O (ORCPT + 1 other); Sun, 13 Feb 2022 22:28:14 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:55804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231786AbiBND2O (ORCPT ); Sun, 13 Feb 2022 22:28:14 -0500 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F81455487 for ; Sun, 13 Feb 2022 19:28:06 -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 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=unavailable 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-media@vger.kernel.org X-LSpam-Score: -4.7 (----) X-LSpam-Report: No, score=-4.7 required=5.0 tests=BAYES_00=-1.9,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no 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;