Skip to content

Commit 03eafc5

Browse files
erwangojhedberg
authored andcommitted
drivers: ethernet: stm32: Remove eth_stm32_get_iface
Now that the function is not static anymore, it just adds useless overhead. Signed-off-by: Erwan Gouriou <[email protected]>
1 parent 967f554 commit 03eafc5

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

drivers/ethernet/eth_stm32_hal_common.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ ETH_DMADescTypeDef dma_tx_desc_tab[ETH_TXBUFNB] __eth_stm32_desc;
6161

6262
const struct device *eth_stm32_phy_dev = DEVICE_DT_GET(DT_INST_PHANDLE(0, phy_handle));
6363

64-
struct net_if *eth_stm32_get_iface(struct eth_stm32_hal_dev_data *ctx)
65-
{
66-
return ctx->iface;
67-
}
68-
6964
static void rx_thread(void *arg1, void *unused1, void *unused2)
7065
{
7166
const struct device *dev = (const struct device *)arg1;

drivers/ethernet/eth_stm32_hal_v1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ struct net_pkt *eth_stm32_rx(const struct device *dev)
135135
total_len = heth->RxFrameInfos.length;
136136
dma_buffer = (uint8_t *)heth->RxFrameInfos.buffer;
137137

138-
pkt = net_pkt_rx_alloc_with_buffer(eth_stm32_get_iface(dev_data),
138+
pkt = net_pkt_rx_alloc_with_buffer(dev_data->iface,
139139
total_len, AF_UNSPEC, 0, K_MSEC(100));
140140
if (!pkt) {
141141
LOG_ERR("Failed to obtain RX buffer");
@@ -179,7 +179,7 @@ struct net_pkt *eth_stm32_rx(const struct device *dev)
179179

180180
out:
181181
if (!pkt) {
182-
eth_stats_update_errors_rx(eth_stm32_get_iface(dev_data));
182+
eth_stats_update_errors_rx(dev_data->iface);
183183
}
184184

185185
return pkt;

drivers/ethernet/eth_stm32_hal_v2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ struct net_pkt *eth_stm32_rx(const struct device *dev)
334334
}
335335
#endif /* CONFIG_PTP_CLOCK_STM32_HAL */
336336

337-
pkt = net_pkt_rx_alloc_with_buffer(eth_stm32_get_iface(dev_data),
337+
pkt = net_pkt_rx_alloc_with_buffer(dev_data->iface,
338338
total_len, AF_UNSPEC, 0, K_MSEC(100));
339339
if (!pkt) {
340340
LOG_ERR("Failed to obtain RX buffer");
@@ -374,7 +374,7 @@ struct net_pkt *eth_stm32_rx(const struct device *dev)
374374

375375
out:
376376
if (!pkt) {
377-
eth_stats_update_errors_rx(eth_stm32_get_iface(dev_data));
377+
eth_stats_update_errors_rx(dev_data->iface);
378378
}
379379

380380
return pkt;

0 commit comments

Comments
 (0)