Skip to contentSkip to conversation

rt2x00: avoid introducing a USB dependency in the rt2x00lib module

PATCH Superseded Stanislaw Gruszka 2 participants 2 messages Jan 27, 2017 – Jan 31, 2017 Ralink RT2X00 wireless LAN driver

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rt2x00: avoid introducing a USB dependency in the rt2x00lib module

As reported by Felix:

Though protected by an ifdef, introducing an usb symbol dependency in the rt2x00lib module is a major inconvenience for distributions that package kernel modules split into individual packages.

Get rid of this unnecessary dependency by calling the usb related function from a more suitable place.

Fixes 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB")
---
 drivers/net/wireless/ralink/rt2x00/rt2x00dev.c |   23 ++++++++---------------
 drivers/net/wireless/ralink/rt2x00/rt2x00usb.c |    5 +++++
 2 files changed, 13 insertions(+), 15 deletions(-)
drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +8 -15
index e464bdc..c0a66af 100644
@@ -1417,21 +1417,6 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
 	cancel_work_sync(&rt2x00dev->intf_work);
 	cancel_delayed_work_sync(&rt2x00dev->autowakeup_work);
 	cancel_work_sync(&rt2x00dev->sleep_work);
-#ifdef CONFIG_RT2X00_LIB_USB
-	if (rt2x00_is_usb(rt2x00dev)) {
-		usb_kill_anchored_urbs(rt2x00dev->anchor);
-		hrtimer_cancel(&rt2x00dev->txstatus_timer);
-		cancel_work_sync(&rt2x00dev->rxdone_work);
-		cancel_work_sync(&rt2x00dev->txdone_work);
-	}
-#endif
-	if (rt2x00dev->workqueue)
-		destroy_workqueue(rt2x00dev->workqueue);
-
-	/*
-	 * Free the tx status fifo.
-	 */
-	kfifo_free(&rt2x00dev->txstatus_fifo);
 
 	/*
 	 * Kill the tx status tasklet.
@@ -1447,6 +1432,14 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
 	 */
 	rt2x00lib_uninitialize(rt2x00dev);
 
+	if (rt2x00dev->workqueue)
+		destroy_workqueue(rt2x00dev->workqueue);
+
+	/*
+	 * Free the tx status fifo.
+	 */
+	kfifo_free(&rt2x00dev->txstatus_fifo);
+
 	/*
 	 * Free extra components
 	 */
drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +5 -0
index 838ca58..5a2bf9f 100644
@@ -744,6 +744,11 @@ void rt2x00usb_uninitialize(struct rt2x00_dev *rt2x00dev)
 {
 	struct data_queue *queue;
 
+	usb_kill_anchored_urbs(rt2x00dev->anchor);
+	hrtimer_cancel(&rt2x00dev->txstatus_timer);
+	cancel_work_sync(&rt2x00dev->rxdone_work);
+	cancel_work_sync(&rt2x00dev->txdone_work);
+
 	queue_for_each(rt2x00dev, queue)
 		rt2x00usb_free_entries(queue);
 }
Signature · 1 line
1.7.1
#1 lore raw
Quoted 6 lines · Stanislaw Gruszka

As reported by Felix:

Though protected by an ifdef, introducing an usb symbol dependency in the rt2x00lib module is a major inconvenience for distributions that package kernel modules split into individual packages.

Quoted 6 lines

Get rid of this unnecessary dependency by calling the usb related function from a more suitable place.

Fixes 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB")

Does not apply:

fatal: sha1 information is lacking or useless (drivers/net/wireless/ralink/rt2x00/rt2x00dev.c).
error: could not build fake ancestor
Applying: rt2x00: avoid introducing a USB dependency in the rt2x00lib module Patch failed at 0001 rt2x00: avoid introducing a USB dependency in the rt2x00lib module The copy of the patch that failed is found in: .git/rebase-apply/patch

Patch set to Changes Requested.

Signature · 6 lines
https://patchwork.kernel.org/patch/9541945/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches