linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: Xu Yang <xu.yang_2@nxp.com>,
	heikki.krogerus@linux.intel.com, robh+dt@kernel.org,
	shawnguo@kernel.org
Cc: gregkh@linuxfoundation.org, linux@roeck-us.net, jun.li@nxp.com,
	linux-usb@vger.kernel.org, linux-imx@nxp.com,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/4] mux: allow get mux_control from fwnode if of_node is NULL
Date: Tue, 23 Aug 2022 08:23:07 +0200	[thread overview]
Message-ID: <6a3838dc-e979-2ef6-b332-92d5007fd41c@axentia.se> (raw)
In-Reply-To: <20220822153517.3747679-3-xu.yang_2@nxp.com>

Hi!

2022-08-22 at 17:35, Xu Yang wrote:
> 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",

This feels like a band aid. Is it not possible to convert the whole thing to
the fwnode interface?

Cheers,
Peter

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

  reply	other threads:[~2022-08-23  6:24 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 ` [PATCH 2/4] mux: allow get mux_control from fwnode if of_node is NULL Xu Yang
2022-08-23  6:23   ` Peter Rosin [this message]
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=6a3838dc-e979-2ef6-b332-92d5007fd41c@axentia.se \
    --to=peda@axentia.se \
    --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=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=xu.yang_2@nxp.com \
    /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).