I know that the driver and device must have the same name and I've made sure I've done that. However, when modprobe'ing my driver, nothing happens even though I've done a number of printk's in the init function.
When modprobing, I get:
root@localhost:~# dmesg --clear
root@localhost:~# modprobe mcp3202
root@localhost:~# dmesg
[ 41.828678] kobject: 'mcp3202' (bf03968c): kobject_add_internal: parent: 'module', set: 'module'
[ 41.828747] kobject: 'holders' (ded9d980): kobject_add_internal: parent: 'mcp3202', set: '<NULL>'
[ 41.828890] kobject: 'notes' (dd1947c0): kobject_add_internal: parent: 'mcp3202', set: '<NULL>'
[ 41.829028] kobject: 'mcp3202' (bf03968c): kobject_uevent_env
[ 41.829053] kobject: 'mcp3202' (bf03968c): fill_kobj_path: path = '/module/mcp3202'
root@localhost:~#
No printk's appear.
My device and driver structures are:
static struct platform_device mcp3202_device = {
.name = "mcp3202",
.id = 0,
.num_resources = 0,
};
static strict of_device_id mcp3202_id[] = {
{ .compatible = "microchip,mcp3202", },
{ }
};
MODULE_DEVICE_TABLE(of,mcp3202_id);
static struct platform_driver mcp3202_driver = {
.driver = {
.name = "mcp3202",
.owner = THIS_MODULE,
.of_match_table = mcp3202_id,
},
.probe = mcp3202_probe,
.remove = mcp3202_remove,
};
module_init(mcp3202_init);
module_exit(mcp3202_exit);
... and finally, my init function (partial) ...
static int __init mcp3202_init(void)
{
int init_result;
struct device *dev;
printk(KERN_WARNING "mcp3202: reg driver\n");
.
.
.
}
My understanding is as long as the names match (dev/drv), the mcp3202_init will be called regardless of what is defined in the .dts for this device.
Anyone have any clues what I'm missing?
Thanks!