Skip to content

Commit 8bca927

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Lots more phydev and probe error path leaks in various drivers by Johan Hovold. 2) Fix race in packet_set_ring(), from Philip Pettersson. 3) Use after free in dccp_invalid_packet(), from Eric Dumazet. 4) Signnedness overflow in SO_{SND,RCV}BUFFORCE, also from Eric Dumazet. 5) When tunneling between ipv4 and ipv6 we can be left with the wrong skb->protocol value as we enter the IPSEC engine and this causes all kinds of problems. Set it before the output path does any dst_output() calls, from Eli Cooper. 6) bcmgenet uses wrong device struct pointer in DMA API calls, fix from Florian Fainelli. 7) Various netfilter nat bug fixes from FLorian Westphal. 8) Fix memory leak in ipvlan_link_new(), from Gao Feng. 9) Locking fixes, particularly wrt. socket lookups, in l2tp from Guillaume Nault. 10) Avoid invoking rhash teardowns in atomic context by moving netlink cb->done() dump completion from a worker thread. Fix from Herbert Xu. 11) Buffer refcount problems in tun and macvtap on errors, from Jason Wang. 12) We don't set Kconfig symbol DEFAULT_TCP_CONG properly when the user selects BBR. Fix from Julian Wollrath. 13) Fix deadlock in transmit path on altera TSE driver, from Lino Sanfilippo. 14) Fix unbalanced reference counting in dsa_switch_tree, from Nikita Yushchenko. 15) tc_tunnel_key needs to be properly exported to userspace via uapi, fix from Roi Dayan. 16) rds_tcp_init_net() doesn't unregister notifier in error path, fix from Sowmini Varadhan. 17) Stale packet header pointer access after pskb_expand_head() in genenve driver, fix from Sabrina Dubroca. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (103 commits) net: avoid signed overflows for SO_{SND|RCV}BUFFORCE geneve: avoid use-after-free of skb->data tipc: check minimum bearer MTU net: renesas: ravb: unintialized return value sh_eth: remove unchecked interrupts for RZ/A1 net: bcmgenet: Utilize correct struct device for all DMA operations NET: usb: qmi_wwan: add support for Telit LE922A PID 0x1040 cdc_ether: Fix handling connection notification ip6_offload: check segs for NULL in ipv6_gso_segment. RDS: TCP: unregister_netdevice_notifier() in error path of rds_tcp_init_net Revert: "ip6_tunnel: Update skb->protocol to ETH_P_IPV6 in ip6_tnl_xmit()" ipv6: Set skb->protocol properly for local output ipv4: Set skb->protocol properly for local output packet: fix race condition in packet_set_ring net: ethernet: altera: TSE: do not use tx queue lock in tx completion handler net: ethernet: altera: TSE: Remove unneeded dma sync for tx buffers net: ethernet: stmmac: fix of-node and fixed-link-phydev leaks net: ethernet: stmmac: platform: fix outdated function header net: ethernet: stmmac: dwmac-meson8b: fix probe error path net: ethernet: stmmac: dwmac-generic: fix probe error path ...
2 parents ed8d747 + b98b0bc commit 8bca927

File tree

121 files changed

+1064
-450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+1064
-450
lines changed

