All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: linux-can@vger.kernel.org
Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	Thomas Kopp <thomas.kopp@microchip.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH 01/15] can: mcp251xfd: mcp251xfd_reg_invalid(): rename from mcp251xfd_osc_invalid()
Date: Mon,  7 Feb 2022 14:10:33 +0100	[thread overview]
Message-ID: <20220207131047.282110-2-mkl@pengutronix.de> (raw)
In-Reply-To: <20220207131047.282110-1-mkl@pengutronix.de>

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.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index b5986df6eca0..7e0c4e662381 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -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);
-- 
2.34.1



  reply	other threads:[~2022-02-07 13:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07 13:10 [PATCH 00/15] can: mcp251xfd: add PLL support Marc Kleine-Budde
2022-02-07 13:10 ` Marc Kleine-Budde [this message]
2022-02-07 13:10 ` [PATCH 02/15] can: mcp251xfd: mcp251xfd_regmap_crc_read(): ignore CRC error only if solely OSC register is read Marc Kleine-Budde
2022-02-07 13:10 ` [PATCH 03/15] can: mcp251xfd: mcp251xfd_unregister(): simplify runtime PM handling Marc Kleine-Budde
2022-02-07 13:10 ` [PATCH 04/15] can: mcp251xfd: mcp251xfd_chip_sleep(): introduce function to bring chip into sleep mode Marc Kleine-Budde
2022-02-07 13:10 ` [PATCH 05/15] can: mcp251xfd: mcp251xfd_chip_stop(): convert to a void function Marc Kleine-Budde
2022-02-07 13:10 ` [PATCH 06/15] can: mcp251xfd: mcp251xfd_chip_wait_for_osc_ready(): factor out into separate function Marc Kleine-Budde
2022-02-07 13:10 ` [PATCH 07/15] can: mcp251xfd: mcp251xfd_chip_wait_for_osc_ready(): improve chip detection and error handling Marc Kleine-Budde
2022-02-07 13:10 ` [PATCH 08/15] can: mcp251xfd: mcp251xfd_chip_wait_for_osc_ready(): prepare for PLL support Marc Kleine-Budde
2022-02-07 13:10 ` [PATCH 09/15] can: mcp251xfd: mcp251xfd_chip_softreset_check(): wait for OSC ready before accessing chip Marc Kleine-Budde
2022-02-07 13:10 ` [PATCH 10/15] can: mcp251xfd: mcp251xfd_chip_timestamp_init(): factor out into separate function Marc Kleine-Budde
2022-02-07 13:10 ` [PATCH 11/15] can: mcp251xfd: mcp251xfd_chip_wake(): renamed from mcp251xfd_chip_clock_enable() Marc Kleine-Budde
2022-02-07 13:10 ` [PATCH 12/15] can: mcp251xfd: __mcp251xfd_chip_set_mode(): prepare for PLL support: improve error handling and diagnostics Marc Kleine-Budde
2022-02-07 13:10 ` [PATCH 13/15] can: mcp251xfd: mcp251xfd_chip_clock_init(): prepare for PLL support, wait for OSC ready Marc Kleine-Budde
2022-02-07 13:10 ` [PATCH 14/15] can: mcp251xfd: mcp251xfd_register(): prepare to activate PLL after softreset Marc Kleine-Budde
2022-02-07 13:10 ` [PATCH 15/15] can: mcp251xfd: add support for internal PLL Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220207131047.282110-2-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=thomas.kopp@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.