FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: How to resolve this error...
PostPosted: Fri Aug 02, 2013 4:02 pm 
Offline

Joined: Sat Oct 20, 2012 12:34 pm
Posts: 31
Hello....
i try to write simple LCD driver ....
when compiling , compiled with no error and no warning but when insert driver not inserting with down error:

Image


Top
 Profile  
 
 Post subject: Re: How to resolve this error...
PostPosted: Mon Aug 05, 2013 11:52 pm 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 696
Location: USA
Getting a messge like "module license 'unspecified' taints kernel" usually means that your code has omitted the
Code:
MODULE_LICENSE("GPL");
macro.

You probably should review the GNU GPL, and learn & understand the legal ramifications and requirements of using "free" software.

> LCDDriver: Unknown symbol platform_...

It's not likely that you want a platform driver.
Based on your past activities, you are probably again copying code from inappropriate sources into your kernel module.
One time you copied userland code and tried to perform an open() in the kernel module.
Have you now copied code from a SPI master device driver, i.e. the driver for a SPI controller?
Isn't your driver supposed to be for a SPI target device, i.e. a device that is connected to the system by SPI?

Regards


Top
 Profile  
 
 Post subject: Re: How to resolve this error...
PostPosted: Sun Aug 18, 2013 1:54 pm 
Offline

Joined: Sat Oct 20, 2012 12:34 pm
Posts: 31
thank you
resolved....
an question

ho to use "struct resource" variable?
my board is AT91SAM9260-EK
and i will use some pin of PORT A,B,C in module
how to fill "start , end , flag " parameters of "struct resource" variable?
Code:
#define PORTC 0xFFFF F800 //512 Byte
#define PORTB 0xFFFF F600 //512 Byte
#define PORTA 0xFFFF F400 //512 Byte

static struct resource my_resources[] = {
  [0] = {
    .start      = PORTA,
    .end        = 512 * 3,
    .flags      = IORESOURCE_MEM,
  },
};


Top
 Profile  
 
 Post subject: Re: How to resolve this error...
PostPosted: Tue Aug 20, 2013 2:57 am 
Offline

Joined: Thu Apr 19, 2007 10:15 pm
Posts: 696
Location: USA
vahidsport wrote:
ho to use "struct resource" variable?
my board is AT91SAM9260-EK
There are quite a few examples of structure usage in
arch/arm/mach-at91/at91sam9260_devices.c

.start is the beginning address of the resource.
.end is the last address of the resource.
.flags is for declaring attributes of the resource.

Quote:
Code:
#define PORTC 0xFFFF F800 //512 Byte
#define PORTB 0xFFFF F600 //512 Byte
#define PORTA 0xFFFF F400 //512 Byte
These are bogus statements.
If these constants are supposed to be for 32-bit (physical) memory addresses, then there should be no whitespace between the eight hexdigits.
Also C++ style comments are not proper style for kernel code. Use /* ... */.

Quote:
Code:
    .end        = 512 * 3,
.end specifies the last address of the resource, not a length.

Consolidating all three port resources into one region is dubious. You (try to) define three distinct port names, but declare only one as a resource. Then you kludge up a length to span the entire memory region. That is not the way to write maintainable code.

Consider instead:
Code:
static struct resource my_resources[] = {
        [0] = {
                .start  = PORTA,
                .end    = PORTA + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        },
        [1] = {
                .start  = PORTB,
                .end    = PORTB + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        },
        [2] = {
                .start  = PORTC,
                .end    = PORTC + SZ_512 - 1,
                .flags  = IORESOURCE_MEM,
        },
};


Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: