diff options
Diffstat (limited to 'drivers/dahdi/zaphfc')
-rw-r--r-- | drivers/dahdi/zaphfc/base.c | 3 | ||||
-rw-r--r-- | drivers/dahdi/zaphfc/zaphfc.h | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/dahdi/zaphfc/base.c b/drivers/dahdi/zaphfc/base.c index 049a37b..4db6736 100644 --- a/drivers/dahdi/zaphfc/base.c +++ b/drivers/dahdi/zaphfc/base.c @@ -592,7 +592,7 @@ static void hfc_hdlc_hard_xmit(struct dahdi_chan *d_chan) static int hfc_zap_startup(struct dahdi_span *span) { - struct dahdi_hfc *zthfc = span->pvt; + struct dahdi_hfc *zthfc = dahdi_hfc_from_span(span); struct hfc_card *hfctmp = zthfc->card; int alreadyrunning; @@ -682,7 +682,6 @@ static int hfc_zap_initialize(struct dahdi_hfc *hfccard) hfccard->span.linecompat = DAHDI_CONFIG_AMI | DAHDI_CONFIG_CCS; hfccard->span.offset = 0; init_waitqueue_head(&hfccard->span.maintq); - hfccard->span.pvt = hfccard; for (i = 0; i < hfccard->span.channels; i++) { memset(&hfccard->chans[i], 0x0, sizeof(struct dahdi_chan)); diff --git a/drivers/dahdi/zaphfc/zaphfc.h b/drivers/dahdi/zaphfc/zaphfc.h index c9353cc..29dd304 100644 --- a/drivers/dahdi/zaphfc/zaphfc.h +++ b/drivers/dahdi/zaphfc/zaphfc.h @@ -401,6 +401,10 @@ typedef struct dahdi_hfc { } dahdi_hfc; +static inline struct dahdi_hfc* dahdi_hfc_from_span(struct dahdi_span *span) { + return container_of(span, struct dahdi_hfc, span); +} + static inline u8 hfc_inb(struct hfc_card *card, int offset) { return readb(card->io_mem + offset); |