lkml.org 
[lkml]   [2018]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v1 07/12] usb: roles: Find the usb role switch by also matching against the device node
On Mon, Dec 3, 2018 at 5:45 AM Yu Chen <chenyu56@huawei.com> wrote:
>
> This patch adds code for supporting find usb role switch by matching against
> the device node described using of_graph.

> #include <linux/module.h>
> #include <linux/mutex.h>
> #include <linux/slab.h>
> +#include <linux/of.h>
> +#include <linux/of_graph.h>

Keep it ordered.

> +static int __switch_match_by_of_node(struct device *dev, const void *name)
> +{
> + if (!dev->parent || !dev->parent->of_node)
> + return 0;
> +
> + return of_node_name_eq(dev->parent->of_node, (const char *)name);
> +}

I think Heikki has introduced some more generic function for this.

> sw = device_connection_find_match(dev, "usb-role-switch", NULL,
> usb_role_switch_match);

> + sw = of_graph_find_match_by_type(dev, "usb-role-switch");

Why this is here?! device_connection_find_match() should take care for OF case.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2018-12-03 09:18    [W:0.268 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site