Skip to content

Commit 0d63e4f

Browse files
Jan BlunckLinus Torvalds
authored andcommitted
Dont touch fs_struct in drivers
The sound drivers and the pnpbios core test for current->root != NULL. This test seems to be unnecessary since we always have rootfs mounted before initializing the drivers. Signed-off-by: Jan Blunck <jblunck@suse.de> Acked-by: Christoph Hellwig <hch@lst.de> Cc: Bjorn Helgaas <bjorn.helgaas@hp.com> Cc: Jaroslav Kysela <perex@suse.cz> Acked-by: Takashi Iwai <tiwai@suse.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 000cb48 commit 0d63e4f

7 files changed

Lines changed: 6 additions & 19 deletions

File tree

‎drivers/pnp/pnpbios/core.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ static int pnp_dock_event(int dock, struct pnp_docking_station_info *info)
105105
char *argv[3], **envp, *buf, *scratch;
106106
int i = 0, value;
107107

108-
if (!current->fs->root)
109-
return -EAGAIN;
110108
if (!(envp = kcalloc(20, sizeof(char *), GFP_KERNEL)))
111109
return -ENOMEM;
112110
if (!(buf = kzalloc(256, GFP_KERNEL))) {

‎sound/core/seq/seq_clientmgr.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ struct snd_seq_client *snd_seq_client_use_ptr(int clientid)
149149
}
150150
spin_unlock_irqrestore(&clients_lock, flags);
151151
#ifdef CONFIG_KMOD
152-
if (!in_interrupt() && current->fs->root) {
152+
if (!in_interrupt()) {
153153
static char client_requested[SNDRV_SEQ_GLOBAL_CLIENTS];
154154
static char card_requested[SNDRV_CARDS];
155155
if (clientid < SNDRV_SEQ_GLOBAL_CLIENTS) {
156156
int idx;
157157

158-
if (! client_requested[clientid] && current->fs->root) {
158+
if (!client_requested[clientid]) {
159159
client_requested[clientid] = 1;
160160
for (idx = 0; idx < 15; idx++) {
161161
if (seq_client_load[idx] < 0)

‎sound/core/seq/seq_device.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ void snd_seq_device_load_drivers(void)
149149
if (snd_seq_in_init)
150150
return;
151151

152-
if (! current->fs->root)
153-
return;
154-
155152
mutex_lock(&ops_mutex);
156153
list_for_each_entry(ops, &opslist, list) {
157154
if (! (ops->driver & DRIVER_LOADED) &&

‎sound/core/sound.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ static DEFINE_MUTEX(sound_mutex);
7171
*/
7272
void snd_request_card(int card)
7373
{
74-
if (! current->fs->root)
75-
return;
7674
if (snd_card_locked(card))
7775
return;
7876
if (card < 0 || card >= cards_limit)
@@ -86,8 +84,6 @@ static void snd_request_other(int minor)
8684
{
8785
char *str;
8886

89-
if (! current->fs->root)
90-
return;
9187
switch (minor) {
9288
case SNDRV_MINOR_SEQUENCER: str = "snd-seq"; break;
9389
case SNDRV_MINOR_TIMER: str = "snd-timer"; break;

‎sound/core/timer.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ static struct snd_timer *snd_timer_find(struct snd_timer_id *tid)
150150

151151
static void snd_timer_request(struct snd_timer_id *tid)
152152
{
153-
if (! current->fs->root)
154-
return;
155153
switch (tid->dev_class) {
156154
case SNDRV_TIMER_CLASS_GLOBAL:
157155
if (tid->device < timer_limit)

‎sound/ppc/daca.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,8 @@ int __init snd_pmac_daca_init(struct snd_pmac *chip)
250250
struct pmac_daca *mix;
251251

252252
#ifdef CONFIG_KMOD
253-
if (current->fs->root)
254-
request_module("i2c-powermac");
255-
#endif /* CONFIG_KMOD */
253+
request_module("i2c-powermac");
254+
#endif /* CONFIG_KMOD */
256255

257256
mix = kzalloc(sizeof(*mix), GFP_KERNEL);
258257
if (! mix)

‎sound/ppc/tumbler.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,9 +1351,8 @@ int __init snd_pmac_tumbler_init(struct snd_pmac *chip)
13511351
char *chipname;
13521352

13531353
#ifdef CONFIG_KMOD
1354-
if (current->fs->root)
1355-
request_module("i2c-powermac");
1356-
#endif /* CONFIG_KMOD */
1354+
request_module("i2c-powermac");
1355+
#endif /* CONFIG_KMOD */
13571356

13581357
mix = kzalloc(sizeof(*mix), GFP_KERNEL);
13591358
if (! mix)

0 commit comments

Comments
 (0)