Find the answer to your Linux question:
Results 1 to 2 of 2
I am moving a driver from 3.1.2 to latest stabe (3.5.2). The driver gets compiled in 3.1.2 but throws errors in the latest one. Any help is appreciated. Thank you ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2012
    Posts
    2

    Driver compiling in 3.5.2


    I am moving a driver from 3.1.2 to latest stabe (3.5.2). The driver gets compiled in 3.1.2 but throws errors in the latest one. Any help is appreciated. Thank you
    One more question. Have they done away with these functions?
    i2c_add_driver( );
    i2c_del_driver( );
    module_init( );
    module_exit( );
    They do not seems to be present in other drivers in 3.5.2. Instead they use only one function - module_i2c_driver( );

    Error logs and part of the code:

    drivers/media/video/ar0130.c:1100: warning: data definition has no type or storage class
    drivers/media/video/ar0130.c:1100: warning: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE'
    drivers/media/video/ar0130.c:1100: warning: parameter names (without types) in function declaration
    drivers/media/video/ar0130.c: In function 'ar0130_i2c_driver_init':
    drivers/media/video/ar0130.c:1111: error: 'THIS_MODULE' undeclared (first use in this function)
    drivers/media/video/ar0130.c:1111: error: (Each undeclared identifier is reported only once
    drivers/media/video/ar0130.c:1111: error: for each function it appears in.)
    drivers/media/video/ar0130.c: At top level:
    drivers/media/video/ar0130.c:1113: error: expected declaration specifiers or '...' before string constant
    drivers/media/video/ar0130.c:1113: warning: data definition has no type or storage class
    drivers/media/video/ar0130.c:1113: warning: type defaults to 'int' in declaration of 'MODULE_DESCRIPTION'
    drivers/media/video/ar0130.c:1113: warning: function declaration isn't a prototype
    drivers/media/video/ar0130.c:1114: error: expected declaration specifiers or '...' before string constant
    drivers/media/video/ar0130.c:1114: warning: data definition has no type or storage class
    drivers/media/video/ar0130.c:1114: warning: type defaults to 'int' in declaration of 'MODULE_AUTHOR'
    drivers/media/video/ar0130.c:1114: warning: function declaration isn't a prototype
    drivers/media/video/ar0130.c:1115: error: expected declaration specifiers or '...' before string constant
    drivers/media/video/ar0130.c:1115: warning: data definition has no type or storage class
    drivers/media/video/ar0130.c:1115: warning: type defaults to 'int' in declaration of 'MODULE_LICENSE'
    drivers/media/video/ar0130.c:1115: warning: function declaration isn't a prototype

    <CODE>
    1095
    1096 static const struct i2c_device_id ar0130_id[] = {
    1097 { "ar0130", 0 },
    1098 { }
    1099 };
    1100 MODULE_DEVICE_TABLE(i2c, ar0130_id);
    1101
    1102 static struct i2c_driver ar0130_i2c_driver = {
    1103 .driver = {
    1104 .name = "ar0130",
    1105 },
    1106 .probe = ar0130_probe,
    1107 .remove = ar0130_remove,
    1108 .id_table = ar0130_id,
    1109 };
    1110
    1111 module_i2c_driver(ar0130_i2c_driver);
    1112
    1113 MODULE_DESCRIPTION("Aptina AR0130 Camera driver");
    1114 MODULE_AUTHOR("Aptina Imaging");
    1115 MODULE_LICENSE("GPL v2");
    <CODE>

  2. #2
    Just Joined!
    Join Date
    Aug 2012
    Posts
    2
    A naive mistake, I had to include <linux/module.h> file

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •