summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2023-01-09 10:21:42 +0300
committerDavid S. Miller <davem@davemloft.net>2023-01-09 10:21:42 +0300
commit9cb8bae3d17b517abba74c13dd0327653b9142a4 (patch)
treede8bd811cb6b761fdd9d9164ec503de6b2b9d470 /drivers
parentf23395b4049c826bc1a294eea69459cb774598b4 (diff)
parent3f88d7d1be42a84a4ae292f085c3886597a04137 (diff)
downloadlinux-9cb8bae3d17b517abba74c13dd0327653b9142a4.tar.xz
Merge branch 'phy-micrel-warnings'
Divya Koppera says: ==================== Fixed warnings Fixed warnings related to PTR_ERR and initialization. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/micrel.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 2243ad1b88e7..d5b80c31ab91 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -2088,7 +2088,8 @@ static int ksz886x_cable_test_get_status(struct phy_device *phydev,
const struct kszphy_type *type = phydev->drv->driver_data;
unsigned long pair_mask = type->pair_mask;
int retries = 20;
- int pair, ret;
+ int ret = 0;
+ int pair;
*finished = false;
@@ -3007,10 +3008,6 @@ static int lan8814_ptp_probe_once(struct phy_device *phydev)
{
struct lan8814_shared_priv *shared = phydev->shared->priv;
- if (!IS_ENABLED(CONFIG_PTP_1588_CLOCK) ||
- !IS_ENABLED(CONFIG_NETWORK_PHY_TIMESTAMPING))
- return 0;
-
/* Initialise shared lock for clock*/
mutex_init(&shared->shared_lock);
@@ -3030,12 +3027,16 @@ static int lan8814_ptp_probe_once(struct phy_device *phydev)
shared->ptp_clock = ptp_clock_register(&shared->ptp_clock_info,
&phydev->mdio.dev);
- if (IS_ERR_OR_NULL(shared->ptp_clock)) {
+ if (IS_ERR(shared->ptp_clock)) {
phydev_err(phydev, "ptp_clock_register failed %lu\n",
PTR_ERR(shared->ptp_clock));
return -EINVAL;
}
+ /* Check if PHC support is missing at the configuration level */
+ if (!shared->ptp_clock)
+ return 0;
+
phydev_dbg(phydev, "successfully registered ptp clock\n");
shared->phydev = phydev;