Skip to content

Commit 4da4793

Browse files
Niklas Söderlundkuba-moo
authored andcommitted
net: ethernet: renesas: rcar_gen4_ptp: Remove different memory layout
When upstreaming the Gen4 PTP support for R-Car S4 the possibility for different memory layouts on other Gen4 SoCs was build in. It turns out this is not needed and instead needlessly makes the driver harder to read, remove the support code that would have allowed different memory layouts. This change only deals with the public functions used by other drivers, follow up work will clean up the rcar_gen4_ptp internals. Signed-off-by: Niklas Söderlund <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 43adad3 commit 4da4793

File tree

4 files changed

+6
-18
lines changed

4 files changed

+6
-18
lines changed

drivers/net/ethernet/renesas/rcar_gen4_ptp.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,8 @@ static struct ptp_clock_info rcar_gen4_ptp_info = {
130130
.enable = rcar_gen4_ptp_enable,
131131
};
132132

133-
static int rcar_gen4_ptp_set_offs(struct rcar_gen4_ptp_private *ptp_priv,
134-
enum rcar_gen4_ptp_reg_layout layout)
133+
static int rcar_gen4_ptp_set_offs(struct rcar_gen4_ptp_private *ptp_priv)
135134
{
136-
if (layout != RCAR_GEN4_PTP_REG_LAYOUT)
137-
return -EINVAL;
138-
139135
ptp_priv->offs = &gen4_offs;
140136

141137
return 0;
@@ -151,8 +147,7 @@ static s64 rcar_gen4_ptp_rate_to_increment(u32 rate)
151147
return div_s64(1000000000LL << 27, rate);
152148
}
153149

154-
int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv,
155-
enum rcar_gen4_ptp_reg_layout layout, u32 rate)
150+
int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv, u32 rate)
156151
{
157152
int ret;
158153

@@ -161,7 +156,7 @@ int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv,
161156

162157
spin_lock_init(&ptp_priv->lock);
163158

164-
ret = rcar_gen4_ptp_set_offs(ptp_priv, layout);
159+
ret = rcar_gen4_ptp_set_offs(ptp_priv);
165160
if (ret)
166161
return ret;
167162

drivers/net/ethernet/renesas/rcar_gen4_ptp.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111

1212
#define RCAR_GEN4_GPTP_OFFSET_S4 0x00018000
1313

14-
enum rcar_gen4_ptp_reg_layout {
15-
RCAR_GEN4_PTP_REG_LAYOUT
16-
};
17-
1814
/* driver's definitions */
1915
#define RCAR_GEN4_RXTSTAMP_ENABLED BIT(0)
2016
#define RCAR_GEN4_RXTSTAMP_TYPE_V2_L2_EVENT BIT(1)
@@ -61,8 +57,7 @@ struct rcar_gen4_ptp_private {
6157
bool initialized;
6258
};
6359

64-
int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv,
65-
enum rcar_gen4_ptp_reg_layout layout, u32 rate);
60+
int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv, u32 rate);
6661
int rcar_gen4_ptp_unregister(struct rcar_gen4_ptp_private *ptp_priv);
6762
struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev);
6863

drivers/net/ethernet/renesas/rswitch_main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,8 +2090,7 @@ static int rswitch_init(struct rswitch_private *priv)
20902090
if (err < 0)
20912091
goto err_fwd_init;
20922092

2093-
err = rcar_gen4_ptp_register(priv->ptp_priv, RCAR_GEN4_PTP_REG_LAYOUT,
2094-
clk_get_rate(priv->clk));
2093+
err = rcar_gen4_ptp_register(priv->ptp_priv, clk_get_rate(priv->clk));
20952094
if (err < 0)
20962095
goto err_ptp_register;
20972096

drivers/net/ethernet/renesas/rtsn.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,8 +1330,7 @@ static int rtsn_probe(struct platform_device *pdev)
13301330

13311331
device_set_wakeup_capable(&pdev->dev, 1);
13321332

1333-
ret = rcar_gen4_ptp_register(priv->ptp_priv, RCAR_GEN4_PTP_REG_LAYOUT,
1334-
clk_get_rate(priv->clk));
1333+
ret = rcar_gen4_ptp_register(priv->ptp_priv, clk_get_rate(priv->clk));
13351334
if (ret)
13361335
goto error_pm;
13371336

0 commit comments

Comments
 (0)