Documentation/devicetree/bindings/net/ethernet.txt

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,26 @@ The following properties are common to the Ethernet controllers:
99
- max-speed: number, specifies maximum speed in Mbit/s supported by the device;
1010
- max-frame-size: number, maximum transfer unit (IEEE defined MTU), rather than
1111
the maximum frame size (there's contradiction in ePAPR).
12-
- phy-mode: string, operation mode of the PHY interface; supported values are
13-
"mii", "gmii", "sgmii", "qsgmii", "tbi", "rev-mii", "rmii", "rgmii", "rgmii-id",
14-
"rgmii-rxid", "rgmii-txid", "rtbi", "smii", "xgmii", "trgmii"; this is now a
15-
de-facto standard property;
12+
- phy-mode: string, operation mode of the PHY interface. This is now a de-facto
13+
standard property; supported values are:
14+
* "mii"
15+
* "gmii"
16+
* "sgmii"
17+
* "qsgmii"
18+
* "tbi"
19+
* "rev-mii"
20+
* "rmii"
21+
* "rgmii" (RX and TX delays are added by the MAC when required)
22+
* "rgmii-id" (RGMII with internal RX and TX delays provided by the PHY, the
23+
MAC should not add the RX or TX delays in this case)
24+
* "rgmii-rxid" (RGMII with internal RX delay provided by the PHY, the MAC
25+
should not add an RX delay in this case)
26+
* "rgmii-txid" (RGMII with internal TX delay provided by the PHY, the MAC
27+
should not add an TX delay in this case)
28+
* "rtbi"
29+
* "smii"
30+
* "xgmii"
31+
* "trgmii"
1632
- phy-connection-type: the same as "phy-mode" property but described in ePAPR;
1733
- phy-handle: phandle, specifies a reference to a node representing a PHY
1834
device; this property is described in ePAPR and so preferred;

Documentation/networking/nf_conntrack-sysctl.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ nf_conntrack_generic_timeout - INTEGER (seconds)
6262
protocols.
6363

6464
nf_conntrack_helper - BOOLEAN
65-
0 - disabled
66-
not 0 - enabled (default)
65+
0 - disabled (default)
66+
not 0 - enabled
6767

6868
Enable automatic conntrack helper assignment.
69+
If disabled it is required to set up iptables rules to assign
70+
helpers to connections. See the CT target description in the
71+
iptables-extensions(8) man page for further information.
6972

7073
nf_conntrack_icmp_timeout - INTEGER (seconds)
7174
default 30

drivers/net/can/usb/peak_usb/pcan_ucan.h

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,22 @@ struct __packed pucan_command {
4343
u16 args[3];
4444
};
4545

46+
#define PUCAN_TSLOW_BRP_BITS 10
47+
#define PUCAN_TSLOW_TSGEG1_BITS 8
48+
#define PUCAN_TSLOW_TSGEG2_BITS 7
49+
#define PUCAN_TSLOW_SJW_BITS 7
50+
51+
#define PUCAN_TSLOW_BRP_MASK ((1 << PUCAN_TSLOW_BRP_BITS) - 1)
52+
#define PUCAN_TSLOW_TSEG1_MASK ((1 << PUCAN_TSLOW_TSGEG1_BITS) - 1)
53+
#define PUCAN_TSLOW_TSEG2_MASK ((1 << PUCAN_TSLOW_TSGEG2_BITS) - 1)
54+
#define PUCAN_TSLOW_SJW_MASK ((1 << PUCAN_TSLOW_SJW_BITS) - 1)
55+
4656
/* uCAN TIMING_SLOW command fields */
47-
#define PUCAN_TSLOW_SJW_T(s, t) (((s) & 0xf) | ((!!(t)) << 7))
48-
#define PUCAN_TSLOW_TSEG2(t) ((t) & 0xf)
49-
#define PUCAN_TSLOW_TSEG1(t) ((t) & 0x3f)
50-
#define PUCAN_TSLOW_BRP(b) ((b) & 0x3ff)
57+
#define PUCAN_TSLOW_SJW_T(s, t) (((s) & PUCAN_TSLOW_SJW_MASK) | \
58+
((!!(t)) << 7))
59+
#define PUCAN_TSLOW_TSEG2(t) ((t) & PUCAN_TSLOW_TSEG2_MASK)
60+
#define PUCAN_TSLOW_TSEG1(t) ((t) & PUCAN_TSLOW_TSEG1_MASK)
61+
#define PUCAN_TSLOW_BRP(b) ((b) & PUCAN_TSLOW_BRP_MASK)
5162

