From patchwork Wed Nov 2 08:57:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhang.songyi@zte.com.cn X-Patchwork-Id: 13027857 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 AC3F8C4332F for ; Wed, 2 Nov 2022 08:59:05 +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:Subject:Cc:To:From:Mime-Version: Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=78w8a/qjxadEaXLe6oySuzuBGIU/q16upXp852h77x4=; b=DBs JIsd40miBugBpEMsW3OaspfFKXtgsp872fmSitUodWcE6bAyj4ao0567lcoruDjmueq0g2s+6fTul fBhWvz0ur1w0A7Hhu+3ua2Pa0TS9G+sZzo/QUcGFd8TobJCzqTIWvbLrJs2ZJVdJ4brh9fx02I1xI EQN4O3UUniyB3Q41qd3WCU3ALQ3EXxFy6y1oNApHTSHNIed3aexJh6XJk1H7y9BuWE6zW0mB/BsJ9 NtgkO9iepRTppaAK/yU16TFGJ/W85xVJ2Zd9S/Ue41lDL+p7JUXU/sQdSQLK3+aCNuENkpuiWZJ/I Lrb7Jf/+ZStoHk61xQlNn8MI1SSSSWQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oq9ZX-009IFU-3x; Wed, 02 Nov 2022 08:58:07 +0000 Received: from mxhk.zte.com.cn ([63.216.63.40]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oq9ZT-009Hot-El for linux-arm-kernel@lists.infradead.org; Wed, 02 Nov 2022 08:58:05 +0000 Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4N2LPw34p5z8R039; Wed, 2 Nov 2022 16:57:56 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl1.zte.com.cn with SMTP id 2A28vgoZ031476; Wed, 2 Nov 2022 16:57:42 +0800 (+08) (envelope-from zhang.songyi@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Wed, 2 Nov 2022 16:57:45 +0800 (CST) Date: Wed, 2 Nov 2022 16:57:45 +0800 (CST) X-Zmail-TransId: 2af9636231091191451f X-Mailer: Zmail v1.0 Message-ID: <202211021657454006946@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_firmware=3A_ti=5Fsci=3A_Use_of=5Fd?= =?utf-8?q?evice=5Fget=5Fmatch=5Fdata=28=29?= X-MAIL: mse-fl1.zte.com.cn 2A28vgoZ031476 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.137.novalocal with ID 63623114.000 by FangMail milter! X-FangMail-Envelope: 1667379476/4N2LPw34p5z8R039/63623114.000/10.5.228.132/[10.5.228.132]/mse-fl1.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63623114.000/4N2LPw34p5z8R039 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221102_015803_692139_66467B93 X-CRM114-Status: GOOD ( 11.90 ) 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 From 18dbde082d02c871453c5be8c762b6383a2f9641 Mon Sep 17 00:00:00 2001 From: zhang songyi Date: Wed, 2 Nov 2022 16:17:54 +0800 Subject: [PATCH linux-next] firmware: ti_sci: Use of_device_get_match_data() Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot Signed-off-by: zhang songyi --- drivers/firmware/ti_sci.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.15.2 diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 6d2fd0ff7ff3..7db7d840fbb2 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -3340,7 +3340,6 @@ MODULE_DEVICE_TABLE(of, ti_sci_of_match); static int ti_sci_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - const struct of_device_id *of_id; const struct ti_sci_desc *desc; struct ti_sci_xfer *xfer; struct ti_sci_info *info = NULL; @@ -3351,12 +3350,11 @@ static int ti_sci_probe(struct platform_device *pdev) int reboot = 0; u32 h_id; - of_id = of_match_device(ti_sci_of_match, dev); - if (!of_id) { + desc = of_device_get_match_data(dev); + if (!desc) { dev_err(dev, "OF data missing\n"); return -EINVAL; } - desc = of_id->data; info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL); if (!info)