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
a5a1561f
Commit
a5a1561f
authored
Mar 02, 2008
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] switch mmc
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
f3f6015b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
drivers/mmc/card/block.c
drivers/mmc/card/block.c
+8
-9
No files found.
drivers/mmc/card/block.c
View file @
a5a1561f
...
...
@@ -92,18 +92,17 @@ static void mmc_blk_put(struct mmc_blk_data *md)
mutex_unlock
(
&
open_lock
);
}
static
int
mmc_blk_open
(
struct
inode
*
inode
,
struct
file
*
filp
)
static
int
mmc_blk_open
(
struct
block_device
*
bdev
,
fmode_t
mode
)
{
struct
mmc_blk_data
*
md
;
struct
mmc_blk_data
*
md
=
mmc_blk_get
(
bdev
->
bd_disk
)
;
int
ret
=
-
ENXIO
;
md
=
mmc_blk_get
(
inode
->
i_bdev
->
bd_disk
);
if
(
md
)
{
if
(
md
->
usage
==
2
)
check_disk_change
(
inode
->
i_
bdev
);
check_disk_change
(
bdev
);
ret
=
0
;
if
((
filp
->
f_
mode
&
FMODE_WRITE
)
&&
md
->
read_only
)
{
if
((
mode
&
FMODE_WRITE
)
&&
md
->
read_only
)
{
mmc_blk_put
(
md
);
ret
=
-
EROFS
;
}
...
...
@@ -112,9 +111,9 @@ static int mmc_blk_open(struct inode *inode, struct file *filp)
return
ret
;
}
static
int
mmc_blk_release
(
struct
inode
*
inode
,
struct
file
*
filp
)
static
int
mmc_blk_release
(
struct
gendisk
*
disk
,
fmode_t
mode
)
{
struct
mmc_blk_data
*
md
=
inode
->
i_bdev
->
bd_
disk
->
private_data
;
struct
mmc_blk_data
*
md
=
disk
->
private_data
;
mmc_blk_put
(
md
);
return
0
;
...
...
@@ -130,8 +129,8 @@ mmc_blk_getgeo(struct block_device *bdev, struct hd_geometry *geo)
}
static
struct
block_device_operations
mmc_bdops
=
{
.
__
open
=
mmc_blk_open
,
.
__
release
=
mmc_blk_release
,
.
open
=
mmc_blk_open
,
.
release
=
mmc_blk_release
,
.
getgeo
=
mmc_blk_getgeo
,
.
owner
=
THIS_MODULE
,
};
...
...
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