From patchwork Thu Oct 19 14:29:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kory Maincent X-Patchwork-Id: 13429294 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A7C22AB5B; Thu, 19 Oct 2023 14:29:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Ij3j/CTi" Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A3AA119; Thu, 19 Oct 2023 07:29:43 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7527A60004; Thu, 19 Oct 2023 14:29:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1697725782; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iLcv2U5/tJBWHcDOVIYyQDAJQb5WKSZvw4UjIoMJnco=; b=Ij3j/CTi+ULBqRLsOa3XYt71BVUJlYUwYm01CUtgNBboUfUX4Jc+GiMLIqYoQzklhsFR47 daVnAx59wx+o4YsMICB6sSTMwp94gkGEwzvxUI5nkgNgF4GloaI56kg8nJxfZop5a4hudu o915NnGDC1iMHXLMBlfAVVI66T0hNGzLkaM1l+8hANBkEL6/OQowSHwyjqTAk1jDxRrSvX EHqIrNIuVvklbCioJ2BBRwSzwEel7Tsh8fR3yMxSN512QPaw7ndMFMhvUCX8ybtn3AvBwr 5t6ZHHW5N5fR9oW2Sceop8lKr3fF+ld+u3VqOIjwwzaNYzAjH9MWHySWm7QEbg== From: Kory Maincent Date: Thu, 19 Oct 2023 16:29:17 +0200 Subject: [PATCH net-next v6 02/16] net: phy: Remove the call to phy_mii_ioctl in phy_hwstamp_get/set Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231019-feature_ptp_netnext-v6-2-71affc27b0e5@bootlin.com> References: <20231019-feature_ptp_netnext-v6-0-71affc27b0e5@bootlin.com> In-Reply-To: <20231019-feature_ptp_netnext-v6-0-71affc27b0e5@bootlin.com> To: Florian Fainelli , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Radu Pirea , Jay Vosburgh , Andy Gospodarek , Nicolas Ferre , Claudiu Beznea , Willem de Bruijn , Jonathan Corbet , Horatiu Vultur , UNGLinuxDriver@microchip.com, Simon Horman , Vladimir Oltean Cc: Thomas Petazzoni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Maxime Chevallier , Kory Maincent X-Mailer: b4 0.12.3 X-GND-Sasl: kory.maincent@bootlin.com X-Patchwork-Delegate: kuba@kernel.org __phy_hwtstamp_set function were calling the phy_mii_ioctl function which will then use the ifreq pointer to call the hwtstamp callback. Now that ifreq has been removed from the hwstamp callback parameters it seems more logical to not go through the phy_mii_ioctl function and pass directly kernel_hwtstamp_config parameter to the hwtstamp callback. Lets do the same for __phy_hwtstamp_get function and return directly EOPNOTSUPP as SIOCGHWTSTAMP is not supported for now for the PHYs. Signed-off-by: Kory Maincent Reviewed-by: Florian Fainelli --- drivers/net/phy/phy.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index d058316666ba..3376e58e2b88 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -486,7 +486,7 @@ int __phy_hwtstamp_get(struct phy_device *phydev, if (!phydev) return -ENODEV; - return phy_mii_ioctl(phydev, config->ifr, SIOCGHWTSTAMP); + return -EOPNOTSUPP; } /** @@ -503,7 +503,10 @@ int __phy_hwtstamp_set(struct phy_device *phydev, if (!phydev) return -ENODEV; - return phy_mii_ioctl(phydev, config->ifr, SIOCSHWTSTAMP); + if (phydev->mii_ts && phydev->mii_ts->hwtstamp) + return phydev->mii_ts->hwtstamp(phydev->mii_ts, config, extack); + + return -EOPNOTSUPP; } /**