tpm_crb: Use IOMEM_ERR_PTR when function returns iomem
authorTian Tao <tiantao6@hisilicon.com>
Thu, 29 Apr 2021 07:39:39 +0000 (15:39 +0800)
committerJarkko Sakkinen <jarkko@kernel.org>
Wed, 23 Jun 2021 13:51:03 +0000 (16:51 +0300)
This is to simplify the code, and IOMEM_ERR_PTR(err) is same with
(__force void __iomem *)ERR_PTR(err).

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
drivers/char/tpm/tpm_crb.c

index a9dcf31eadd214b00394e016a7810ba03e919808..18606651d1aa43231755e8ec468c9191ec2e0c6b 100644 (file)
@@ -464,7 +464,7 @@ static void __iomem *crb_map_res(struct device *dev, struct resource *iores,
 
        /* Detect a 64 bit address on a 32 bit system */
        if (start != new_res.start)
-               return (void __iomem *) ERR_PTR(-EINVAL);
+               return IOMEM_ERR_PTR(-EINVAL);
 
        if (!iores)
                return devm_ioremap_resource(dev, &new_res);