net: stmmac: Make ptp_clk_freq_config variable type explicit
authorAndrew Halaney <ahalaney@redhat.com>
Tue, 25 Jul 2023 21:04:25 +0000 (16:04 -0500)
committerJakub Kicinski <kuba@kernel.org>
Fri, 28 Jul 2023 03:32:57 +0000 (20:32 -0700)
The priv variable is _always_ of type (struct stmmac_priv *), so let's
stop using (void *) since it isn't abstracting anything.

Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
Link: https://lore.kernel.org/r/20230725211853.895832-3-ahalaney@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
include/linux/stmmac.h

index 0ffae78..979c755 100644 (file)
@@ -257,9 +257,8 @@ static void intel_speed_mode_2500(struct net_device *ndev, void *intel_data)
 /* Program PTP Clock Frequency for different variant of
  * Intel mGBE that has slightly different GPO mapping
  */
-static void intel_mgbe_ptp_clk_freq_config(void *npriv)
+static void intel_mgbe_ptp_clk_freq_config(struct stmmac_priv *priv)
 {
-       struct stmmac_priv *priv = (struct stmmac_priv *)npriv;
        struct intel_priv_data *intel_priv;
        u32 gpio_value;
 
index ef67dba..3d07025 100644 (file)
@@ -76,6 +76,8 @@
                        | DMA_AXI_BLEN_32 | DMA_AXI_BLEN_64 \
                        | DMA_AXI_BLEN_128 | DMA_AXI_BLEN_256)
 
+struct stmmac_priv;
+
 /* Platfrom data for platform device structure's platform_data field */
 
 struct stmmac_mdio_bus_data {
@@ -258,7 +260,7 @@ struct plat_stmmacenet_data {
        int (*serdes_powerup)(struct net_device *ndev, void *priv);
        void (*serdes_powerdown)(struct net_device *ndev, void *priv);
        void (*speed_mode_2500)(struct net_device *ndev, void *priv);
-       void (*ptp_clk_freq_config)(void *priv);
+       void (*ptp_clk_freq_config)(struct stmmac_priv *priv);
        int (*init)(struct platform_device *pdev, void *priv);
        void (*exit)(struct platform_device *pdev, void *priv);
        struct mac_device_info *(*setup)(void *priv);