Hello I'm trying to write a loadable kernel module driver. I get an error during compilation: ERROR: modpost: "platform_device_alloc" [/home/rdm/ethtest/eth-ins.ko] undefined! Do I need something to set in the Kernel Config? Helloworld works as LKM.
#include <linux/platform_device.h>
#include <linux/module.h
#include <linux/types.h>
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Robert W. Oliver II");
MODULE_DESCRIPTION("A simple example Linux module.");
MODULE_VERSION("0.01");
static struct platform_device *pdev;
static int __init fake_eth_add(void)
{
int inst_id = 0;
pdev = platform_device_alloc("fake-eth", inst_id);
return 0;
}
static void __exit fake_eth_put(void)
{
}
module_init(fake_eth_add);
module_exit(fake_eth_put);
