Ai
1 Star 2 Fork 2

e665107/Linux-Device-Drivers-Development

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fake-gpio-ins.c 684 Bytes
一键复制 编辑 原始数据 按行查看 历史
swathym14 提交于 2017-10-13 20:40 +08:00 . Code files
#include <linux/platform_device.h>
#include <linux/module.h>
#include <linux/types.h>
static struct platform_device *pdev;
static int __init platform_dummy_char_add(void)
{
int inst_id = 0; /* instance unique ID: base address would be a good choice */
pdev = platform_device_alloc("fake-gpio-chip", inst_id);
platform_device_add(pdev);
pr_info("fake-gpio-chip added\n");
return 0;
}
static void __exit fplatform_dummy_char_put(void)
{
pr_info("fake-gpio-chip removed\n");
platform_device_put(pdev);
}
module_init(platform_dummy_char_add);
module_exit(fplatform_dummy_char_put);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("John Madieu <john.madieu@gmail.com>");
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/e665107/Linux-Device-Drivers-Development.git
git@gitee.com:e665107/Linux-Device-Drivers-Development.git
e665107
Linux-Device-Drivers-Development
Linux-Device-Drivers-Development
master

搜索帮助