From: Xu Yang <xu.yang_2@nxp.com>
To: heikki.krogerus@linux.intel.com, robh+dt@kernel.org,
peda@axentia.se, shawnguo@kernel.org
Cc: gregkh@linuxfoundation.org, linux@roeck-us.net, jun.li@nxp.com,
xu.yang_2@nxp.com, linux-usb@vger.kernel.org, linux-imx@nxp.com,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] mux: allow get mux_control from fwnode if of_node is NULL
Date: Mon, 22 Aug 2022 23:35:15 +0800 [thread overview]
Message-ID: <20220822153517.3747679-3-xu.yang_2@nxp.com> (raw)
In-Reply-To: <20220822153517.3747679-1-xu.yang_2@nxp.com>
Since some devices may link fwnode to dev but doesn't link of_node,
so here we could get mux_control from fwnode again.
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
drivers/mux/core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/mux/core.c b/drivers/mux/core.c
index 49bedbe6316c..06d4e232e056 100644
--- a/drivers/mux/core.c
+++ b/drivers/mux/core.c
@@ -538,6 +538,9 @@ static struct mux_control *mux_get(struct device *dev, const char *mux_name,
int index = 0;
int ret;
+ if (!np)
+ np = to_of_node(dev_fwnode(dev));
+
if (mux_name) {
if (state)
index = of_property_match_string(np, "mux-state-names",
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-08-22 7:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-22 15:35 [PATCH 0/4] typec orientation switch support via mux controller Xu Yang
2022-08-22 15:35 ` [PATCH 1/4] dt-bindings: connector: Add typec orientation switch properties Xu Yang
2022-08-22 15:35 ` Xu Yang [this message]
2022-08-23 6:23 ` [PATCH 2/4] mux: allow get mux_control from fwnode if of_node is NULL Peter Rosin
2022-08-23 10:10 ` [EXT] " Xu Yang
2022-08-22 15:35 ` [PATCH 3/4] usb: typec: mux: add typec orientation switch support via mux controller Xu Yang
2022-08-22 11:22 ` kernel test robot
2022-08-22 15:46 ` kernel test robot
2022-08-23 5:13 ` [EXT] " Xu Yang
2022-08-23 6:13 ` Peter Rosin
2022-08-23 8:46 ` [EXT] " Xu Yang
2022-08-22 15:35 ` [PATCH 4/4] arm64: dts: imx8mp-evk: add typec node Xu Yang
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=20220822153517.3747679-3-xu.yang_2@nxp.com \
--to=xu.yang_2@nxp.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=jun.li@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=peda@axentia.se \
--cc=robh+dt@kernel.org \
--cc=shawnguo@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 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).