diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 149a51acb7067e5dc3d05a2cd61acefb5f8ffdc8..3884a4f2381b7a91cc4b11ac84ba07739a5e2b59 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -8230,9 +8230,6 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
 	struct dahdi_pvt *tmp = NULL, *tmp2,  *prev = NULL;
 	char fn[80];
 	struct dahdi_bufferinfo bi;
-#ifdef HAVE_PRI
-	struct dahdi_spaninfo si;
-#endif
 
 	int res;
 	int span = 0;
@@ -8379,6 +8376,7 @@ static struct dahdi_pvt *mkintf(int channel, const struct dahdi_chan_conf *conf,
 					destroy_dahdi_pvt(&tmp);
 					return NULL;
 				} else {
+					struct dahdi_spaninfo si;
 					si.spanno = 0;
 					if (ioctl(tmp->subs[SUB_REAL].zfd,DAHDI_SPANSTAT,&si) == -1) {
 						ast_log(LOG_ERROR, "Unable to get span status: %s\n", strerror(errno));