linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: <zhang.songyi@zte.com.cn>
To: <nm@ti.com>
Cc: <kristo@kernel.org>, <ssantosh@kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <zhang.songyi@zte.com.cn>,
	<jiang.xuexin@zte.com.cn>, <xue.zhihong@zte.com.cn>
Subject: [PATCH linux-next] firmware: ti_sci: Use of_device_get_match_data()
Date: Wed, 2 Nov 2022 16:57:45 +0800 (CST)	[thread overview]
Message-ID: <202211021657454006946@zte.com.cn> (raw)

From 18dbde082d02c871453c5be8c762b6383a2f9641 Mon Sep 17 00:00:00 2001
From: zhang songyi <zhang.songyi@zte.com.cn>
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 <zealci@zte.com.cn>
Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
---
 drivers/firmware/ti_sci.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

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)
--
2.15.2

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2022-11-02  8:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02  8:57 zhang.songyi [this message]
2022-11-03  4:58 ` [PATCH linux-next] firmware: ti_sci: Use of_device_get_match_data() Nishanth Menon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202211021657454006946@zte.com.cn \
    --to=zhang.songyi@zte.com.cn \
    --cc=jiang.xuexin@zte.com.cn \
    --cc=kristo@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=ssantosh@kernel.org \
    --cc=xue.zhihong@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).