kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Tomek The Messenger <tomekthemessenger@gmail.com>
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: can kernel platform driver name be different than module name?
Date: Sun, 22 Mar 2020 17:34:32 +0100	[thread overview]
Message-ID: <20200322163432.GA96331@kroah.com> (raw)
In-Reply-To: <CAA4NGytRP6HzOF2khgXTU4nsB-W=oK+nPgqH_82GvcfPQm7-2Q@mail.gmail.com>

On Sun, Mar 22, 2020 at 05:26:09PM +0100, Tomek The Messenger wrote:
> I suppose the response is yes but I would like to make sure:
> Is below acceptable:
> some_module_name.c:
> #define DRIVER_NAME          "some-driver-name"
> ...
> static struct platform_driver some_driver = {
>     .driver = {
>         .name = DRIVER_NAME,
>         .of_match_table = of_match_ptr(some_of_match),
>     },
> 
> vs
> 
> Makefile:
> SRC := $(shell pwd)
> obj-m += some_module_name.o
> some_module_name-m := directoryInWhichThereIsUsFile/ some_module_name.o
> all:
> $(MAKE) -C $(KERNEL_SRC) M=$(SRC)
> modules_install:
> $(MAKE) -C $(KERNEL_SRC) M=$(SRC) modules_install

Sure, name it what ever you want, driver names only have to be unique to
the type of driver registered, while module names have to be unique to
all kernel module names.

hope this helps,

greg k-h

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

      reply	other threads:[~2020-03-22 16:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-22 16:26 can kernel platform driver name be different than module name? Tomek The Messenger
2020-03-22 16:34 ` Greg KH [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200322163432.GA96331@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=tomekthemessenger@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).