can: mcp251xfd: mcp251xfd_reg_invalid(): rename from mcp251xfd_osc_invalid()
This patch renames mcp251xfd_osc_invalid() to mcp251xfd_reg_invalid(), as it will be used for other registers than the "osc" register in a later patch. This patch also moves this function to more towards the beginning of the file, to be available for other functions, too. Link: https://lore.kernel.org/all/20220207131047.282110-2-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
2ae9856d70
commit
3f5c91b4ce
@ -178,6 +178,11 @@ static int mcp251xfd_clks_and_vdd_disable(const struct mcp251xfd_priv *priv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline bool mcp251xfd_reg_invalid(u32 reg)
|
||||
{
|
||||
return reg == 0x0 || reg == 0xffffffff;
|
||||
}
|
||||
|
||||
static inline int
|
||||
mcp251xfd_chip_get_mode(const struct mcp251xfd_priv *priv, u8 *mode)
|
||||
{
|
||||
@ -241,11 +246,6 @@ mcp251xfd_chip_set_mode_nowait(const struct mcp251xfd_priv *priv,
|
||||
return __mcp251xfd_chip_set_mode(priv, mode_req, true);
|
||||
}
|
||||
|
||||
static inline bool mcp251xfd_osc_invalid(u32 reg)
|
||||
{
|
||||
return reg == 0x0 || reg == 0xffffffff;
|
||||
}
|
||||
|
||||
static int mcp251xfd_chip_clock_enable(const struct mcp251xfd_priv *priv)
|
||||
{
|
||||
u32 osc, osc_reference, osc_mask;
|
||||
@ -274,7 +274,7 @@ static int mcp251xfd_chip_clock_enable(const struct mcp251xfd_priv *priv)
|
||||
(osc & osc_mask) == osc_reference,
|
||||
MCP251XFD_OSC_STAB_SLEEP_US,
|
||||
MCP251XFD_OSC_STAB_TIMEOUT_US);
|
||||
if (mcp251xfd_osc_invalid(osc)) {
|
||||
if (mcp251xfd_reg_invalid(osc)) {
|
||||
netdev_err(priv->ndev,
|
||||
"Failed to detect %s (osc=0x%08x).\n",
|
||||
mcp251xfd_get_model_str(priv), osc);
|
||||
|
Loading…
Reference in New Issue
Block a user