forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
....@@ -1,22 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* Applied Micro X-Gene SoC Ethernet Driver
23 *
34 * Copyright (c) 2014, Applied Micro Circuits Corporation
45 * Authors: Iyappan Subramanian <isubramanian@apm.com>
56 * Ravi Patel <rapatel@apm.com>
67 * Keyur Chudgar <kchudgar@apm.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the
10
- * Free Software Foundation; either version 2 of the License, or (at your
11
- * option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
208 */
219
2210 #include "xgene_enet_main.h"
....@@ -724,11 +712,11 @@
724712 udelay(5);
725713 } else {
726714 #ifdef CONFIG_ACPI
727
- if (acpi_has_method(ACPI_HANDLE(&pdata->pdev->dev), "_RST")) {
728
- acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
729
- "_RST", NULL, NULL);
730
- } else if (acpi_has_method(ACPI_HANDLE(&pdata->pdev->dev),
731
- "_INI")) {
715
+ acpi_status status;
716
+
717
+ status = acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
718
+ "_RST", NULL, NULL);
719
+ if (ACPI_FAILURE(status)) {
732720 acpi_evaluate_object(ACPI_HANDLE(&pdata->pdev->dev),
733721 "_INI", NULL, NULL);
734722 }
....@@ -895,12 +883,10 @@
895883 }
896884
897885 pdata->phy_speed = SPEED_UNKNOWN;
898
- phy_dev->supported &= ~SUPPORTED_10baseT_Half &
899
- ~SUPPORTED_100baseT_Half &
900
- ~SUPPORTED_1000baseT_Half;
901
- phy_dev->supported |= SUPPORTED_Pause |
902
- SUPPORTED_Asym_Pause;
903
- phy_dev->advertising = phy_dev->supported;
886
+ phy_remove_link_mode(phy_dev, ETHTOOL_LINK_MODE_10baseT_Half_BIT);
887
+ phy_remove_link_mode(phy_dev, ETHTOOL_LINK_MODE_100baseT_Half_BIT);
888
+ phy_remove_link_mode(phy_dev, ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
889
+ phy_support_asym_pause(phy_dev);
904890
905891 return 0;
906892 }