@@ -1475,7 +1475,7 @@ static const struct ethtool_ops rteth_ethtool_ops = {
14751475 .set_link_ksettings = rteth_set_link_ksettings ,
14761476};
14771477
1478- static int rtl838x_eth_probe (struct platform_device * pdev )
1478+ static int rteth_probe (struct platform_device * pdev )
14791479{
14801480 struct net_device * dev ;
14811481 struct device_node * dn = pdev -> dev .of_node ;
@@ -1489,11 +1489,6 @@ static int rtl838x_eth_probe(struct platform_device *pdev)
14891489 pr_info ("Probing RTL838X eth device pdev: %x, dev: %x\n" ,
14901490 (u32 )pdev , (u32 )(& pdev -> dev ));
14911491
1492- if (!dn ) {
1493- dev_err (& pdev -> dev , "No DT found\n" );
1494- return - EINVAL ;
1495- }
1496-
14971492 cfg = device_get_match_data (& pdev -> dev );
14981493
14991494 dev = devm_alloc_etherdev_mqs (& pdev -> dev , sizeof (struct rteth_ctrl ), RTETH_TX_RINGS , RTETH_RX_RINGS );
@@ -1616,23 +1611,21 @@ static int rtl838x_eth_probe(struct platform_device *pdev)
16161611 return 0 ;
16171612}
16181613
1619- static void rtl838x_eth_remove (struct platform_device * pdev )
1614+ static void rteth_remove (struct platform_device * pdev )
16201615{
16211616 struct net_device * dev = platform_get_drvdata (pdev );
16221617 struct rteth_ctrl * ctrl = netdev_priv (dev );
16231618
1624- if (dev ) {
1625- pr_info ("Removing platform driver for rtl838x-eth\n" );
1626- rteth_hw_stop (ctrl );
1619+ pr_info ("Removing platform driver for rtl838x-eth\n" );
1620+ rteth_hw_stop (ctrl );
16271621
1628- netif_tx_stop_all_queues (dev );
1622+ netif_tx_stop_all_queues (dev );
16291623
1630- for (int i = 0 ; i < RTETH_RX_RINGS ; i ++ )
1631- netif_napi_del (& ctrl -> rx_qs [i ].napi );
1632- }
1624+ for (int i = 0 ; i < RTETH_RX_RINGS ; i ++ )
1625+ netif_napi_del (& ctrl -> rx_qs [i ].napi );
16331626}
16341627
1635- static const struct of_device_id rtl838x_eth_of_ids [] = {
1628+ static const struct of_device_id rteth_of_ids [] = {
16361629 {
16371630 .compatible = "realtek,rtl8380-eth" ,
16381631 .data = & rteth_838x_cfg ,
@@ -1651,15 +1644,15 @@ static const struct of_device_id rtl838x_eth_of_ids[] = {
16511644 },
16521645 { /* sentinel */ }
16531646};
1654- MODULE_DEVICE_TABLE (of , rtl838x_eth_of_ids );
1647+ MODULE_DEVICE_TABLE (of , rteth_of_ids );
16551648
16561649static struct platform_driver rtl838x_eth_driver = {
1657- .probe = rtl838x_eth_probe ,
1658- .remove = rtl838x_eth_remove ,
1650+ .probe = rteth_probe ,
1651+ .remove = rteth_remove ,
16591652 .driver = {
1660- .name = "rtl838x-eth" ,
1653+ .name = KBUILD_MODNAME ,
16611654 .pm = NULL ,
1662- .of_match_table = rtl838x_eth_of_ids ,
1655+ .of_match_table = rteth_of_ids ,
16631656 },
16641657};
16651658
0 commit comments