Skip to content

Commit

Permalink
Merge branch 'phy-micrel-warnings'
Browse files Browse the repository at this point in the history
Divya Koppera says:

====================
Fixed warnings

Fixed warnings related to PTR_ERR and initialization.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jan 9, 2023
2 parents f23395b + 3f88d7d commit 9cb8bae
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions drivers/net/phy/micrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);

Expand All @@ -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;
Expand Down

0 comments on commit 9cb8bae

Please sign in to comment.