tpm: rename chip->dev to chip->pdev
[cascardo/linux.git] / drivers / char / tpm / tpm-interface.c
index 4dbed1e..e2af28f 100644 (file)
@@ -343,7 +343,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
        if (count == 0)
                return -ENODATA;
        if (count > bufsiz) {
-               dev_err(chip->dev,
+               dev_err(chip->pdev,
                        "invalid count value %x %zx\n", count, bufsiz);
                return -E2BIG;
        }
@@ -352,7 +352,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
 
        rc = chip->ops->send(chip, (u8 *) buf, count);
        if (rc < 0) {
-               dev_err(chip->dev,
+               dev_err(chip->pdev,
                        "tpm_transmit: tpm_send: error %zd\n", rc);
                goto out;
        }
@@ -368,7 +368,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
                        goto out_recv;
 
                if (chip->ops->req_canceled(chip, status)) {
-                       dev_err(chip->dev, "Operation Canceled\n");
+                       dev_err(chip->pdev, "Operation Canceled\n");
                        rc = -ECANCELED;
                        goto out;
                }
@@ -378,14 +378,14 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
        } while (time_before(jiffies, stop));
 
        chip->ops->cancel(chip);
-       dev_err(chip->dev, "Operation Timed out\n");
+       dev_err(chip->pdev, "Operation Timed out\n");
        rc = -ETIME;
        goto out;
 
 out_recv:
        rc = chip->ops->recv(chip, (u8 *) buf, bufsiz);
        if (rc < 0)
-               dev_err(chip->dev,
+               dev_err(chip->pdev,
                        "tpm_transmit: tpm_recv: error %zd\n", rc);
 out:
        mutex_unlock(&chip->tpm_mutex);
@@ -411,7 +411,8 @@ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, void *cmd,
 
        err = be32_to_cpu(header->return_code);
        if (err != 0 && desc)
-               dev_err(chip->dev, "A TPM error (%d) occurred %s\n", err, desc);
+               dev_err(chip->pdev, "A TPM error (%d) occurred %s\n", err,
+                       desc);
 
        return err;
 }
@@ -505,7 +506,7 @@ int tpm_get_timeouts(struct tpm_chip *chip)
        if (rc == TPM_ERR_INVALID_POSTINIT) {
                /* The TPM is not started, we are the first to talk to it.
                   Execute a startup command. */
-               dev_info(chip->dev, "Issuing TPM_STARTUP");
+               dev_info(chip->pdev, "Issuing TPM_STARTUP");
                if (tpm_startup(chip, TPM_ST_CLEAR))
                        return rc;
 
@@ -517,7 +518,7 @@ int tpm_get_timeouts(struct tpm_chip *chip)
                                  NULL);
        }
        if (rc) {
-               dev_err(chip->dev,
+               dev_err(chip->pdev,
                        "A TPM error (%zd) occurred attempting to determine the timeouts\n",
                        rc);
                goto duration;
@@ -556,7 +557,7 @@ int tpm_get_timeouts(struct tpm_chip *chip)
 
        /* Report adjusted timeouts */
        if (chip->vendor.timeout_adjusted) {
-               dev_info(chip->dev,
+               dev_info(chip->pdev,
                         HW_ERR "Adjusting reported timeouts: A %lu->%luus B %lu->%luus C %lu->%luus D %lu->%luus\n",
                         old_timeout[0], new_timeout[0],
                         old_timeout[1], new_timeout[1],
@@ -603,7 +604,7 @@ duration:
                chip->vendor.duration[TPM_MEDIUM] *= 1000;
                chip->vendor.duration[TPM_LONG] *= 1000;
                chip->vendor.duration_adjusted = true;
-               dev_info(chip->dev, "Adjusting TPM timeout parameters.");
+               dev_info(chip->pdev, "Adjusting TPM timeout parameters.");
        }
        return 0;
 }
@@ -760,7 +761,7 @@ int tpm_do_selftest(struct tpm_chip *chip)
                 * around 300ms while the self test is ongoing, keep trying
                 * until the self test duration expires. */
                if (rc == -ETIME) {
-                       dev_info(chip->dev, HW_ERR "TPM command timed out during continue self test");
+                       dev_info(chip->pdev, HW_ERR "TPM command timed out during continue self test");
                        msleep(delay_msec);
                        continue;
                }
@@ -770,7 +771,7 @@ int tpm_do_selftest(struct tpm_chip *chip)
 
                rc = be32_to_cpu(cmd.header.out.return_code);
                if (rc == TPM_ERR_DISABLED || rc == TPM_ERR_DEACTIVATED) {
-                       dev_info(chip->dev,
+                       dev_info(chip->pdev,
                                 "TPM is disabled/deactivated (0x%X)\n", rc);
                        /* TPM is disabled and/or deactivated; driver can
                         * proceed and TPM does handle commands for
@@ -918,10 +919,10 @@ int tpm_pm_suspend(struct device *dev)
        }
 
        if (rc)
-               dev_err(chip->dev,
+               dev_err(chip->pdev,
                        "Error (%d) sending savestate before suspend\n", rc);
        else if (try > 0)
-               dev_warn(chip->dev, "TPM savestate took %dms\n",
+               dev_warn(chip->pdev, "TPM savestate took %dms\n",
                         try * TPM_TIMEOUT_RETRY);
 
        return rc;