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
064bbf11
Commit
064bbf11
authored
May 26, 2003
by
James Bottomley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scsi sysfs add attribute release function.
parent
65d9f000
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
4 deletions
+21
-4
drivers/scsi/NCR_D700.c
drivers/scsi/NCR_D700.c
+1
-0
drivers/scsi/hosts.h
drivers/scsi/hosts.h
+2
-0
drivers/scsi/scsi_sysfs.c
drivers/scsi/scsi_sysfs.c
+18
-4
No files found.
drivers/scsi/NCR_D700.c
View file @
064bbf11
...
...
@@ -385,6 +385,7 @@ static int __init NCR_D700_init(void)
static
void
__exit
NCR_D700_exit
(
void
)
{
mca_unregister_driver
(
&
NCR_D700_driver
);
scsi_sysfs_release_attributes
();
}
module_init
(
NCR_D700_init
);
...
...
drivers/scsi/hosts.h
View file @
064bbf11
...
...
@@ -598,4 +598,6 @@ static inline Scsi_Device *scsi_find_device(struct Scsi_Host *shost,
return
NULL
;
}
extern
void
scsi_sysfs_release_attributes
(
struct
SHT
*
hostt
);
#endif
drivers/scsi/scsi_sysfs.c
View file @
064bbf11
...
...
@@ -407,7 +407,8 @@ int scsi_sysfs_modify_shost_attribute(struct class_device_attribute ***class_att
modify
=
num_attrs
;
if
(
*
class_attrs
==
scsi_sysfs_shost_attrs
||
!
modify
)
{
struct
class_device_attribute
**
tmp_attrs
=
kmalloc
(
sizeof
(
struct
class_device_attribute
)
*
(
num_attrs
+
(
modify
?
0
:
1
)),
GFP_KERNEL
);
/* note: need space for null at the end as well */
struct
class_device_attribute
**
tmp_attrs
=
kmalloc
(
sizeof
(
struct
class_device_attribute
)
*
(
num_attrs
+
(
modify
?
1
:
2
)),
GFP_KERNEL
);
if
(
tmp_attrs
==
NULL
)
return
-
ENOMEM
;
memcpy
(
tmp_attrs
,
*
class_attrs
,
sizeof
(
struct
class_device_attribute
)
*
num_attrs
);
...
...
@@ -430,7 +431,8 @@ int scsi_sysfs_modify_shost_attribute(struct class_device_attribute ***class_att
attr
->
store
=
old_attr
->
store
;
(
*
class_attrs
)[
modify
]
=
attr
;
}
else
{
(
*
class_attrs
)[
num_attrs
]
=
attr
;
(
*
class_attrs
)[
num_attrs
++
]
=
attr
;
(
*
class_attrs
)[
num_attrs
]
=
NULL
;
}
return
0
;
...
...
@@ -458,7 +460,8 @@ int scsi_sysfs_modify_sdev_attribute(struct device_attribute ***dev_attrs,
modify
=
num_attrs
;
if
(
*
dev_attrs
==
scsi_sysfs_sdev_attrs
||
!
modify
)
{
struct
device_attribute
**
tmp_attrs
=
kmalloc
(
sizeof
(
struct
device_attribute
)
*
(
num_attrs
+
(
modify
?
0
:
1
)),
GFP_KERNEL
);
/* note: need space for null at the end as well */
struct
device_attribute
**
tmp_attrs
=
kmalloc
(
sizeof
(
struct
device_attribute
)
*
(
num_attrs
+
(
modify
?
1
:
2
)),
GFP_KERNEL
);
if
(
tmp_attrs
==
NULL
)
return
-
ENOMEM
;
memcpy
(
tmp_attrs
,
*
dev_attrs
,
sizeof
(
struct
device_attribute
)
*
num_attrs
);
...
...
@@ -481,9 +484,20 @@ int scsi_sysfs_modify_sdev_attribute(struct device_attribute ***dev_attrs,
attr
->
store
=
old_attr
->
store
;
(
*
dev_attrs
)[
modify
]
=
attr
;
}
else
{
(
*
dev_attrs
)[
num_attrs
]
=
attr
;
(
*
dev_attrs
)[
num_attrs
++
]
=
attr
;
(
*
dev_attrs
)[
num_attrs
]
=
NULL
;
}
return
0
;
}
EXPORT_SYMBOL
(
scsi_sysfs_modify_sdev_attribute
);
void
scsi_sysfs_release_attributes
(
struct
SHT
*
hostt
)
{
if
(
hostt
->
sdev_attrs
!=
scsi_sysfs_sdev_attrs
)
kfree
(
hostt
->
sdev_attrs
);
if
(
hostt
->
shost_attrs
!=
scsi_sysfs_shost_attrs
)
kfree
(
hostt
->
shost_attrs
);
}
EXPORT_SYMBOL
(
scsi_sysfs_release_attributes
);
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