Re: [2/2] ethernet: ti: eliminated some duplicate code.

From: Markus Elfring
Date: Tue Apr 09 2019 - 03:30:37 EST


> Put the code that obtains device_node and the code that
> uses it tightly together to remove duplicate resource
> cleanup statements between them.

1. Would the wording âethernet: ti: eliminate a bit of duplicate code in gbe_probe()â
be more appropriate for the commit subject?

2. I find that such a change can be provided also without combining
it into a patch series with only two update steps.
Otherwise: Why did you omit the cover letter for the updates
by this small patch series?


> @@ -3651,22 +3651,18 @@ static int gbe_probe(struct netcp_device *netcp_device, struct device *dev,
> if (ret)
> return ret;
>
> - interfaces = of_get_child_by_name(node, "interfaces");
> - if (!interfaces)
> - dev_err(dev, "could not find interfaces\n");
> -
> ret = netcp_txpipe_init(&gbe_dev->tx_pipe, netcp_device,
> gbe_dev->dma_chan_name, gbe_dev->tx_queue_id);
> - if (ret) {
> - of_node_put(interfaces);
> + if (ret)
> return ret;
> - }
>
> ret = netcp_txpipe_open(&gbe_dev->tx_pipe);
> - if (ret) {
> - of_node_put(interfaces);
> + if (ret)
> return ret;
> - }
> +
> + interfaces = of_get_child_by_name(node, "interfaces");
> + if (!interfaces)
> + dev_err(dev, "could not find interfaces\n");

3. Can this error message trigger any further software development considerations
for the desired exception handling?


>
> /* Create network interfaces */
> INIT_LIST_HEAD(&gbe_dev->gbe_intf_head);


Regards,
Markus