Re: [PATCH 2/4] mux: allow get mux_control from fwnode if of_node is NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
> ---
>  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



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux