gdth: cdev lock_kernel() pushdown

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
Jonathan Corbet 2008-05-15 16:09:48 -06:00
parent b3369c68bf
commit 46787b481b

View File

@ -120,6 +120,7 @@
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/smp_lock.h>
#ifdef GDTH_RTC #ifdef GDTH_RTC
#include <linux/mc146818rtc.h> #include <linux/mc146818rtc.h>
@ -4019,10 +4020,12 @@ static int gdth_open(struct inode *inode, struct file *filep)
{ {
gdth_ha_str *ha; gdth_ha_str *ha;
lock_kernel();
list_for_each_entry(ha, &gdth_instances, list) { list_for_each_entry(ha, &gdth_instances, list) {
if (!ha->sdev) if (!ha->sdev)
ha->sdev = scsi_get_host_dev(ha->shost); ha->sdev = scsi_get_host_dev(ha->shost);
} }
unlock_kernel();
TRACE(("gdth_open()\n")); TRACE(("gdth_open()\n"));
return 0; return 0;