From: Fabio Estevam <festevam@gmail.com>
To: Peter.Chen@nxp.com
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
Fabio Estevam <festevam@gmail.com>
Subject: [PATCH 3/3] usb: chipidea: ci_hdrc_imx: Use of_device_get_match_data()
Date: Tue, 24 Nov 2020 13:39:12 -0300 [thread overview]
Message-ID: <20201124163912.12074-3-festevam@gmail.com> (raw)
In-Reply-To: <20201124163912.12074-1-festevam@gmail.com>
The retrieval of driver data via of_device_get_match_data() can make
the code simpler.
Use of_device_get_match_data() to simplify the code.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
drivers/usb/chipidea/ci_hdrc_imx.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index 25c65accf089..8fa712148e5d 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -319,16 +319,11 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
.notify_event = ci_hdrc_imx_notify_event,
};
int ret;
- const struct of_device_id *of_id;
const struct ci_hdrc_imx_platform_flag *imx_platform_flag;
struct device_node *np = pdev->dev.of_node;
struct device *dev = &pdev->dev;
- of_id = of_match_device(ci_hdrc_imx_dt_ids, dev);
- if (!of_id)
- return -ENODEV;
-
- imx_platform_flag = of_id->data;
+ imx_platform_flag = of_device_get_match_data(&pdev->dev);
data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
if (!data)
--
2.17.1
next prev parent reply other threads:[~2020-11-24 16:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-24 16:39 [PATCH 1/3] usb: phy: phy-mxs-usb: Use of_device_get_match_data() Fabio Estevam
2020-11-24 16:39 ` [PATCH 2/3] usb: chipidea: usbmisc_imx: " Fabio Estevam
2020-11-24 16:39 ` Fabio Estevam [this message]
2020-11-25 1:15 ` [PATCH 1/3] usb: phy: phy-mxs-usb: " Peter Chen
2020-11-25 1:21 ` Fabio Estevam
2020-11-25 1:58 ` Peter Chen
2020-11-25 2:13 ` Fabio Estevam
2020-11-25 4:48 ` Peter Chen
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=20201124163912.12074-3-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=Peter.Chen@nxp.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.