tpm: remove @flags from tpm_transmit()
[sfrench/cifs-2.6.git] / drivers / char / tpm / tpm-chip.c
index 1dbc7f45e2b4ab6aa60dc5b929f32b223dd80215..4eb48cf6a03af30e0c5f00dc73a7628f94bf8956 100644 (file)
@@ -37,7 +37,7 @@ struct class *tpm_class;
 struct class *tpmrm_class;
 dev_t tpm_devt;
 
-static int tpm_request_locality(struct tpm_chip *chip, unsigned int flags)
+static int tpm_request_locality(struct tpm_chip *chip)
 {
        int rc;
 
@@ -52,7 +52,7 @@ static int tpm_request_locality(struct tpm_chip *chip, unsigned int flags)
        return 0;
 }
 
-static void tpm_relinquish_locality(struct tpm_chip *chip, unsigned int flags)
+static void tpm_relinquish_locality(struct tpm_chip *chip)
 {
        int rc;
 
@@ -66,7 +66,7 @@ static void tpm_relinquish_locality(struct tpm_chip *chip, unsigned int flags)
        chip->locality = -1;
 }
 
-static int tpm_cmd_ready(struct tpm_chip *chip, unsigned int flags)
+static int tpm_cmd_ready(struct tpm_chip *chip)
 {
        if (!chip->ops->cmd_ready)
                return 0;
@@ -74,7 +74,7 @@ static int tpm_cmd_ready(struct tpm_chip *chip, unsigned int flags)
        return chip->ops->cmd_ready(chip);
 }
 
-static int tpm_go_idle(struct tpm_chip *chip, unsigned int flags)
+static int tpm_go_idle(struct tpm_chip *chip)
 {
        if (!chip->ops->go_idle)
                return 0;
@@ -85,13 +85,12 @@ static int tpm_go_idle(struct tpm_chip *chip, unsigned int flags)
 /**
  * tpm_chip_start() - power on the TPM
  * @chip:      a TPM chip to use
- * @flags:     TPM transmit flags
  *
  * Return:
  * * The response length       - OK
  * * -errno                    - A system error
  */
-int tpm_chip_start(struct tpm_chip *chip, unsigned int flags)
+int tpm_chip_start(struct tpm_chip *chip)
 {
        int ret;
 
@@ -99,16 +98,16 @@ int tpm_chip_start(struct tpm_chip *chip, unsigned int flags)
                chip->ops->clk_enable(chip, true);
 
        if (chip->locality == -1) {
-               ret = tpm_request_locality(chip, flags);
+               ret = tpm_request_locality(chip);
                if (ret) {
                        chip->ops->clk_enable(chip, false);
                        return ret;
                }
        }
 
-       ret = tpm_cmd_ready(chip, flags);
+       ret = tpm_cmd_ready(chip);
        if (ret) {
-               tpm_relinquish_locality(chip, flags);
+               tpm_relinquish_locality(chip);
                if (chip->ops->clk_enable)
                        chip->ops->clk_enable(chip, false);
                return ret;
@@ -121,16 +120,15 @@ EXPORT_SYMBOL_GPL(tpm_chip_start);
 /**
  * tpm_chip_stop() - power off the TPM
  * @chip:      a TPM chip to use
- * @flags:     TPM transmit flags
  *
  * Return:
  * * The response length       - OK
  * * -errno                    - A system error
  */
-void tpm_chip_stop(struct tpm_chip *chip, unsigned int flags)
+void tpm_chip_stop(struct tpm_chip *chip)
 {
-       tpm_go_idle(chip, flags);
-       tpm_relinquish_locality(chip, flags);
+       tpm_go_idle(chip);
+       tpm_relinquish_locality(chip);
        if (chip->ops->clk_enable)
                chip->ops->clk_enable(chip, false);
 }
@@ -158,7 +156,7 @@ int tpm_try_get_ops(struct tpm_chip *chip)
                goto out_ops;
 
        mutex_lock(&chip->tpm_mutex);
-       rc = tpm_chip_start(chip, 0);
+       rc = tpm_chip_start(chip);
        if (rc)
                goto out_lock;
 
@@ -181,7 +179,7 @@ EXPORT_SYMBOL_GPL(tpm_try_get_ops);
  */
 void tpm_put_ops(struct tpm_chip *chip)
 {
-       tpm_chip_stop(chip, 0);
+       tpm_chip_stop(chip);
        mutex_unlock(&chip->tpm_mutex);
        up_read(&chip->ops_sem);
        put_device(&chip->dev);
@@ -297,9 +295,9 @@ static int tpm_class_shutdown(struct device *dev)
 
        if (chip->flags & TPM_CHIP_FLAG_TPM2) {
                down_write(&chip->ops_sem);
-               if (!tpm_chip_start(chip, 0)) {
+               if (!tpm_chip_start(chip)) {
                        tpm2_shutdown(chip, TPM2_SU_CLEAR);
-                       tpm_chip_stop(chip, 0);
+                       tpm_chip_stop(chip);
                }
                chip->ops = NULL;
                up_write(&chip->ops_sem);
@@ -480,9 +478,9 @@ static void tpm_del_char_device(struct tpm_chip *chip)
        /* Make the driver uncallable. */
        down_write(&chip->ops_sem);
        if (chip->flags & TPM_CHIP_FLAG_TPM2) {
-               if (!tpm_chip_start(chip, 0)) {
+               if (!tpm_chip_start(chip)) {
                        tpm2_shutdown(chip, TPM2_SU_CLEAR);
-                       tpm_chip_stop(chip, 0);
+                       tpm_chip_stop(chip);
                }
        }
        chip->ops = NULL;
@@ -566,11 +564,11 @@ int tpm_chip_register(struct tpm_chip *chip)
 {
        int rc;
 
-       rc = tpm_chip_start(chip, 0);
+       rc = tpm_chip_start(chip);
        if (rc)
                return rc;
        rc = tpm_auto_startup(chip);
-       tpm_chip_stop(chip, 0);
+       tpm_chip_stop(chip);
        if (rc)
                return rc;