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
ffce2e7e
Commit
ffce2e7e
authored
May 19, 2007
by
Pierre Ossman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mmc: move layer init and workqueue to core file
Signed-off-by:
Pierre Ossman
<
drzeus@drzeus.cx
>
parent
b93931a6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
56 deletions
+48
-56
drivers/mmc/core/core.c
drivers/mmc/core/core.c
+48
-1
drivers/mmc/core/sysfs.c
drivers/mmc/core/sysfs.c
+0
-51
drivers/mmc/core/sysfs.h
drivers/mmc/core/sysfs.h
+0
-4
No files found.
drivers/mmc/core/core.c
View file @
ffce2e7e
...
...
@@ -27,7 +27,8 @@
#include <linux/mmc/sd.h>
#include "core.h"
#include "sysfs.h"
#include "bus.h"
#include "host.h"
#include "mmc_ops.h"
#include "sd_ops.h"
...
...
@@ -35,6 +36,25 @@
extern
int
mmc_attach_mmc
(
struct
mmc_host
*
host
,
u32
ocr
);
extern
int
mmc_attach_sd
(
struct
mmc_host
*
host
,
u32
ocr
);
static
struct
workqueue_struct
*
workqueue
;
/*
* Internal function. Schedule delayed work in the MMC work queue.
*/
static
int
mmc_schedule_delayed_work
(
struct
delayed_work
*
work
,
unsigned
long
delay
)
{
return
queue_delayed_work
(
workqueue
,
work
,
delay
);
}
/*
* Internal function. Flush all scheduled work from the MMC work queue.
*/
static
void
mmc_flush_scheduled_work
(
void
)
{
flush_workqueue
(
workqueue
);
}
/**
* mmc_request_done - finish processing an MMC request
* @host: MMC host which completed request
...
...
@@ -638,4 +658,31 @@ EXPORT_SYMBOL(mmc_resume_host);
#endif
static
int
__init
mmc_init
(
void
)
{
int
ret
;
workqueue
=
create_singlethread_workqueue
(
"kmmcd"
);
if
(
!
workqueue
)
return
-
ENOMEM
;
ret
=
mmc_register_bus
();
if
(
ret
==
0
)
{
ret
=
mmc_register_host_class
();
if
(
ret
)
mmc_unregister_bus
();
}
return
ret
;
}
static
void
__exit
mmc_exit
(
void
)
{
mmc_unregister_host_class
();
mmc_unregister_bus
();
destroy_workqueue
(
workqueue
);
}
module_init
(
mmc_init
);
module_exit
(
mmc_exit
);
MODULE_LICENSE
(
"GPL"
);
drivers/mmc/core/sysfs.c
View file @
ffce2e7e
...
...
@@ -10,17 +10,10 @@
*
* MMC sysfs/driver model support.
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/idr.h>
#include <linux/workqueue.h>
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
#include "bus.h"
#include "host.h"
#include "sysfs.h"
int
mmc_add_attrs
(
struct
mmc_card
*
card
,
struct
device_attribute
*
attrs
)
...
...
@@ -48,47 +41,3 @@ void mmc_remove_attrs(struct mmc_card *card, struct device_attribute *attrs)
device_remove_file
(
&
card
->
dev
,
&
attrs
[
i
]);
}
static
struct
workqueue_struct
*
workqueue
;
/*
* Internal function. Schedule delayed work in the MMC work queue.
*/
int
mmc_schedule_delayed_work
(
struct
delayed_work
*
work
,
unsigned
long
delay
)
{
return
queue_delayed_work
(
workqueue
,
work
,
delay
);
}
/*
* Internal function. Flush all scheduled work from the MMC work queue.
*/
void
mmc_flush_scheduled_work
(
void
)
{
flush_workqueue
(
workqueue
);
}
static
int
__init
mmc_init
(
void
)
{
int
ret
;
workqueue
=
create_singlethread_workqueue
(
"kmmcd"
);
if
(
!
workqueue
)
return
-
ENOMEM
;
ret
=
mmc_register_bus
();
if
(
ret
==
0
)
{
ret
=
mmc_register_host_class
();
if
(
ret
)
mmc_unregister_bus
();
}
return
ret
;
}
static
void
__exit
mmc_exit
(
void
)
{
mmc_unregister_host_class
();
mmc_unregister_bus
();
destroy_workqueue
(
workqueue
);
}
module_init
(
mmc_init
);
module_exit
(
mmc_exit
);
drivers/mmc/core/sysfs.h
View file @
ffce2e7e
...
...
@@ -23,8 +23,4 @@ static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *a
int
mmc_add_attrs
(
struct
mmc_card
*
card
,
struct
device_attribute
*
attrs
);
void
mmc_remove_attrs
(
struct
mmc_card
*
card
,
struct
device_attribute
*
attrs
);
int
mmc_schedule_work
(
struct
work_struct
*
work
);
int
mmc_schedule_delayed_work
(
struct
delayed_work
*
work
,
unsigned
long
delay
);
void
mmc_flush_scheduled_work
(
void
);
#endif
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