This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA4VM: Compiling multiple file modules for ti-processor-sdk-linux-rt-evm

Part Number: TDA4VM


I am trying to build a multiple file module. The child file is empty. Just stubs. I am seeing the following syntax for the make file online.

obj-m += durationTimer.o
durationTimer-objs := test.o
I have overhead code to register a device number. When I have a single file, I see my print statements and my device. When I add the second file I see neither. When I run lsmod I do see my module.
static int __init init_duration_timer_module(void)
{
    printk("DurationTimer module loading\n");
    if(alloc_chrdev_region(&my_device_num, 0, 1, DRIVER_NAME) < 0)
    {
        printk("Device Number Allocation Failed\n");
        return (-1);
    }
    printk("Duration Timer Device Number - Major: %d Minor: %d\n", (my_device_num >> 20), (my_device_num &0xfffff));
    my_class = class_create(THIS_MODULE, DRIVER_CLASS);
    if(my_class == NULL)
    {
        printk("Device Class Create Failed\n");
        goto CLASS_ERROR;
    }
    if(device_create(my_class, NULL, my_device_num, NULL, DRIVER_NAME) == NULL)
    {
        printk("Device File Create Failed\n");
        goto FILE_ERROR;
    }
    cdev_init(&my_device, &fops);
    if(cdev_add(&my_device, my_device_num, 1) == (-1))
    {
        printk("Device Registration Failed\n");
        goto ADD_ERROR;
    }
    printk("DurationTimer module loaded\n");
    return 0;

ADD_ERROR:
    device_destroy(my_class, my_device_num);
FILE_ERROR:
    class_destroy(my_class);
CLASS_ERROR:
    unregister_chrdev(my_device_num, DRIVER_NAME);

    return (-1);
}