Skip to content

Commit 6d5fe10

Browse files
bijudasmarckleinebudde
authored andcommitted
can: sja1000: Change the return type as void for SoC specific init
Change the return type as void for SoC specific init function as it always return 0. Link: https://lore.kernel.org/all/[email protected] Signed-off-by: Biju Das <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 63ab1b6 commit 6d5fe10

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

drivers/net/can/sja1000/sja1000_platform.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ MODULE_LICENSE("GPL v2");
3131

3232
struct sja1000_of_data {
3333
size_t priv_sz;
34-
int (*init)(struct sja1000_priv *priv, struct device_node *of);
34+
void (*init)(struct sja1000_priv *priv, struct device_node *of);
3535
};
3636

3737
struct technologic_priv {
@@ -94,15 +94,13 @@ static void sp_technologic_write_reg16(const struct sja1000_priv *priv,
9494
spin_unlock_irqrestore(&tp->io_lock, flags);
9595
}
9696

97-
static int sp_technologic_init(struct sja1000_priv *priv, struct device_node *of)
97+
static void sp_technologic_init(struct sja1000_priv *priv, struct device_node *of)
9898
{
9999
struct technologic_priv *tp = priv->priv;
100100

101101
priv->read_reg = sp_technologic_read_reg16;
102102
priv->write_reg = sp_technologic_write_reg16;
103103
spin_lock_init(&tp->io_lock);
104-
105-
return 0;
106104
}
107105

108106
static void sp_populate(struct sja1000_priv *priv,
@@ -266,11 +264,8 @@ static int sp_probe(struct platform_device *pdev)
266264
if (of) {
267265
sp_populate_of(priv, of);
268266

269-
if (of_data && of_data->init) {
270-
err = of_data->init(priv, of);
271-
if (err)
272-
goto exit_free;
273-
}
267+
if (of_data && of_data->init)
268+
of_data->init(priv, of);
274269
} else {
275270
sp_populate(priv, pdata, res_mem->flags);
276271
}

0 commit comments

Comments
 (0)