kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Writing framework in kernel
@ 2020-03-22 16:08 Tomek The Messenger
  2020-03-22 16:37 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Tomek The Messenger @ 2020-03-22 16:08 UTC (permalink / raw)
  To: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1257 bytes --]

Hi
I am writing some framework for my kernel drivers. I delegated to framework
the code which is common amongs all kernel drivers. So my framework module
core.c has none probe, remove functions. It has also none module_init,
module_exit functions at those are not needed.
1.) When I do modprobe of my core.ko I got error:
15.092976] testframework_core: module license 'unspecified' taints kernel.
[   15.129532] testframework_core : Unknown symbol regmap_write (err 0)
[   15.129554] testframework_core : Unknown symbol devm_kmalloc (err 0)
[   15.129573] rstctl_core testframework_core : Unknown symbol
of_property_read_variable_u32_array (err 0)
[   15.129598] testframework_core : Unknown symbol sysfs_remove_groups (err
0)
etc

So I suppose I need to put in my core.c line:
MODULE_LICENSE("GPL v2");
at the end of file in order to get rid of above problems. I will check if
it helps.
However when I am looking at build-in frameworks in linux kernel nobody put
line:
  MODULE_LICENSE("GPL v2");
So why I have to and for example  here:
https://elixir.bootlin.com/linux/latest/source/drivers/reset/core.c
there is none such line and everything works?
This is what I completely don't understand. My framework is external
module, maybe this is the reason???

[-- Attachment #1.2: Type: text/html, Size: 1612 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Writing framework in kernel
  2020-03-22 16:08 Writing framework in kernel Tomek The Messenger
@ 2020-03-22 16:37 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2020-03-22 16:37 UTC (permalink / raw)
  To: Tomek The Messenger; +Cc: kernelnewbies

On Sun, Mar 22, 2020 at 05:08:15PM +0100, Tomek The Messenger wrote:
> Hi
> I am writing some framework for my kernel drivers. I delegated to framework
> the code which is common amongs all kernel drivers. So my framework module
> core.c has none probe, remove functions. It has also none module_init,
> module_exit functions at those are not needed.
> 1.) When I do modprobe of my core.ko I got error:
> 15.092976] testframework_core: module license 'unspecified' taints kernel.
> [   15.129532] testframework_core : Unknown symbol regmap_write (err 0)
> [   15.129554] testframework_core : Unknown symbol devm_kmalloc (err 0)
> [   15.129573] rstctl_core testframework_core : Unknown symbol
> of_property_read_variable_u32_array (err 0)
> [   15.129598] testframework_core : Unknown symbol sysfs_remove_groups (err
> 0)
> etc
> 
> So I suppose I need to put in my core.c line:
> MODULE_LICENSE("GPL v2");
> at the end of file in order to get rid of above problems. I will check if
> it helps.

Yes, that is what you need to do here, you are trying to access symbols
that are GPL-only, and you did not specify the license of your module to
the kernel.

good luck!

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-22 16:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-22 16:08 Writing framework in kernel Tomek The Messenger
2020-03-22 16:37 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).