Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 58762
b: refs/heads/master
c: ffce2e7
h: refs/heads/master
v: v3
  • Loading branch information
Pierre Ossman committed Jul 9, 2007
1 parent 8ba4f1a commit 4394753
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 57 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b93931a61a119575f84c33af2438b9384fde9eb7
refs/heads/master: ffce2e7e7060c949ccd703dacc9b3dd81b377373
49 changes: 48 additions & 1 deletion trunk/drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,34 @@
#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"

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
Expand Down Expand Up @@ -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");
51 changes: 0 additions & 51 deletions trunk/drivers/mmc/core/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
4 changes: 0 additions & 4 deletions trunk/drivers/mmc/core/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4394753

Please sign in to comment.