5263
struct __packed pucan_timing_slow {
5364
__le16 opcode_channel;
@@ -60,11 +71,21 @@ struct __packed pucan_timing_slow {
6071
__le16 brp; /* BaudRate Prescaler */
6172
};
6273

74+
#define PUCAN_TFAST_BRP_BITS 10
75+
#define PUCAN_TFAST_TSGEG1_BITS 5
76+
#define PUCAN_TFAST_TSGEG2_BITS 4
77+
#define PUCAN_TFAST_SJW_BITS 4
78+
79+
#define PUCAN_TFAST_BRP_MASK ((1 << PUCAN_TFAST_BRP_BITS) - 1)
80+
#define PUCAN_TFAST_TSEG1_MASK ((1 << PUCAN_TFAST_TSGEG1_BITS) - 1)
81+
#define PUCAN_TFAST_TSEG2_MASK ((1 << PUCAN_TFAST_TSGEG2_BITS) - 1)
82+
#define PUCAN_TFAST_SJW_MASK ((1 << PUCAN_TFAST_SJW_BITS) - 1)
83+
6384
/* uCAN TIMING_FAST command fields */
64-
#define PUCAN_TFAST_SJW(s) ((s) & 0x3)
65-
#define PUCAN_TFAST_TSEG2(t) ((t) & 0x7)
66-
#define PUCAN_TFAST_TSEG1(t) ((t) & 0xf)
67-
#define PUCAN_TFAST_BRP(b) ((b) & 0x3ff)
85+
#define PUCAN_TFAST_SJW(s) ((s) & PUCAN_TFAST_SJW_MASK)
86+
#define PUCAN_TFAST_TSEG2(t) ((t) & PUCAN_TFAST_TSEG2_MASK)
87+
#define PUCAN_TFAST_TSEG1(t) ((t) & PUCAN_TFAST_TSEG1_MASK)
88+
#define PUCAN_TFAST_BRP(b) ((b) & PUCAN_TFAST_BRP_MASK)
6889

6990
struct __packed pucan_timing_fast {
7091
__le16 opcode_channel;

drivers/net/can/usb/peak_usb/pcan_usb_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ static struct usb_device_id peak_usb_table[] = {
3939
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USBPRO_PRODUCT_ID)},
4040
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USBFD_PRODUCT_ID)},
4141
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USBPROFD_PRODUCT_ID)},
42+
{USB_DEVICE(PCAN_USB_VENDOR_ID, PCAN_USBX6_PRODUCT_ID)},
4243
{} /* Terminating entry */
4344
};
4445

@@ -50,6 +51,7 @@ static const struct peak_usb_adapter *const peak_usb_adapters_list[] = {
5051
&pcan_usb_pro,
5152
&pcan_usb_fd,
5253
&pcan_usb_pro_fd,
54+
&pcan_usb_x6,
5355
};
5456

