diff mbox series

[v1,2/4] m68k - set up platform device for mvme147_scsi

Message ID 20220709001019.11149-3-schmitzmic@gmail.com
State Superseded
Headers show
Series Convert m68k MVME147 WD33C93 SCSI driver to DMA API | expand

Commit Message

Michael Schmitz July 9, 2022, 12:10 a.m. UTC
Set up a platform device for the mvme147_scsi driver. The
platform device is required for conversion of the driver to
the DMA API.

CC: linux-scsi@vger.kernel.org
Link: https://lore.kernel.org/r/6d1d88ee-1cf6-c735-1e6d-bafd2096e322@gmail.com
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
---
 arch/m68k/mvme147/config.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Comments

kernel test robot July 9, 2022, 5:29 a.m. UTC | #1
Hi Michael,

I love your patch! Perhaps something to improve:

[auto build test WARNING on geert-m68k/for-next]
[also build test WARNING on mkp-scsi/for-next jejb-scsi/for-next linus/master v5.19-rc5 next-20220708]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Michael-Schmitz/Convert-m68k-MVME147-WD33C93-SCSI-driver-to-DMA-API/20220709-081556
base:   https://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k.git for-next
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20220709/202207091359.WPLQuHhB-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel-lab-lkp/linux/commit/3a5e770e42ebe8984096d0cd1d93a95a1d7b67e7
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Michael-Schmitz/Convert-m68k-MVME147-WD33C93-SCSI-driver-to-DMA-API/20220709-081556
        git checkout 3a5e770e42ebe8984096d0cd1d93a95a1d7b67e7
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash arch/m68k/mvme147/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/m68k/mvme147/config.c:77:13: warning: no previous prototype for 'mvme147_init_IRQ' [-Wmissing-prototypes]
      77 | void __init mvme147_init_IRQ(void)
         |             ^~~~~~~~~~~~~~~~
>> arch/m68k/mvme147/config.c:198:12: warning: no previous prototype for 'mvme147_platform_init' [-Wmissing-prototypes]
     198 | int __init mvme147_platform_init(void)
         |            ^~~~~~~~~~~~~~~~~~~~~


vim +/mvme147_platform_init +198 arch/m68k/mvme147/config.c

   197	
 > 198	int __init mvme147_platform_init(void)
   199	{
   200		struct platform_device *pdev;
   201		int rv = 0;
   202	
   203		pdev = platform_device_register_simple("mvme147-scsi", -1,
   204			mvme147_scsi_rsrc, ARRAY_SIZE(mvme147_scsi_rsrc));
   205		if (IS_ERR(pdev))
   206			rv = PTR_ERR(pdev);
   207	
   208		return rv;
   209	}
   210
Arnd Bergmann July 10, 2022, 3:56 p.m. UTC | #2
On Sat, Jul 9, 2022 at 2:10 AM Michael Schmitz <schmitzmic@gmail.com> wrote:
> +
> +static const struct resource mvme147_scsi_rsrc[] __initconst = {
> +       DEFINE_RES_MEM(MVME147_SCSI_BASE, 0xff),
> +       DEFINE_RES_IRQ(MVME147_IRQ_SCSI_PORT),
> +};

The size should almost certainly be 0x100, not 0xff here.

Otherwise this looks good to me.

       Arnd
Michael Schmitz July 11, 2022, 4:11 a.m. UTC | #3
Hi Arnd,

thanks for your review!

Am 11.07.2022 um 03:56 schrieb Arnd Bergmann:
> On Sat, Jul 9, 2022 at 2:10 AM Michael Schmitz <schmitzmic@gmail.com> wrote:
>> +
>> +static const struct resource mvme147_scsi_rsrc[] __initconst = {
>> +       DEFINE_RES_MEM(MVME147_SCSI_BASE, 0xff),
>> +       DEFINE_RES_IRQ(MVME147_IRQ_SCSI_PORT),
>> +};
>
> The size should almost certainly be 0x100, not 0xff here.

OK, will fix that. The resource size is taken from one of the Amiga 
drivers and might be excessive for mvme147, but 0xff is certainly odd.

Cheers,

	Michael


> Otherwise this looks good to me.
>
>        Arnd
>
diff mbox series

Patch

diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c
index 4e6218115f43..c6e7dfe3eb54 100644
--- a/arch/m68k/mvme147/config.c
+++ b/arch/m68k/mvme147/config.c
@@ -21,6 +21,7 @@ 
 #include <linux/console.h>
 #include <linux/linkage.h>
 #include <linux/init.h>
+#include <linux/platform_device.h>
 #include <linux/major.h>
 #include <linux/rtc.h>
 #include <linux/interrupt.h>
@@ -188,3 +189,23 @@  int mvme147_hwclk(int op, struct rtc_time *t)
 	}
 	return 0;
 }
+
+static const struct resource mvme147_scsi_rsrc[] __initconst = {
+	DEFINE_RES_MEM(MVME147_SCSI_BASE, 0xff),
+	DEFINE_RES_IRQ(MVME147_IRQ_SCSI_PORT),
+};
+
+int __init mvme147_platform_init(void)
+{
+	struct platform_device *pdev;
+	int rv = 0;
+
+	pdev = platform_device_register_simple("mvme147-scsi", -1,
+		mvme147_scsi_rsrc, ARRAY_SIZE(mvme147_scsi_rsrc));
+	if (IS_ERR(pdev))
+		rv = PTR_ERR(pdev);
+
+	return rv;
+}
+
+arch_initcall(mvme147_platform_init);