/* * of.c The helpers for hcd device tree support * * Copyright (C) 2016 Freescale Semiconductor, Inc. * Author: Peter Chen * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 of * the License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include #include /** * usb_of_get_child_node - Find the device node match port number * @parent: the parent device node * @portnum: the port number which device is connecting * * Find the node from device tree according to its port number. * * Return: On success, a pointer to the device node, %NULL on failure. */ struct device_node *usb_of_get_child_node(struct device_node *parent, int portnum) { struct device_node *node; u32 port; for_each_child_of_node(parent, node) { if (!of_property_read_u32(node, "reg", &port)) { if (port == portnum) return node; } } return NULL; } EXPORT_SYMBOL_GPL(usb_of_get_child_node); b right'>Tobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Cooper <jcooper@solarflare.com>2017-02-08 16:51:18 +0000
committerDavid S. Miller <davem@davemloft.net>2017-02-09 16:47:53 -0500
commit8a531400623c52b09bc3b718e9a6142eb60a11a7 (patch)
tree69c112ee46b2abd486bc2c5c9d79d910f8533ba3
parentda50ae2eae96e00e0188b24014efc10161e60925 (diff)
sfc: harden driver against MC resets during initial probe
This is mainly to prepare for a future overlay networking patch that could cause an MC reset at probe time if the UDP tunnel port list is set immediately upon driver load. Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/sfc/efx.c99
1 files changed, 64 insertions, 35 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c