tpm_crb/tis: fix: use dev_name() for /proc/iomem
authorJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Wed, 17 Feb 2016 00:10:52 +0000 (02:10 +0200)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Sat, 20 Feb 2016 07:59:33 +0000 (09:59 +0200)
In all cases use dev_name() for the mapped resources. This is both
for sake of consistency and also with some platforms resource name
given by ACPI object seems to return garbage.

Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Fixes: 1bd047be37d9 ("tpm_crb: Use devm_ioremap_resource")

drivers/char/tpm/tpm_crb.c
drivers/char/tpm/tpm_tis.c

index 916332c9d906f6c6dd8eca15cc09041abfb5a5a7..9eb04044c385eab0e12c2cacb69057c4f5d15e21 100644 (file)
@@ -227,8 +227,10 @@ static int crb_check_resource(struct acpi_resource *ares, void *data)
        struct crb_priv *priv = data;
        struct resource res;
 
-       if (acpi_dev_resource_memory(ares, &res))
+       if (acpi_dev_resource_memory(ares, &res)) {
                priv->res = res;
+               priv->res.name = NULL;
+       }
 
        return 1;
 }
index ca137b5b7c24f76d46df3b8b2c4a6e6ce222321f..2b2eff9e769e4c74ea9767fcaf0c9cafa103f507 100644 (file)
@@ -930,8 +930,10 @@ static int tpm_check_resource(struct acpi_resource *ares, void *data)
 
        if (acpi_dev_resource_interrupt(ares, 0, &res))
                tpm_info->irq = res.start;
-       else if (acpi_dev_resource_memory(ares, &res))
+       else if (acpi_dev_resource_memory(ares, &res)) {
                tpm_info->res = res;
+               tpm_info->res.name = NULL;
+       }
 
        return 1;
 }