5557
/*

drivers/net/can/usb/peak_usb/pcan_usb_core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define PCAN_USBPRO_PRODUCT_ID 0x000d
2828
#define PCAN_USBPROFD_PRODUCT_ID 0x0011
2929
#define PCAN_USBFD_PRODUCT_ID 0x0012
30+
#define PCAN_USBX6_PRODUCT_ID 0x0014
3031

3132
#define PCAN_USB_DRIVER_NAME "peak_usb"
3233

@@ -90,6 +91,7 @@ extern const struct peak_usb_adapter pcan_usb;
9091
extern const struct peak_usb_adapter pcan_usb_pro;
9192
extern const struct peak_usb_adapter pcan_usb_fd;
9293
extern const struct peak_usb_adapter pcan_usb_pro_fd;
94+
extern const struct peak_usb_adapter pcan_usb_x6;
9395

9496
struct peak_time_ref {
9597
struct timeval tv_host_0, tv_host;

drivers/net/can/usb/peak_usb/pcan_usb_fd.c

Lines changed: 88 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -993,24 +993,24 @@ static void pcan_usb_fd_free(struct peak_usb_device *dev)
993993
static const struct can_bittiming_const pcan_usb_fd_const = {
994994
.name = "pcan_usb_fd",
995995
.tseg1_min = 1,
996-
.tseg1_max = 64,
996+
.tseg1_max = (1 << PUCAN_TSLOW_TSGEG1_BITS),
997997
.tseg2_min = 1,
998-
.tseg2_max = 16,
999-
.sjw_max = 16,
998+
.tseg2_max = (1 << PUCAN_TSLOW_TSGEG2_BITS),
999+
.sjw_max = (1 << PUCAN_TSLOW_SJW_BITS),
10001000
.brp_min = 1,
1001-
.brp_max = 1024,
1001+
.brp_max = (1 << PUCAN_TSLOW_BRP_BITS),
10021002
.brp_inc = 1,
10031003
};
10041004

10051005
static const struct can_bittiming_const pcan_usb_fd_data_const = {
10061006
.name = "pcan_usb_fd",
10071007
.tseg1_min = 1,
1008-
.tseg1_max = 16,
1008+
.tseg1_max = (1 << PUCAN_TFAST_TSGEG1_BITS),
10091009
.tseg2_min = 1,
1010-
.tseg2_max = 8,
1011-
.sjw_max = 4,
1010+
.tseg2_max = (1 << PUCAN_TFAST_TSGEG2_BITS),
1011+
.sjw_max = (1 << PUCAN_TFAST_SJW_BITS),
10121012
.brp_min = 1,
1013-
.brp_max = 1024,
1013+
.brp_max = (1 << PUCAN_TFAST_BRP_BITS),
10141014
.brp_inc = 1,
10151015
};
10161016

@@ -1065,24 +1065,24 @@ const struct peak_usb_adapter pcan_usb_fd = {
10651065
static const struct can_bittiming_const pcan_usb_pro_fd_const = {
10661066
.name = "pcan_usb_pro_fd",
10671067
.tseg1_min = 1,
1068-
.tseg1_max = 64,
1068+
.tseg1_max = (1 << PUCAN_TSLOW_TSGEG1_BITS),
10691069
.tseg2_min = 1,
1070-
.tseg2_max = 16,
1071-
.sjw_max = 16,
1070+
.tseg2_max = (1 << PUCAN_TSLOW_TSGEG2_BITS),
1071+
.sjw_max = (1 << PUCAN_TSLOW_SJW_BITS),
10721072
.brp_min = 1,
1073-
.brp_max = 1024,
1073+
.brp_max = (1 << PUCAN_TSLOW_BRP_BITS),
10741074
.brp_inc = 1,
10751075
};
10761076

10771077
static const struct can_bittiming_const pcan_usb_pro_fd_data_const = {
10781078
.name = "pcan_usb_pro_fd",
10791079
.tseg1_min = 1,
1080-
.tseg1_max = 16,
1080+
.tseg1_max = (1 << PUCAN_TFAST_TSGEG1_BITS),
10811081
.tseg2_min = 1,
1082-
.tseg2_max = 8,
1083-
.sjw_max = 4,
1082+
.tseg2_max = (1 << PUCAN_TFAST_TSGEG2_BITS),
1083+
.sjw_max = (1 << PUCAN_TFAST_SJW_BITS),
10841084
.brp_min = 1,
1085-
.brp_max = 1024,
1085+
.brp_max = (1 << PUCAN_TFAST_BRP_BITS),
10861086
.brp_inc = 1,
10871087
};
10881088

@@ -1132,3 +1132,75 @@ const struct peak_usb_adapter pcan_usb_pro_fd = {
11321132

11331133
.do_get_berr_counter = pcan_usb_fd_get_berr_counter,
11341134
};
1135+
1136+
/* describes the PCAN-USB X6 adapter */
1137+
static const struct can_bittiming_const pcan_usb_x6_const = {
1138+
.name = "pcan_usb_x6",
1139+
.tseg1_min = 1,
1140+
.tseg1_max = (1 << PUCAN_TSLOW_TSGEG1_BITS),
1141+
.tseg2_min = 1,
1142+
.tseg2_max = (1 << PUCAN_TSLOW_TSGEG2_BITS),
1143+
.sjw_max = (1 << PUCAN_TSLOW_SJW_BITS),
1144+
.brp_min = 1,
1145+
.brp_max = (1 << PUCAN_TSLOW_BRP_BITS),
1146+
.brp_inc = 1,
1147+
};
1148+
1149+
static const struct can_bittiming_const pcan_usb_x6_data_const = {
1150+
.name = "pcan_usb_x6",
1151+
.tseg1_min = 1,
1152+
.tseg1_max = (1 << PUCAN_TFAST_TSGEG1_BITS),
1153+
.tseg2_min = 1,
1154+
.tseg2_max = (1 << PUCAN_TFAST_TSGEG2_BITS),
1155+
.sjw_max = (1 << PUCAN_TFAST_SJW_BITS),
1156+
.brp_min = 1,
1157+
.brp_max = (1 << PUCAN_TFAST_BRP_BITS),
1158+
.brp_inc = 1,
1159+
};
1160+
1161+
const struct peak_usb_adapter pcan_usb_x6 = {
1162+
.name = "PCAN-USB X6",
1163+
.device_id = PCAN_USBX6_PRODUCT_ID,
1164+
.ctrl_count = PCAN_USBPROFD_CHANNEL_COUNT,
1165+
.ctrlmode_supported = CAN_CTRLMODE_FD |
1166+
CAN_CTRLMODE_3_SAMPLES | CAN_CTRLMODE_LISTENONLY,
1167+
.clock = {
1168+
.freq = PCAN_UFD_CRYSTAL_HZ,
1169+
},
1170+
.bittiming_const = &pcan_usb_x6_const,
1171+
.data_bittiming_const = &pcan_usb_x6_data_const,
1172+
1173+
/* size of device private data */
1174+
.sizeof_dev_private = sizeof(struct pcan_usb_fd_device),
1175+
1176+
/* timestamps usage */
1177+
.ts_used_bits = 32,
1178+
.ts_period = 1000000, /* calibration period in ts. */
1179+
.us_per_ts_scale = 1, /* us = (ts * scale) >> shift */
1180+
.us_per_ts_shift = 0,
1181+
1182+
/* give here messages in/out endpoints */
1183+
.ep_msg_in = PCAN_USBPRO_EP_MSGIN,
1184+
.ep_msg_out = {PCAN_USBPRO_EP_MSGOUT_0, PCAN_USBPRO_EP_MSGOUT_1},
1185+
1186+
/* size of rx/tx usb buffers */
1187+
.rx_buffer_size = PCAN_UFD_RX_BUFFER_SIZE,
1188+
.tx_buffer_size = PCAN_UFD_TX_BUFFER_SIZE,
1189+
1190+
/* device callbacks */
1191+
.intf_probe = pcan_usb_pro_probe, /* same as PCAN-USB Pro */
1192+
.dev_init = pcan_usb_fd_init,
1193+
1194+
.dev_exit = pcan_usb_fd_exit,
1195+
.dev_free = pcan_usb_fd_free,
1196+
.dev_set_bus = pcan_usb_fd_set_bus,
1197+
.dev_set_bittiming = pcan_usb_fd_set_bittiming_slow,
1198+
.dev_set_data_bittiming = pcan_usb_fd_set_bittiming_fast,
1199+
.dev_decode_buf = pcan_usb_fd_decode_buf,
1200+
.dev_start = pcan_usb_fd_start,
1201+
.dev_stop = pcan_usb_fd_stop,
1202+
.dev_restart_async = pcan_usb_fd_restart_async,
1203+
.dev_encode_msg = pcan_usb_fd_encode_msg,
1204+
1205+
.do_get_berr_counter = pcan_usb_fd_get_berr_counter,
1206+
};

