[net-next PATCH 01/11] net: dsa: qca8k: add LEDs basic support

Andrew Lunn andrew at lunn.ch
Tue Mar 7 15:16:13 PST 2023


> +qca8k_setup_led_ctrl(struct qca8k_priv *priv)
> +{
> +	struct fwnode_handle *ports, *port;
> +	int port_num;
> +	int ret;
> +
> +	ports = device_get_named_child_node(priv->dev, "ports");
> +	if (!ports) {
> +		dev_info(priv->dev, "No ports node specified in device tree!\n");
> +		return 0;
> +	}
> +
> +	fwnode_for_each_child_node(ports, port) {
> +		struct fwnode_handle *phy_node, *reg_port_node = port;
> +
> +		phy_node = fwnode_find_reference(port, "phy-handle", 0);
> +		if (!IS_ERR(phy_node))
> +			reg_port_node = phy_node;

I don't understand this bit. Why are you looking at the phy-handle?

> +
> +		if (fwnode_property_read_u32(reg_port_node, "reg", &port_num))
> +			continue;

I would of expect port, not reg_port_node. I'm missing something
here....

	Andrew



More information about the linux-arm-kernel mailing list