Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
ffce2e7e
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ffce2e7e
编写于
5月 19, 2007
作者:
P
Pierre Ossman
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mmc: move layer init and workqueue to core file
Signed-off-by:
N
Pierre Ossman
<
drzeus@drzeus.cx
>
上级
b93931a6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
48 addition
and
56 deletion
+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
未找到文件。
drivers/mmc/core/core.c
浏览文件 @
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
浏览文件 @
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
浏览文件 @
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
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录