Re: [PATCH 3/5] usb: roles: add API to get usb_role_switch by node

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

 



On Fri, Mar 8, 2019 at 8:14 AM Chunfeng Yun <chunfeng.yun@xxxxxxxxxxxx> wrote:
>
> Add usb_role_switch_get_by_node() to make easier to get
> usb_role_switch by node which register it.
> It's useful when there is not device_connection registered
> between two drivers and only knows the node which register
> usb_role_switch.

> +static int __switch_match_node(struct device *dev, const void *node)
> +{
> +       return dev->parent->of_node == (const struct device_node *)node;
> +}

Hmm... Shouldn't be slightly better to compare fwnode instead?

-- 
With Best Regards,
Andy Shevchenko



[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