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
b65b902c
Commit
b65b902c
authored
Jun 09, 2003
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[memblk] Convert to use new system device API
parent
22ff2891
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
18 deletions
+13
-18
drivers/base/memblk.c
drivers/base/memblk.c
+13
-18
No files found.
drivers/base/memblk.c
View file @
b65b902c
...
...
@@ -2,7 +2,6 @@
* drivers/base/memblk.c - basic Memory Block class support
*/
#include <linux/device.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/memblk.h>
...
...
@@ -11,8 +10,8 @@
#include <asm/topology.h>
static
struct
class
memblk_class
=
{
.
name
=
"memblk"
,
static
struct
sysdev_
class
memblk_class
=
{
set_kset_name
(
"memblk"
)
,
};
...
...
@@ -30,27 +29,23 @@ static struct device_driver memblk_driver = {
*/
int
__init
register_memblk
(
struct
memblk
*
memblk
,
int
num
,
struct
node
*
root
)
{
int
error
;
memblk
->
node_id
=
memblk_to_node
(
num
);
memblk
->
sysdev
.
name
=
"memblk"
;
memblk
->
sysdev
.
cls
=
&
memblk_class
,
memblk
->
sysdev
.
id
=
num
;
if
(
root
)
memblk
->
sysdev
.
root
=
&
root
->
sysroot
;
snprintf
(
memblk
->
sysdev
.
dev
.
name
,
DEVICE_NAME_SIZE
,
"Memory Block %u"
,
num
);
memblk
->
sysdev
.
dev
.
driver
=
&
memblk_driver
;
return
sys_device_register
(
&
memblk
->
sysdev
);
error
=
sys_device_register
(
&
memblk
->
sysdev
);
if
(
!
error
)
error
=
sysfs_create_link
(
&
root
->
sysdev
.
kobj
,
&
memblk
->
sysdev
,
kobj
,
memblk
->
sysdev
.
kobj
.
name
);
return
error
;
}
int
__init
register_memblk_type
(
void
)
{
int
error
;
error
=
class_register
(
&
memblk_class
);
if
(
!
error
)
{
error
=
driver_register
(
&
memblk_driver
);
if
(
error
)
class_unregister
(
&
memblk_class
);
}
return
error
;
return
sysdev_class_register
(
&
memblk_class
);
}
postcore_initcall
(
register_memblk_type
);
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