.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
---|
1 | 2 | /* |
---|
2 | 3 | * Keystone NetCP Core driver |
---|
3 | 4 | * |
---|
.. | .. |
---|
8 | 9 | * Santosh Shilimkar <santosh.shilimkar@ti.com> |
---|
9 | 10 | * Murali Karicheri <m-karicheri2@ti.com> |
---|
10 | 11 | * Wingman Kwok <w-kwok2@ti.com> |
---|
11 | | - * |
---|
12 | | - * This program is free software; you can redistribute it and/or |
---|
13 | | - * modify it under the terms of the GNU General Public License as |
---|
14 | | - * published by the Free Software Foundation version 2. |
---|
15 | | - * |
---|
16 | | - * This program is distributed "as is" WITHOUT ANY WARRANTY of any |
---|
17 | | - * kind, whether express or implied; without even the implied warranty |
---|
18 | | - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
19 | | - * GNU General Public License for more details. |
---|
20 | 12 | */ |
---|
21 | 13 | |
---|
22 | 14 | #include <linux/io.h> |
---|
.. | .. |
---|
225 | 217 | return 0; |
---|
226 | 218 | } |
---|
227 | 219 | |
---|
228 | | -static const char *netcp_node_name(struct device_node *node) |
---|
229 | | -{ |
---|
230 | | - const char *name; |
---|
231 | | - |
---|
232 | | - if (of_property_read_string(node, "label", &name) < 0) |
---|
233 | | - name = node->name; |
---|
234 | | - if (!name) |
---|
235 | | - name = "unknown"; |
---|
236 | | - return name; |
---|
237 | | -} |
---|
238 | | - |
---|
239 | 220 | /* Module management routines */ |
---|
240 | 221 | static int netcp_register_interface(struct netcp_intf *netcp) |
---|
241 | 222 | { |
---|
.. | .. |
---|
267 | 248 | } |
---|
268 | 249 | |
---|
269 | 250 | for_each_available_child_of_node(devices, child) { |
---|
270 | | - const char *name = netcp_node_name(child); |
---|
| 251 | + const char *name; |
---|
| 252 | + char node_name[32]; |
---|
271 | 253 | |
---|
| 254 | + if (of_property_read_string(child, "label", &name) < 0) { |
---|
| 255 | + snprintf(node_name, sizeof(node_name), "%pOFn", child); |
---|
| 256 | + name = node_name; |
---|
| 257 | + } |
---|
272 | 258 | if (!strcasecmp(module->name, name)) |
---|
273 | 259 | break; |
---|
274 | 260 | } |
---|
.. | .. |
---|
1130 | 1116 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { |
---|
1131 | 1117 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
---|
1132 | 1118 | struct page *page = skb_frag_page(frag); |
---|
1133 | | - u32 page_offset = frag->page_offset; |
---|
| 1119 | + u32 page_offset = skb_frag_off(frag); |
---|
1134 | 1120 | u32 buf_len = skb_frag_size(frag); |
---|
1135 | 1121 | dma_addr_t desc_dma; |
---|
1136 | 1122 | u32 desc_dma_32; |
---|
.. | .. |
---|
1364 | 1350 | tx_pipe->dma_queue = knav_queue_open(name, tx_pipe->dma_queue_id, |
---|
1365 | 1351 | KNAV_QUEUE_SHARED); |
---|
1366 | 1352 | if (IS_ERR(tx_pipe->dma_queue)) { |
---|
| 1353 | + dev_err(dev, "Could not open DMA queue for channel \"%s\": %pe\n", |
---|
| 1354 | + name, tx_pipe->dma_queue); |
---|
1367 | 1355 | ret = PTR_ERR(tx_pipe->dma_queue); |
---|
1368 | | - dev_err(dev, "Could not open DMA queue for channel \"%s\": %d\n", |
---|
1369 | | - name, ret); |
---|
1370 | 1356 | goto err; |
---|
1371 | 1357 | } |
---|
1372 | 1358 | |
---|
.. | .. |
---|
1825 | 1811 | return (ret == 0) ? 0 : err; |
---|
1826 | 1812 | } |
---|
1827 | 1813 | |
---|
1828 | | -static void netcp_ndo_tx_timeout(struct net_device *ndev) |
---|
| 1814 | +static void netcp_ndo_tx_timeout(struct net_device *ndev, unsigned int txqueue) |
---|
1829 | 1815 | { |
---|
1830 | 1816 | struct netcp_intf *netcp = netdev_priv(ndev); |
---|
1831 | 1817 | unsigned int descs = knav_pool_count(netcp->tx_pool); |
---|
.. | .. |
---|
2033 | 2019 | goto quit; |
---|
2034 | 2020 | } |
---|
2035 | 2021 | |
---|
2036 | | - efuse = devm_ioremap_nocache(dev, res.start, size); |
---|
| 2022 | + efuse = devm_ioremap(dev, res.start, size); |
---|
2037 | 2023 | if (!efuse) { |
---|
2038 | 2024 | dev_err(dev, "could not map resource\n"); |
---|
2039 | 2025 | devm_release_mem_region(dev, res.start, size); |
---|
.. | .. |
---|
2051 | 2037 | devm_release_mem_region(dev, res.start, size); |
---|
2052 | 2038 | } else { |
---|
2053 | 2039 | mac_addr = of_get_mac_address(node_interface); |
---|
2054 | | - if (mac_addr) |
---|
| 2040 | + if (!IS_ERR(mac_addr)) |
---|
2055 | 2041 | ether_addr_copy(ndev->dev_addr, mac_addr); |
---|
2056 | 2042 | else |
---|
2057 | 2043 | eth_random_addr(ndev->dev_addr); |
---|
.. | .. |
---|
2209 | 2195 | for_each_available_child_of_node(interfaces, child) { |
---|
2210 | 2196 | ret = netcp_create_interface(netcp_device, child); |
---|
2211 | 2197 | if (ret) { |
---|
2212 | | - dev_err(dev, "could not create interface(%s)\n", |
---|
2213 | | - child->name); |
---|
| 2198 | + dev_err(dev, "could not create interface(%pOFn)\n", |
---|
| 2199 | + child); |
---|
2214 | 2200 | goto probe_quit_interface; |
---|
2215 | 2201 | } |
---|
2216 | 2202 | } |
---|