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>
Adapt and add test cases for next change which regards minor whose
value > macro MISC_DYNAMIC_MINOR as invalid parameter when register
miscdevice, hence get a simple minor space division below:
< MISC_DYNAMIC_MINOR: fixed minor code
== MISC_DYNAMIC_MINOR: indicator to request dynamic minor code
> MISC_DYNAMIC_MINOR: dynamic minor code requested
Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250714-rfc_miscdev-v6-2-2ed949665bde@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>