Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a2b421fe
Commit
a2b421fe
authored
Jan 12, 2006
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge master.kernel.org:/home/rmk/linux-2.6-mmc
parents
ba027def
a621aaed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
18 deletions
+20
-18
drivers/mfd/ucb1x00-core.c
drivers/mfd/ucb1x00-core.c
+14
-13
drivers/mmc/mmc_block.c
drivers/mmc/mmc_block.c
+6
-5
No files found.
drivers/mfd/ucb1x00-core.c
View file @
a2b421fe
...
@@ -24,13 +24,14 @@
...
@@ -24,13 +24,14 @@
#include <linux/errno.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/device.h>
#include <linux/device.h>
#include <linux/mutex.h>
#include <asm/dma.h>
#include <asm/dma.h>
#include <asm/hardware.h>
#include <asm/hardware.h>
#include "ucb1x00.h"
#include "ucb1x00.h"
static
DE
CLARE_MUTEX
(
ucb1x00_sem
);
static
DE
FINE_MUTEX
(
ucb1x00_mutex
);
static
LIST_HEAD
(
ucb1x00_drivers
);
static
LIST_HEAD
(
ucb1x00_drivers
);
static
LIST_HEAD
(
ucb1x00_devices
);
static
LIST_HEAD
(
ucb1x00_devices
);
...
@@ -521,12 +522,12 @@ static int ucb1x00_probe(struct mcp *mcp)
...
@@ -521,12 +522,12 @@ static int ucb1x00_probe(struct mcp *mcp)
goto
err_irq
;
goto
err_irq
;
INIT_LIST_HEAD
(
&
ucb
->
devs
);
INIT_LIST_HEAD
(
&
ucb
->
devs
);
down
(
&
ucb1x00_sem
);
mutex_lock
(
&
ucb1x00_mutex
);
list_add
(
&
ucb
->
node
,
&
ucb1x00_devices
);
list_add
(
&
ucb
->
node
,
&
ucb1x00_devices
);
list_for_each_entry
(
drv
,
&
ucb1x00_drivers
,
node
)
{
list_for_each_entry
(
drv
,
&
ucb1x00_drivers
,
node
)
{
ucb1x00_add_dev
(
ucb
,
drv
);
ucb1x00_add_dev
(
ucb
,
drv
);
}
}
up
(
&
ucb1x00_sem
);
mutex_unlock
(
&
ucb1x00_mutex
);
goto
out
;
goto
out
;
err_irq:
err_irq:
...
@@ -544,13 +545,13 @@ static void ucb1x00_remove(struct mcp *mcp)
...
@@ -544,13 +545,13 @@ static void ucb1x00_remove(struct mcp *mcp)
struct
ucb1x00
*
ucb
=
mcp_get_drvdata
(
mcp
);
struct
ucb1x00
*
ucb
=
mcp_get_drvdata
(
mcp
);
struct
list_head
*
l
,
*
n
;
struct
list_head
*
l
,
*
n
;
down
(
&
ucb1x00_sem
);
mutex_lock
(
&
ucb1x00_mutex
);
list_del
(
&
ucb
->
node
);
list_del
(
&
ucb
->
node
);
list_for_each_safe
(
l
,
n
,
&
ucb
->
devs
)
{
list_for_each_safe
(
l
,
n
,
&
ucb
->
devs
)
{
struct
ucb1x00_dev
*
dev
=
list_entry
(
l
,
struct
ucb1x00_dev
,
dev_node
);
struct
ucb1x00_dev
*
dev
=
list_entry
(
l
,
struct
ucb1x00_dev
,
dev_node
);
ucb1x00_remove_dev
(
dev
);
ucb1x00_remove_dev
(
dev
);
}
}
up
(
&
ucb1x00_sem
);
mutex_unlock
(
&
ucb1x00_mutex
);
free_irq
(
ucb
->
irq
,
ucb
);
free_irq
(
ucb
->
irq
,
ucb
);
class_device_unregister
(
&
ucb
->
cdev
);
class_device_unregister
(
&
ucb
->
cdev
);
...
@@ -561,12 +562,12 @@ int ucb1x00_register_driver(struct ucb1x00_driver *drv)
...
@@ -561,12 +562,12 @@ int ucb1x00_register_driver(struct ucb1x00_driver *drv)
struct
ucb1x00
*
ucb
;
struct
ucb1x00
*
ucb
;
INIT_LIST_HEAD
(
&
drv
->
devs
);
INIT_LIST_HEAD
(
&
drv
->
devs
);
down
(
&
ucb1x00_sem
);
mutex_lock
(
&
ucb1x00_mutex
);
list_add
(
&
drv
->
node
,
&
ucb1x00_drivers
);
list_add
(
&
drv
->
node
,
&
ucb1x00_drivers
);
list_for_each_entry
(
ucb
,
&
ucb1x00_devices
,
node
)
{
list_for_each_entry
(
ucb
,
&
ucb1x00_devices
,
node
)
{
ucb1x00_add_dev
(
ucb
,
drv
);
ucb1x00_add_dev
(
ucb
,
drv
);
}
}
up
(
&
ucb1x00_sem
);
mutex_unlock
(
&
ucb1x00_mutex
);
return
0
;
return
0
;
}
}
...
@@ -574,13 +575,13 @@ void ucb1x00_unregister_driver(struct ucb1x00_driver *drv)
...
@@ -574,13 +575,13 @@ void ucb1x00_unregister_driver(struct ucb1x00_driver *drv)
{
{
struct
list_head
*
n
,
*
l
;
struct
list_head
*
n
,
*
l
;
down
(
&
ucb1x00_sem
);
mutex_lock
(
&
ucb1x00_mutex
);
list_del
(
&
drv
->
node
);
list_del
(
&
drv
->
node
);
list_for_each_safe
(
l
,
n
,
&
drv
->
devs
)
{
list_for_each_safe
(
l
,
n
,
&
drv
->
devs
)
{
struct
ucb1x00_dev
*
dev
=
list_entry
(
l
,
struct
ucb1x00_dev
,
drv_node
);
struct
ucb1x00_dev
*
dev
=
list_entry
(
l
,
struct
ucb1x00_dev
,
drv_node
);
ucb1x00_remove_dev
(
dev
);
ucb1x00_remove_dev
(
dev
);
}
}
up
(
&
ucb1x00_sem
);
mutex_unlock
(
&
ucb1x00_mutex
);
}
}
static
int
ucb1x00_suspend
(
struct
mcp
*
mcp
,
pm_message_t
state
)
static
int
ucb1x00_suspend
(
struct
mcp
*
mcp
,
pm_message_t
state
)
...
@@ -588,12 +589,12 @@ static int ucb1x00_suspend(struct mcp *mcp, pm_message_t state)
...
@@ -588,12 +589,12 @@ static int ucb1x00_suspend(struct mcp *mcp, pm_message_t state)
struct
ucb1x00
*
ucb
=
mcp_get_drvdata
(
mcp
);
struct
ucb1x00
*
ucb
=
mcp_get_drvdata
(
mcp
);
struct
ucb1x00_dev
*
dev
;
struct
ucb1x00_dev
*
dev
;
down
(
&
ucb1x00_sem
);
mutex_lock
(
&
ucb1x00_mutex
);
list_for_each_entry
(
dev
,
&
ucb
->
devs
,
dev_node
)
{
list_for_each_entry
(
dev
,
&
ucb
->
devs
,
dev_node
)
{
if
(
dev
->
drv
->
suspend
)
if
(
dev
->
drv
->
suspend
)
dev
->
drv
->
suspend
(
dev
,
state
);
dev
->
drv
->
suspend
(
dev
,
state
);
}
}
up
(
&
ucb1x00_sem
);
mutex_unlock
(
&
ucb1x00_mutex
);
return
0
;
return
0
;
}
}
...
@@ -602,12 +603,12 @@ static int ucb1x00_resume(struct mcp *mcp)
...
@@ -602,12 +603,12 @@ static int ucb1x00_resume(struct mcp *mcp)
struct
ucb1x00
*
ucb
=
mcp_get_drvdata
(
mcp
);
struct
ucb1x00
*
ucb
=
mcp_get_drvdata
(
mcp
);
struct
ucb1x00_dev
*
dev
;
struct
ucb1x00_dev
*
dev
;
down
(
&
ucb1x00_sem
);
mutex_lock
(
&
ucb1x00_mutex
);
list_for_each_entry
(
dev
,
&
ucb
->
devs
,
dev_node
)
{
list_for_each_entry
(
dev
,
&
ucb
->
devs
,
dev_node
)
{
if
(
dev
->
drv
->
resume
)
if
(
dev
->
drv
->
resume
)
dev
->
drv
->
resume
(
dev
);
dev
->
drv
->
resume
(
dev
);
}
}
up
(
&
ucb1x00_sem
);
mutex_unlock
(
&
ucb1x00_mutex
);
return
0
;
return
0
;
}
}
...
...
drivers/mmc/mmc_block.c
View file @
a2b421fe
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include <linux/kdev_t.h>
#include <linux/kdev_t.h>
#include <linux/blkdev.h>
#include <linux/blkdev.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/mutex.h>
#include <linux/mmc/card.h>
#include <linux/mmc/card.h>
#include <linux/mmc/protocol.h>
#include <linux/mmc/protocol.h>
...
@@ -57,33 +58,33 @@ struct mmc_blk_data {
...
@@ -57,33 +58,33 @@ struct mmc_blk_data {
unsigned
int
read_only
;
unsigned
int
read_only
;
};
};
static
DE
CLAR
E_MUTEX
(
open_lock
);
static
DE
FIN
E_MUTEX
(
open_lock
);
static
struct
mmc_blk_data
*
mmc_blk_get
(
struct
gendisk
*
disk
)
static
struct
mmc_blk_data
*
mmc_blk_get
(
struct
gendisk
*
disk
)
{
{
struct
mmc_blk_data
*
md
;
struct
mmc_blk_data
*
md
;
down
(
&
open_lock
);
mutex_lock
(
&
open_lock
);
md
=
disk
->
private_data
;
md
=
disk
->
private_data
;
if
(
md
&&
md
->
usage
==
0
)
if
(
md
&&
md
->
usage
==
0
)
md
=
NULL
;
md
=
NULL
;
if
(
md
)
if
(
md
)
md
->
usage
++
;
md
->
usage
++
;
up
(
&
open_lock
);
mutex_unlock
(
&
open_lock
);
return
md
;
return
md
;
}
}
static
void
mmc_blk_put
(
struct
mmc_blk_data
*
md
)
static
void
mmc_blk_put
(
struct
mmc_blk_data
*
md
)
{
{
down
(
&
open_lock
);
mutex_lock
(
&
open_lock
);
md
->
usage
--
;
md
->
usage
--
;
if
(
md
->
usage
==
0
)
{
if
(
md
->
usage
==
0
)
{
put_disk
(
md
->
disk
);
put_disk
(
md
->
disk
);
mmc_cleanup_queue
(
&
md
->
queue
);
mmc_cleanup_queue
(
&
md
->
queue
);
kfree
(
md
);
kfree
(
md
);
}
}
up
(
&
open_lock
);
mutex_unlock
(
&
open_lock
);
}
}
static
int
mmc_blk_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
static
int
mmc_blk_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment