diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
index 16fbf672e0b2a02cd10f7729b3ebfb6ec3086954..3025ae17ddbeb46207ca71e88b3d31d6aaad44a8 100644
--- a/include/net/irda/irda_device.h
+++ b/include/net/irda/irda_device.h
@@ -223,7 +223,7 @@ int  irda_device_is_receiving(struct net_device *dev);
 /* Interface for internal use */
 static inline int irda_device_txqueue_empty(const struct net_device *dev)
 {
-	return skb_queue_empty(&dev->tx_queue.qdisc->q);
+	return qdisc_all_tx_empty(dev);
 }
 int  irda_device_set_raw_mode(struct net_device* self, int status);
 struct net_device *alloc_irdadev(int sizeof_priv);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index ea33176616ffd17a122ffa20c4a8476224fe95e8..8cfdaebbbab3d22ac61799a8df6ca64cad32aa02 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -233,6 +233,15 @@ static inline void qdisc_reset_all_tx(struct net_device *dev)
 	qdisc_reset(dev->tx_queue.qdisc);
 }
 
+/* Are all TX queues of the device empty?  */
+static inline bool qdisc_all_tx_empty(const struct net_device *dev)
+{
+	const struct netdev_queue *txq = &dev->tx_queue;
+	const struct Qdisc *q = txq->qdisc;
+
+	return (q->q.qlen == 0);
+}
+
 static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
 				       struct sk_buff_head *list)
 {