direct-io.hg

changeset 14292:59abe5204ca8

linux: Remove an unused data structure from TPM frontend.
Some more code style changes.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author kfraser@localhost.localdomain
date Thu Mar 08 16:26:17 2007 +0000 (2007-03-08)
parents 0e08d98dfd57
children 68c917da8b9b
files linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.c linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.h linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.c	Thu Mar 08 16:20:01 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.c	Thu Mar 08 16:26:17 2007 +0000
     1.3 @@ -504,7 +504,6 @@ static struct tpm_vendor_specific tpm_vt
     1.4  };
     1.5  
     1.6  struct tpm_chip *init_vtpm(struct device *dev,
     1.7 -                           struct tpm_virtual_device *tvd,
     1.8                             struct tpm_private *tp)
     1.9  {
    1.10  	long rc;
    1.11 @@ -516,7 +515,6 @@ struct tpm_chip *init_vtpm(struct device
    1.12  		return ERR_PTR(-ENOMEM);
    1.13  
    1.14  	vtpm_state_init(vtpms);
    1.15 -	vtpms->tpmvd = tvd;
    1.16  	vtpms->tpm_private = tp;
    1.17  
    1.18  	chip = tpm_register_hardware(dev, &tpm_vtpm);
     2.1 --- a/linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.h	Thu Mar 08 16:20:01 2007 +0000
     2.2 +++ b/linux-2.6-xen-sparse/drivers/char/tpm/tpm_vtpm.h	Thu Mar 08 16:26:17 2007 +0000
     2.3 @@ -4,16 +4,6 @@
     2.4  struct tpm_chip;
     2.5  struct tpm_private;
     2.6  
     2.7 -struct tpm_virtual_device {
     2.8 -	/*
     2.9 -	 * This field indicates the maximum size the driver can
    2.10 -	 * transfer in one chunk. It is filled in by the front-end
    2.11 -	 * driver and should be propagated to the generic tpm driver
    2.12 -	 * for allocation of buffers.
    2.13 -	 */
    2.14 -	unsigned int max_tx_size;
    2.15 -};
    2.16 -
    2.17  struct vtpm_state {
    2.18  	struct transmission *current_request;
    2.19  	spinlock_t           req_list_lock;
    2.20 @@ -30,8 +20,6 @@ struct vtpm_state {
    2.21  
    2.22  	unsigned long        disconnect_time;
    2.23  
    2.24 -	struct tpm_virtual_device *tpmvd;
    2.25 -
    2.26  	/*
    2.27  	 * The following is a private structure of the underlying
    2.28  	 * driver. It is passed as parameter in the send function.
    2.29 @@ -51,7 +39,6 @@ int vtpm_vd_send(struct tpm_private * tp
    2.30  
    2.31  /* these functions are offered by tpm_vtpm.c */
    2.32  struct tpm_chip *init_vtpm(struct device *,
    2.33 -                           struct tpm_virtual_device *,
    2.34                             struct tpm_private *);
    2.35  void cleanup_vtpm(struct device *);
    2.36  int vtpm_vd_recv(const struct tpm_chip* chip,
     3.1 --- a/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c	Thu Mar 08 16:20:01 2007 +0000
     3.2 +++ b/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c	Thu Mar 08 16:26:17 2007 +0000
     3.3 @@ -369,10 +369,6 @@ static void backend_changed(struct xenbu
     3.4  	}
     3.5  }
     3.6  
     3.7 -struct tpm_virtual_device tvd = {
     3.8 -	.max_tx_size = PAGE_SIZE * TPMIF_TX_RING_SIZE,
     3.9 -};
    3.10 -
    3.11  static int tpmfront_probe(struct xenbus_device *dev,
    3.12                            const struct xenbus_device_id *id)
    3.13  {
    3.14 @@ -383,7 +379,7 @@ static int tpmfront_probe(struct xenbus_
    3.15  	if (!tp)
    3.16  		return -ENOMEM;
    3.17  
    3.18 -	tp->chip = init_vtpm(&dev->dev, &tvd, tp);
    3.19 +	tp->chip = init_vtpm(&dev->dev, tp);
    3.20  	if (IS_ERR(tp->chip))
    3.21  		return PTR_ERR(tp->chip);
    3.22  
    3.23 @@ -500,11 +496,6 @@ static void __init init_tpm_xenbus(void)
    3.24  	xenbus_register_frontend(&tpmfront);
    3.25  }
    3.26  
    3.27 -static void __exit exit_tpm_xenbus(void)
    3.28 -{
    3.29 -	xenbus_unregister_driver(&tpmfront);
    3.30 -}
    3.31 -
    3.32  static int tpmif_allocate_tx_buffers(struct tpm_private *tp)
    3.33  {
    3.34  	unsigned int i;
    3.35 @@ -530,13 +521,11 @@ static void tpmif_free_tx_buffers(struct
    3.36  static void tpmif_rx_action(unsigned long priv)
    3.37  {
    3.38  	struct tpm_private *tp = (struct tpm_private *)priv;
    3.39 -
    3.40  	int i = 0;
    3.41  	unsigned int received;
    3.42  	unsigned int offset = 0;
    3.43  	u8 *buffer;
    3.44 -	tpmif_tx_request_t *tx;
    3.45 -	tx = &tp->tx->ring[i].req;
    3.46 +	tpmif_tx_request_t *tx = &tp->tx->ring[i].req;
    3.47  
    3.48  	atomic_set(&tp->tx_busy, 0);
    3.49  	wake_up_interruptible(&tp->wait_q);
    3.50 @@ -545,7 +534,7 @@ static void tpmif_rx_action(unsigned lon
    3.51  
    3.52  	buffer = kmalloc(received, GFP_ATOMIC);
    3.53  	if (!buffer)
    3.54 -		goto exit;
    3.55 +		return;
    3.56  
    3.57  	for (i = 0; i < TPMIF_TX_RING_SIZE && offset < received; i++) {
    3.58  		struct tx_buffer *txb = tp->tx_buffers[i];
    3.59 @@ -566,10 +555,6 @@ static void tpmif_rx_action(unsigned lon
    3.60  
    3.61  	vtpm_vd_recv(tp->chip, buffer, received, tp->tx_remember);
    3.62  	kfree(buffer);
    3.63 -
    3.64 -exit:
    3.65 -
    3.66 -	return;
    3.67  }
    3.68  
    3.69  
    3.70 @@ -730,13 +715,6 @@ static int __init tpmif_init(void)
    3.71  }
    3.72  
    3.73  
    3.74 -void __exit tpmif_exit(void)
    3.75 -{
    3.76 -	exit_tpm_xenbus();
    3.77 -	tpm_private_put();
    3.78 -	gnttab_free_grant_references(gref_head);
    3.79 -}
    3.80 -
    3.81  module_init(tpmif_init);
    3.82  
    3.83  MODULE_LICENSE("Dual BSD/GPL");