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
87f15d4a
Commit
87f15d4a
authored
Mar 24, 2016
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtd: switch open_mtd_by_chdev() to use of vfs_stat()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
f55532a0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
drivers/mtd/ubi/build.c
drivers/mtd/ubi/build.c
+5
-8
No files found.
drivers/mtd/ubi/build.c
View file @
87f15d4a
...
@@ -1142,22 +1142,19 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway)
...
@@ -1142,22 +1142,19 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway)
*/
*/
static
struct
mtd_info
*
__init
open_mtd_by_chdev
(
const
char
*
mtd_dev
)
static
struct
mtd_info
*
__init
open_mtd_by_chdev
(
const
char
*
mtd_dev
)
{
{
int
err
,
major
,
minor
,
mode
;
struct
kstat
stat
;
struct
path
path
;
int
err
,
minor
;
/* Probably this is an MTD character device node path */
/* Probably this is an MTD character device node path */
err
=
kern_path
(
mtd_dev
,
LOOKUP_FOLLOW
,
&
path
);
err
=
vfs_stat
(
mtd_dev
,
&
stat
);
if
(
err
)
if
(
err
)
return
ERR_PTR
(
err
);
return
ERR_PTR
(
err
);
/* MTD device number is defined by the major / minor numbers */
/* MTD device number is defined by the major / minor numbers */
major
=
imajor
(
d_backing_inode
(
path
.
dentry
));
if
(
MAJOR
(
stat
.
rdev
)
!=
MTD_CHAR_MAJOR
||
!
S_ISCHR
(
stat
.
mode
))
minor
=
iminor
(
d_backing_inode
(
path
.
dentry
));
mode
=
d_backing_inode
(
path
.
dentry
)
->
i_mode
;
path_put
(
&
path
);
if
(
major
!=
MTD_CHAR_MAJOR
||
!
S_ISCHR
(
mode
))
return
ERR_PTR
(
-
EINVAL
);
return
ERR_PTR
(
-
EINVAL
);
minor
=
MINOR
(
stat
.
rdev
);
if
(
minor
&
1
)
if
(
minor
&
1
)
/*
/*
* Just do not think the "/dev/mtdrX" devices support is need,
* Just do not think the "/dev/mtdrX" devices support is need,
...
...
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