Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
linux-seco-imx
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Jira
Code
Merge requests
15
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Clea OS
bsp
nxp
linux-seco-imx
Commits
9a881f16
Commit
9a881f16
authored
20 years ago
by
gregkh@suse.de
Committed by
Greg Kroah-Hartman
19 years ago
Browse files
Options
Downloads
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
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/scsi/scsi_transport_spi.c
+10
-6
10 additions, 6 deletions
drivers/scsi/scsi_transport_spi.c
with
10 additions
and
6 deletions
drivers/scsi/scsi_transport_spi.c
+
10
−
6
View file @
9a881f16
...
...
@@ -348,17 +348,21 @@ spi_transport_rd_attr(rd_strm, "%d\n");
spi_transport_rd_attr
(
rti
,
"%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
store_spi_revalidate
(
struct
class_device
*
cdev
,
const
char
*
buf
,
size_t
count
)
{
struct
scsi_target
*
starget
=
transport_class_to_starget
(
cdev
);
/* FIXME: we're relying on an awful lot of device internals
* 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
);
device_for_each_child
(
&
starget
->
dev
,
NULL
,
child_iter
);
return
count
;
}
static
CLASS_DEVICE_ATTR
(
revalidate
,
S_IWUSR
,
NULL
,
store_spi_revalidate
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment