Skip to contentSkip to conversation

spi_board_info and module automatic load

DISCUSSION Daniel Hilst Selli 3 participants 3 messages Jun 10, 2014 – Jun 11, 2014

lore
Share & tools
lore
#1 lore raw
Quoted 9 lines · Daniel Hilst Selli

I register a spi_board_info on my board-*.c file as this

http://pastebin.com/nUGuvt71

Then create my module named mydevice.ko

Is this enought to get the module loaded automatically or I'm missing something?

I'm guessing something is missing, otherwise you wouldn't be asking us, right?

No MODULE_DEVICE_TABLE() line?

#2 lore raw

We have to follow the following steps
1.
static struct spi_board_info your_board_info[] __initdata = { {
.modalias = "driver_name",
.....
}
2. Register your board with: spi_register_board_info()
3. you have to add device to the device table with MODULE_DEVICE_TABLE(spi, your_device_id).

your device id name should be the modalise name that you are providing in spi_board_info().

These steps may help you.

Quoted 14 lines · Greg KH
Quoted 9 lines · Daniel Hilst Selli

I register a spi_board_info on my board-*.c file as this

http://pastebin.com/nUGuvt71

Then create my module named mydevice.ko

Is this enought to get the module loaded automatically or I'm missing something?

I'm guessing something is missing, otherwise you wouldn't be asking us, right?

Quoted 7 lines

No MODULE_DEVICE_TABLE() line?

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

-------------------------------------------------------------------------------------------------------------------------------
[ C-DAC is on Social-Media too. Kindly follow us at:
Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]

This e-mail is for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140611/ae179f9a/attachment.html