Linux CAN drivers development
 help / color / mirror / Atom feed
From: Vincent Mailhol <mailhol@kernel.org>
To: Rosen Penev <rosenp@gmail.com>, linux-can@vger.kernel.org
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	chleroy@kernel.org, open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] can: mscan: replace in_8/out_8 with ioread8/iowrite8
Date: Wed, 3 Jun 2026 02:28:57 +0200	[thread overview]
Message-ID: <36da6192-a69e-4ab8-90f6-590f620ecc5f@kernel.org> (raw)
In-Reply-To: <20260602223431.17672-1-rosenp@gmail.com>

On 03/06/2026 at 00:34, Rosen Penev wrote:
> Mechanical conversion of the ppc4xx-specific in_8/out_8 accessors and
> the setbits8/clrbits8 macros to the generic ioread8/iowrite8 helpers
> for portability.
> 
> Add HAS_IOMEM as these functions need it.
> 
> Add COMPILE_TEST as a result. This can be built anywhere now.
> 
> Assisted-by: opencode:big-pickle
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

I left a comment for a potential extension of the patch, but it is ok as-is.

Reviewed-by: Vincent Mailhol <mailhol@kernel.org>

> ---
>  drivers/net/can/mscan/Kconfig |   3 +-
>  drivers/net/can/mscan/mscan.c | 143 +++++++++++++++++-----------------
>  2 files changed, 73 insertions(+), 73 deletions(-)
> 
> diff --git a/drivers/net/can/mscan/Kconfig b/drivers/net/can/mscan/Kconfig
> index dfe6bd9947bb..ef3a99b3d3db 100644
> --- a/drivers/net/can/mscan/Kconfig
> +++ b/drivers/net/can/mscan/Kconfig
> @@ -1,6 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  config CAN_MSCAN
> -	depends on PPC
> +	depends on PPC || COMPILE_TEST
> +	depends on HAS_IOMEM

It seems to me that following your changes, it should also now become
easy to add COMPILE_TEST to config CAN_MPC5XXX.

mpc5xxx_can.c has a couple of unused headers, after removing those, I
could compile test it!

These are my local changes:

----8<----
diff --git a/drivers/net/can/mscan/Kconfig b/drivers/net/can/mscan/Kconfig
index ef3a99b3d3db..9bffd91ea418 100644
--- a/drivers/net/can/mscan/Kconfig
+++ b/drivers/net/can/mscan/Kconfig
@@ -13,7 +13,7 @@ if CAN_MSCAN
 
 config CAN_MPC5XXX
        tristate "Freescale MPC5xxx onboard CAN controller"
-       depends on (PPC_MPC52xx || PPC_MPC512x)
+       depends on PPC_MPC52xx || PPC_MPC512x || COMPILE_TEST
        help
          If you say yes here you get support for Freescale's MPC5xxx
          onboard CAN controller. Currently, the MPC5200, MPC5200B and
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index 0080c39ee182..759efb71d843 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -9,8 +9,6 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
 #include <linux/platform_device.h>
 #include <linux/property.h>
 #include <linux/netdevice.h>
@@ -18,11 +16,6 @@
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
-#include <linux/of_platform.h>
-#include <sysdev/fsl_soc.h>
-#include <linux/clk.h>
-#include <linux/io.h>
-#include <asm/mpc52xx.h>
 
 #include "mscan.h"
----8<----

Et voilà ! Both CAN_MSCAN and CAN_MPC5XXX can now be compile tested!


>  	tristate "Support for Freescale MSCAN based chips"
>  	help
>  	  The Motorola Scalable Controller Area Network (MSCAN) definition



Yours sincerely,
Vincent Mailhol

  reply	other threads:[~2026-06-03  0:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02 22:34 [PATCH] can: mscan: replace in_8/out_8 with ioread8/iowrite8 Rosen Penev
2026-06-03  0:28 ` Vincent Mailhol [this message]
2026-06-03  0:43   ` Rosen Penev
2026-06-03 11:31     ` Vincent Mailhol

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=36da6192-a69e-4ab8-90f6-590f620ecc5f@kernel.org \
    --to=mailhol@kernel.org \
    --cc=chleroy@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=rosenp@gmail.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