Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

platform: Use IOMEM_ERR_PTR for ioremap error returns

Replace ERR_PTR() with IOMEM_ERR_PTR() in stubbed ioremap functions to
maintain type consistency. The functions return void __iomem * pointers
and IOMEM_ERR_PTR() provides proper type casting to avoid sparse warnings.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202509060307.JubgnLhc-lkp@intel.com/
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Link: https://patch.msgid.link/320f2cc9ada5cb66845daa6bf259000b4cffd8b3.1758163939.git.xiaopei01@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Pei Xiao and committed by
Greg Kroah-Hartman
cebd22dd b811e8a0

+3 -3
+3 -3
include/linux/platform_device.h
··· 80 80 devm_platform_get_and_ioremap_resource(struct platform_device *pdev, 81 81 unsigned int index, struct resource **res) 82 82 { 83 - return ERR_PTR(-EINVAL); 83 + return IOMEM_ERR_PTR(-EINVAL); 84 84 } 85 85 86 86 ··· 88 88 devm_platform_ioremap_resource(struct platform_device *pdev, 89 89 unsigned int index) 90 90 { 91 - return ERR_PTR(-EINVAL); 91 + return IOMEM_ERR_PTR(-EINVAL); 92 92 } 93 93 94 94 static inline void __iomem * 95 95 devm_platform_ioremap_resource_byname(struct platform_device *pdev, 96 96 const char *name) 97 97 { 98 - return ERR_PTR(-EINVAL); 98 + return IOMEM_ERR_PTR(-EINVAL); 99 99 } 100 100 101 101 #endif