当前位置: 首页>>代码示例>>C++>>正文


C++ dev_to_mmc_card函数代码示例

本文整理汇总了C++中dev_to_mmc_card函数的典型用法代码示例。如果您正苦于以下问题:C++ dev_to_mmc_card函数的具体用法?C++ dev_to_mmc_card怎么用?C++ dev_to_mmc_card使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dev_to_mmc_card函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mmc_bus_probe

static int mmc_bus_probe(struct device *dev)
{
	struct mmc_driver *drv = to_mmc_driver(dev->driver);
	struct mmc_card *card = dev_to_mmc_card(dev);

	return drv->probe(card);
}
开发者ID:markolino631,项目名称:lge_kernel_msm7x27,代码行数:7,代码来源:bus.c

示例2: mmc_bus_uevent

static int
mmc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
{
	struct mmc_card *card = dev_to_mmc_card(dev);
	const char *type;
	int retval = 0;

	switch (card->type) {
	case MMC_TYPE_MMC:
		type = "MMC";
		break;
	case MMC_TYPE_SD:
		type = "SD";
		break;
	case MMC_TYPE_SDIO:
		type = "SDIO";
		break;
	default:
		type = NULL;
	}

	if (type) {
		retval = add_uevent_var(env, "MMC_TYPE=%s", type);
		if (retval)
			return retval;
	}

	retval = add_uevent_var(env, "MMC_NAME=%s", mmc_card_name(card));

	return retval;
}
开发者ID:PennPanda,项目名称:linux-repo,代码行数:31,代码来源:bus.c

示例3: mmc_bus_uevent

static int
mmc_bus_uevent(struct device *dev, char **envp, int num_envp, char *buf,
		int buf_size)
{
	struct mmc_card *card = dev_to_mmc_card(dev);
	int retval = 0, i = 0, length = 0;

#define add_env(fmt,val) do {					\
	retval = add_uevent_var(envp, num_envp, &i,		\
				buf, buf_size, &length,		\
				fmt, val);			\
	if (retval)						\
		return retval;					\
} while (0);

	switch (card->type) {
	case MMC_TYPE_MMC:
		add_env("MMC_TYPE=%s", "MMC");
		break;
	case MMC_TYPE_SD:
		add_env("MMC_TYPE=%s", "SD");
		break;
	}

	add_env("MMC_NAME=%s", mmc_card_name(card));

#undef add_env

	envp[i] = NULL;

	return 0;
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:32,代码来源:bus.c

示例4: mmc_bus_remove

static int mmc_bus_remove(struct device *dev)
{
	struct mmc_driver *drv = to_mmc_driver(dev->driver);
	struct mmc_card *card = dev_to_mmc_card(dev);

	drv->remove(card);

	return 0;
}
开发者ID:markolino631,项目名称:lge_kernel_msm7x27,代码行数:9,代码来源:bus.c

示例5: mmc_bus_resume

static int mmc_bus_resume(struct device *dev)
{
	struct mmc_driver *drv = to_mmc_driver(dev->driver);
	struct mmc_card *card = dev_to_mmc_card(dev);
	int ret = 0;

	if (dev->driver && drv->resume)
		ret = drv->resume(card);
	return ret;
}
开发者ID:markolino631,项目名称:lge_kernel_msm7x27,代码行数:10,代码来源:bus.c

示例6: mmc_bus_suspend

static int mmc_bus_suspend(struct device *dev, pm_message_t state)
{
	struct mmc_driver *drv = to_mmc_driver(dev->driver);
	struct mmc_card *card = dev_to_mmc_card(dev);
	int ret = 0;

	if (dev->driver && drv->suspend)
		ret = drv->suspend(card, state);
	return ret;
}
开发者ID:markolino631,项目名称:lge_kernel_msm7x27,代码行数:10,代码来源:bus.c

示例7: mmc_release_card

static void mmc_release_card(struct device *dev)
{
	struct mmc_card *card = dev_to_mmc_card(dev);

	sdio_free_common_cis(card);

	if (card->info)
		kfree(card->info);

	kfree(card);
}
开发者ID:markolino631,项目名称:lge_kernel_msm7x27,代码行数:11,代码来源:bus.c

示例8: mmc_type_show

static ssize_t mmc_type_show(struct device *dev,
	struct device_attribute *attr, char *buf)
{
	struct mmc_card *card = dev_to_mmc_card(dev);

	switch (card->type) {
	case MMC_TYPE_MMC:
		return sprintf(buf, "MMC\n");
	case MMC_TYPE_SD:
		return sprintf(buf, "SD\n");
	default:
		return -EFAULT;
	}
}
开发者ID:cilynx,项目名称:dd-wrt,代码行数:14,代码来源:bus.c


注:本文中的dev_to_mmc_card函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。