Skip to content

Commit d928d14

Browse files
ahalaneykuba-moo
authored andcommitted
net: stmmac: Make ptp_clk_freq_config variable type explicit
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>
1 parent 5908a4c commit d928d14

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,8 @@ static void intel_speed_mode_2500(struct net_device *ndev, void *intel_data)
257257
/* Program PTP Clock Frequency for different variant of
258258
* Intel mGBE that has slightly different GPO mapping
259259
*/
260-
static void intel_mgbe_ptp_clk_freq_config(void *npriv)
260+
static void intel_mgbe_ptp_clk_freq_config(struct stmmac_priv *priv)
261261
{
262-
struct stmmac_priv *priv = (struct stmmac_priv *)npriv;
263262
struct intel_priv_data *intel_priv;
264263
u32 gpio_value;
265264

include/linux/stmmac.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
| DMA_AXI_BLEN_32 | DMA_AXI_BLEN_64 \
7777
| DMA_AXI_BLEN_128 | DMA_AXI_BLEN_256)
7878

79+
struct stmmac_priv;
80+
7981
/* Platfrom data for platform device structure's platform_data field */
8082

8183
struct stmmac_mdio_bus_data {
@@ -258,7 +260,7 @@ struct plat_stmmacenet_data {
258260
int (*serdes_powerup)(struct net_device *ndev, void *priv);
259261
void (*serdes_powerdown)(struct net_device *ndev, void *priv);
260262
void (*speed_mode_2500)(struct net_device *ndev, void *priv);
261-
void (*ptp_clk_freq_config)(void *priv);
263+
void (*ptp_clk_freq_config)(struct stmmac_priv *priv);
262264
int (*init)(struct platform_device *pdev, void *priv);
263265
void (*exit)(struct platform_device *pdev, void *priv);
264266
struct mac_device_info *(*setup)(void *priv);

0 commit comments

Comments
 (0)