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
ca0e5f35
Commit
ca0e5f35
authored
Oct 08, 2002
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IDE: add struct device to ide_drive_t and use that for IDE drives
... instead of the one in struct gendisk.
parent
716041cc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
drivers/ide/ide-probe.c
drivers/ide/ide-probe.c
+14
-9
include/linux/ide.h
include/linux/ide.h
+1
-0
No files found.
drivers/ide/ide-probe.c
View file @
ca0e5f35
...
...
@@ -998,15 +998,6 @@ static void init_gendisk (ide_hwif_t *hwif)
sprintf
(
disk
->
disk_name
,
"hd%c"
,
'a'
+
hwif
->
index
*
MAX_DRIVES
+
unit
);
disk
->
minor_shift
=
PARTN_BITS
;
disk
->
fops
=
ide_fops
;
snprintf
(
disk
->
disk_dev
.
bus_id
,
BUS_ID_SIZE
,
"%u.%u"
,
hwif
->
index
,
unit
);
snprintf
(
disk
->
disk_dev
.
name
,
DEVICE_NAME_SIZE
,
"%s"
,
"IDE Drive"
);
disk
->
disk_dev
.
parent
=
&
hwif
->
gendev
;
disk
->
disk_dev
.
bus
=
&
ide_bus_type
;
if
(
hwif
->
drives
[
unit
].
present
)
device_register
(
&
disk
->
disk_dev
);
hwif
->
drives
[
unit
].
disk
=
disk
;
}
...
...
@@ -1020,6 +1011,20 @@ static void init_gendisk (ide_hwif_t *hwif)
if
(
hwif
->
drives
[
unit
].
present
)
hwif
->
drives
[
unit
].
de
=
devfs_mk_dir
(
ide_devfs_handle
,
name
,
NULL
);
}
for
(
unit
=
0
;
unit
<
units
;
++
unit
)
{
ide_drive_t
*
drive
=
&
hwif
->
drives
[
unit
];
snprintf
(
drive
->
gendev
.
bus_id
,
BUS_ID_SIZE
,
"%u.%u"
,
hwif
->
index
,
unit
);
snprintf
(
drive
->
gendev
.
name
,
DEVICE_NAME_SIZE
,
"%s"
,
"IDE Drive"
);
drive
->
gendev
.
parent
=
&
hwif
->
gendev
;
drive
->
gendev
.
bus
=
&
ide_bus_type
;
if
(
drive
->
present
)
device_register
(
&
drive
->
gendev
);
}
return
;
err_kmalloc_gd:
...
...
include/linux/ide.h
View file @
ca0e5f35
...
...
@@ -794,6 +794,7 @@ typedef struct ide_drive_s {
int
lun
;
/* logical unit */
int
crc_count
;
/* crc counter to reduce drive speed */
struct
list_head
list
;
struct
device
gendev
;
struct
gendisk
*
disk
;
}
ide_drive_t
;
...
...
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