From: Simon Horman <horms@kernel.org>
To: Sean Nyekjaer <sean@geanix.com>
Cc: Chandrasekar Ramakrishnan <rcsekar@samsung.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-can@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] can: m_can: add deinit callback
Date: Tue, 12 Nov 2024 14:46:03 +0000 [thread overview]
Message-ID: <20241112144603.GR4507@kernel.org> (raw)
In-Reply-To: <20241111-tcan-standby-v1-1-f9337ebaceea@geanix.com>
On Mon, Nov 11, 2024 at 11:51:23AM +0100, Sean Nyekjaer wrote:
> This is added in preparation for calling standby mode in the tcan4x5x
> driver or other users of m_can.
> For the tcan4x5x; If Vsup is 12V, standby mode will save 7-8mA, when
> the interface is down.
>
> Signed-off-by: Sean Nyekjaer <sean@geanix.com>
> ---
> drivers/net/can/m_can/m_can.c | 3 +++
> drivers/net/can/m_can/m_can.h | 1 +
> 2 files changed, 4 insertions(+)
>
> diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
> index a7b3bc439ae596527493a73d62b4b7a120ae4e49..a171ff860b7c6992846ae8d615640a40b623e0cb 100644
> --- a/drivers/net/can/m_can/m_can.c
> +++ b/drivers/net/can/m_can/m_can.c
> @@ -1756,6 +1756,9 @@ static void m_can_stop(struct net_device *dev)
>
> /* set the state as STOPPED */
> cdev->can.state = CAN_STATE_STOPPED;
> +
> + if (cdev->ops->deinit)
> + cdev->ops->deinit(cdev);
Hi Sean,
Perhaps this implementation is in keeping with other m_can code, but
I am wondering if either the return value of the callback be returned to
the caller, or the return type of the callback be changed to void?
Similarly for calls to callbacks in in patch 3/3.
> }
>
> static int m_can_close(struct net_device *dev)
> diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_can.h
> index 92b2bd8628e6b31370f4accbc2e28f3b2257a71d..6206535341a22a68d7c5570f619e6c4d05e6fcf4 100644
> --- a/drivers/net/can/m_can/m_can.h
> +++ b/drivers/net/can/m_can/m_can.h
> @@ -68,6 +68,7 @@ struct m_can_ops {
> int (*write_fifo)(struct m_can_classdev *cdev, int addr_offset,
> const void *val, size_t val_count);
> int (*init)(struct m_can_classdev *cdev);
> + int (*deinit)(struct m_can_classdev *cdev);
> };
>
> struct m_can_tx_op {
>
> --
> 2.46.2
>
>
next prev parent reply other threads:[~2024-11-12 14:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-11 10:51 [PATCH 0/3] can: tcan4x5x/m_can: use standby mode when down and in suspend Sean Nyekjaer
2024-11-11 10:51 ` [PATCH 1/3] can: m_can: add deinit callback Sean Nyekjaer
2024-11-12 14:46 ` Simon Horman [this message]
2024-11-14 9:34 ` Marc Kleine-Budde
2024-11-14 9:36 ` Sean Nyekjaer
2024-11-14 9:50 ` Marc Kleine-Budde
2024-11-11 10:51 ` [PATCH 2/3] can: tcan4x5x: add deinit callback to set standby mode Sean Nyekjaer
2024-11-14 9:33 ` Marc Kleine-Budde
2024-11-11 10:51 ` [PATCH 3/3] can: m_can: call deinit callback when going into suspend Sean Nyekjaer
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=20241112144603.GR4507@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mailhol.vincent@wanadoo.fr \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rcsekar@samsung.com \
--cc=sean@geanix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).