]> git.ipfire.org Git - thirdparty/linux.git/commit
char: misc: Add a case to test registering miscdevice again without reinitialization
authorZijun Hu <zijun.hu@oss.qualcomm.com>
Mon, 14 Jul 2025 15:34:15 +0000 (23:34 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Aug 2025 10:41:17 +0000 (12:41 +0200)
commit2334668aaf410382412b8c81f7014283f3e80354
treee00ca11b366ae12cda06fce95ee123a560b35078
parentf5597840ac907858ad2a462b00e4a68fd199121e
char: misc: Add a case to test registering miscdevice again without reinitialization

For miscdevice who wants dynamic minor, add a cast to test if it can be
successfully registered again without reinitialization:

1) Provide Both miscdevice @dev_A and @dev_B want to request dynamic
   minor by initializing their minor to MISC_DYNAMIC_MINOR.

2) Register then de-register @dev_A.

3) Register @dev_B.

4) Register @dev_A again without reinitialization.

5) Check if @dev_A can be successfully registered.

Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250714-rfc_miscdev-v6-4-2ed949665bde@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/misc_minor_kunit.c