drivers/net/ethernet/altera/altera_tse_main.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,6 @@ static int tse_rx(struct altera_tse_private *priv, int limit)
400400

401401
skb_put(skb, pktlength);
402402

403-
/* make cache consistent with receive packet buffer */
404-
dma_sync_single_for_cpu(priv->device,
405-
priv->rx_ring[entry].dma_addr,
406-
priv->rx_ring[entry].len,
407-
DMA_FROM_DEVICE);
408-
409403
dma_unmap_single(priv->device, priv->rx_ring[entry].dma_addr,
410404
priv->rx_ring[entry].len, DMA_FROM_DEVICE);
411405

@@ -469,15 +463,13 @@ static int tse_tx_complete(struct altera_tse_private *priv)
469463

470464
if (unlikely(netif_queue_stopped(priv->dev) &&
471465
tse_tx_avail(priv) > TSE_TX_THRESH(priv))) {
472-
netif_tx_lock(priv->dev);
473466
if (netif_queue_stopped(priv->dev) &&
474467
tse_tx_avail(priv) > TSE_TX_THRESH(priv)) {
475468
if (netif_msg_tx_done(priv))
476469
netdev_dbg(priv->dev, "%s: restart transmit\n",
477470
__func__);
478471
netif_wake_queue(priv->dev);
479472
}
480-
netif_tx_unlock(priv->dev);
481473
}
482474

