Re: [PATCH v3 5/7] drm/msm: Properly handle msm_ioremap() without name
From: Konrad Dybcio
Date: Tue Sep 08 2026 - 04:08:56 EST
On 9/8/26 9:10 AM, Krzysztof Kozlowski wrote:
> msm_ioremap() accepts being called without name of the region to map and
> in such case maps by index 0. However error paths still use the name in
> error message.
>
> Reviewed-by: Abel Vesa <abel.vesa@xxxxxxxxxxxxxxxx>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxxxxx>
> ---
> drivers/gpu/drm/msm/msm_io_utils.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_io_utils.c b/drivers/gpu/drm/msm/msm_io_utils.c
> index a6efe1eac271..0a4ac0fc5fb5 100644
> --- a/drivers/gpu/drm/msm/msm_io_utils.c
> +++ b/drivers/gpu/drm/msm/msm_io_utils.c
> @@ -77,7 +77,8 @@ static void __iomem *_msm_ioremap(struct platform_device *pdev, const char *name
>
> if (!res) {
> if (!quiet)
> - DRM_DEV_ERROR(&pdev->dev, "failed to get memory resource: %s\n", name);
> + DRM_DEV_ERROR(&pdev->dev, "failed to get memory resource: %s\n",
> + (name ? name : "#0"));
> return ERR_PTR(-EINVAL);
> }
>
> @@ -86,7 +87,8 @@ static void __iomem *_msm_ioremap(struct platform_device *pdev, const char *name
> ptr = devm_ioremap(&pdev->dev, res->start, size);
> if (!ptr) {
> if (!quiet)
> - DRM_DEV_ERROR(&pdev->dev, "failed to ioremap: %s\n", name);
> + DRM_DEV_ERROR(&pdev->dev, "failed to ioremap: %s\n",
> + (name ?: "#0"));
> return ERR_PTR(-ENOMEM);
It's odd to see one being ?: and one being open-coded..
Konrad