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: 14114 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3502035wru; Wed, 2 Nov 2022 02:10:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6aRmv4yz9gU0U7iO2w/UQZrPhhD/S1ZqFvhoZLNPCiUn4OfXOdC43hnj1XRgr2iZRq0Qld X-Received: by 2002:a17:907:6d0b:b0:7ad:f7ce:fad4 with SMTP id sa11-20020a1709076d0b00b007adf7cefad4mr5115345ejc.472.1667380215658; Wed, 02 Nov 2022 02:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667380215; cv=none; d=google.com; s=arc-20160816; b=uHyBtbk/yKniv6YNBD1xLnXb/kcMLW+Qx2Ev3KTNYSQ4xl0Fge6hWLeskhghxHDevF A+hs9V3k1/Dzzs5wLyCiqGvA3/+TgvxXFoL5pDe30lyo/5ovLeLgFsMSNJRe6222TRFn Nq4hReu1/IWbkcE7S8f54Abdkf+9Y7egTmNiGeKCJQ5AXl/JpczPIs6nsNHuvaHkiGKc T6dZaRdWU36NOcaucg8jFdOrUqHOnLnNo149aS6b9J4d0CBFkNnMZrzogzRLaYV2vwlv 4dafnpMghkxAkM1N3L8ST5DRAAHYblmP23fHf4jKjKbKZf67c6K4JyR6/+kUZVEhfiXB B0mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=6/Za6kW88aHgM/YlKbe18pR3tMpvwLM+VD7HVvucY6g=; b=V7PvyV/PF570nhGeAd5w7RX++V/G/0LhvMkogPLXNcBMliBAsKWI02fHiACogwToZN D5bMCdrk+ZVZv3kHdi8eAaE0fNw4ifvn41Q3bhiOMT6Z6HtW05Uoso4G6YbYyox61ug5 ZJSLasFWk+DzpbRe79cJE++QANphMBqLrOihfWEiIGyIvrVsrke1yUqOptmZySRPLmxE 9WPvpLwmquIFatnBscALb6wU4H4i3pws7MsbR4bj1bDvCBmATzw5j9ECvaTlfM3GtWf/ AjstLEWY+UzoFJpBWBCZQBQ02d9G5NJYr56AUImKBuLPuK0izn7DkPdPS7+Kp2q9dGkM E4QQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a50ea89000000b00461c531d8casi13335579edo.305.2022.11.02.02.09.51; Wed, 02 Nov 2022 02:10:15 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230497AbiKBJHh (ORCPT + 99 others); Wed, 2 Nov 2022 05:07:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229988AbiKBJGz (ORCPT ); Wed, 2 Nov 2022 05:06:55 -0400 X-Greylist: delayed 424 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 02 Nov 2022 02:05:21 PDT Received: from mxus.zte.com.cn (mxus.zte.com.cn [20.112.44.237]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9344D25F6 for ; Wed, 2 Nov 2022 02:05:20 -0700 (PDT) Received: from mxhk.zte.com.cn (unknown [192.168.250.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mxus.zte.com.cn (FangMail) with ESMTPS id 4N2LPz6s1yz9wMT5 for ; Wed, 2 Nov 2022 16:57:59 +0800 (CST) 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 10-207-168-7 with ID 63623116.000 by FangMail milter! X-FangMail-Envelope: 1667379480/4N2LPz6s1yz9wMT5/63623116.000/192.168.250.137/[192.168.250.137]/mxhk.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63623116.000/4N2LPz6s1yz9wMT5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748374876716267325?= X-GMAIL-MSGID: =?utf-8?q?1748374876716267325?= 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)