483475
spin_unlock(&priv->tx_lock);
@@ -592,10 +584,6 @@ static int tse_start_xmit(struct sk_buff *skb, struct net_device *dev)
592584
buffer->dma_addr = dma_addr;
593585
buffer->len = nopaged_len;
594586

595-
/* Push data out of the cache hierarchy into main memory */
596-
dma_sync_single_for_device(priv->device, buffer->dma_addr,
597-
buffer->len, DMA_TO_DEVICE);
598-
599587
priv->dmaops->tx_buffer(priv, buffer);
600588

601589
skb_tx_timestamp(skb);
@@ -819,6 +807,8 @@ static int init_phy(struct net_device *dev)
819807

820808
if (!phydev) {
821809
netdev_err(dev, "Could not find the PHY\n");
810+
if (fixed_link)
811+
of_phy_deregister_fixed_link(priv->device->of_node);
822812
return -ENODEV;
823813
}
824814

@@ -1545,10 +1535,15 @@ static int altera_tse_probe(struct platform_device *pdev)
15451535
static int altera_tse_remove(struct platform_device *pdev)
15461536
{
15471537
struct net_device *ndev = platform_get_drvdata(pdev);
1538+
struct altera_tse_private *priv = netdev_priv(ndev);
15481539

1549-
if (ndev->phydev)
1540+
if (ndev->phydev) {
15501541
phy_disconnect(ndev->phydev);
15511542

1543+
if (of_phy_is_fixed_link(priv->device->of_node))
1544+
of_phy_deregister_fixed_link(priv->device->of_node);
1545+
}
1546+
15521547
platform_set_drvdata(pdev, NULL);
15531548
altera_tse_mdio_destroy(ndev);
15541549
unregister_netdev(ndev);

drivers/net/ethernet/amd/xgbe/xgbe-main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,7 @@ static int xgbe_remove(struct platform_device *pdev)
829829
return 0;
830830
}
831831

832-
#ifdef CONFIG_PM
832+
#ifdef CONFIG_PM_SLEEP
833833
static int xgbe_suspend(struct device *dev)
834834
{
835835
struct net_device *netdev = dev_get_drvdata(dev);
@@ -874,7 +874,7 @@ static int xgbe_resume(struct device *dev)
874874

875875
return ret;
876876
}
877-
#endif /* CONFIG_PM */
877+
#endif /* CONFIG_PM_SLEEP */
878878

879879
#ifdef CONFIG_ACPI
880880
static const struct acpi_device_id xgbe_acpi_match[] = {

drivers/net/ethernet/aurora/nb8800.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,12 +1466,12 @@ static int nb8800_probe(struct platform_device *pdev)
14661466

14671467
ret = nb8800_hw_init(dev);
14681468
if (ret)
1469-
goto err_free_bus;
1469+
goto err_deregister_fixed_link;
14701470

14711471
if (ops && ops->init) {
14721472
ret = ops->init(dev);
14731473
if (ret)
1474-
goto err_free_bus;
1474+
goto err_deregister_fixed_link;
14751475
}
14761476

14771477
dev->netdev_ops = &nb8800_netdev_ops;
@@ -1504,6 +1504,9 @@ static int nb8800_probe(struct platform_device *pdev)
15041504

15051505
err_free_dma:
15061506
nb8800_dma_free(dev);
1507+
err_deregister_fixed_link:
1508+
if (of_phy_is_fixed_link(pdev->dev.of_node))
1509+
of_phy_deregister_fixed_link(pdev->dev.of_node);
15071510
err_free_bus:
15081511
of_node_put(priv->phy_node);
15091512
mdiobus_unregister(bus);
@@ -1521,6 +1524,8 @@ static int nb8800_remove(struct platform_device *pdev)
15211524
struct nb8800_priv *priv = netdev_priv(ndev);
15221525

15231526
unregister_netdev(ndev);
1527+
if (of_phy_is_fixed_link(pdev->dev.of_node))
1528+
of_phy_deregister_fixed_link(pdev->dev.of_node);
15241529
of_node_put(priv->phy_node);
15251530

15261531
mdiobus_unregister(priv->mii_bus);

0 commit comments

Comments
 (0)