Re: [PATCH v8] mm/hmm/test: use char dev with struct device to get device node

From: Jason Gunthorpe
Date: Tue Sep 06 2022 - 19:13:39 EST


On Fri, Aug 26, 2022 at 08:06:31AM +0300, mpenttil@xxxxxxxxxx wrote:
> From: Mika Penttilä <mpenttil@xxxxxxxxxx>
>
> HMM selftests use an in-kernel pseudo device to emulate device
> memory. The pseudo device registers a major device range for two or
> four pseudo device instances. User space has a script that
> reads /proc/devices in order to find the assigned major number,
> and sends that to mknod(1), once for each node.
>
> Change this to properly use cdev and struct device APIs.
>
> Delete the /proc/devices parsing from the user-space test script, now
> that it is unnecessary.
>
> Also, deleted an unused field in struct dmirror_device: devmem.
>
> Signed-off-by: Mika Penttilä <mpenttil@xxxxxxxxxx>
> Reviewed-by: John Hubbard <jhubbard@xxxxxxxxxx>
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
> Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Cc: Alistair Popple <apopple@xxxxxxxxxx>
> Cc: Ralph Campbell <rcampbell@xxxxxxxxxx>
> Cc: Vlastimil Babka <vbabka@xxxxxxx>

Andrew, this looks OK, can you pick it up?

Thanks,
Jason