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
9a881f16
Commit
9a881f16
authored
Mar 25, 2005
by
gregkh@suse.de
Committed by
Greg Kroah-Hartman
Jun 20, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] use device_for_each_child() to properly access child devices.
Signed-off-by:
Greg Kroah-Hartman
<
gregkh@suse.de
>
parent
20b1e674
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
drivers/scsi/scsi_transport_spi.c
drivers/scsi/scsi_transport_spi.c
+10
-6
No files found.
drivers/scsi/scsi_transport_spi.c
View file @
9a881f16
...
@@ -348,17 +348,21 @@ spi_transport_rd_attr(rd_strm, "%d\n");
...
@@ -348,17 +348,21 @@ spi_transport_rd_attr(rd_strm, "%d\n");
spi_transport_rd_attr
(
rti
,
"%d
\n
"
);
spi_transport_rd_attr
(
rti
,
"%d
\n
"
);
spi_transport_rd_attr
(
pcomp_en
,
"%d
\n
"
);
spi_transport_rd_attr
(
pcomp_en
,
"%d
\n
"
);
/* we only care about the first child device so we return 1 */
static
int
child_iter
(
struct
device
*
dev
,
void
*
data
)
{
struct
scsi_device
*
sdev
=
to_scsi_device
(
dev
);
spi_dv_device
(
sdev
);
return
1
;
}
static
ssize_t
static
ssize_t
store_spi_revalidate
(
struct
class_device
*
cdev
,
const
char
*
buf
,
size_t
count
)
store_spi_revalidate
(
struct
class_device
*
cdev
,
const
char
*
buf
,
size_t
count
)
{
{
struct
scsi_target
*
starget
=
transport_class_to_starget
(
cdev
);
struct
scsi_target
*
starget
=
transport_class_to_starget
(
cdev
);
/* FIXME: we're relying on an awful lot of device internals
device_for_each_child
(
&
starget
->
dev
,
NULL
,
child_iter
);
* here. We really need a function to get the first available
* child */
struct
device
*
dev
=
container_of
(
starget
->
dev
.
children
.
next
,
struct
device
,
node
);
struct
scsi_device
*
sdev
=
to_scsi_device
(
dev
);
spi_dv_device
(
sdev
);
return
count
;
return
count
;
}
}
static
CLASS_DEVICE_ATTR
(
revalidate
,
S_IWUSR
,
NULL
,
store_spi_revalidate
);
static
CLASS_DEVICE_ATTR
(
revalidate
,
S_IWUSR
,
NULL
,
store_spi_revalidate
);
...
...
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