Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jan 2018 13:44:47 -0800
From:      Conrad Meyer <cem@freebsd.org>
To:        Leonardo Fogel <leonardofogel@yahoo.com.br>
Cc:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: To which list should I submit a patch?
Message-ID:  <CAG6CVpUb9HFzLS15tWnK%2B0sR99zTh%2B0oeKnUrjE5rteZPbXQLA@mail.gmail.com>
In-Reply-To: <1106737441.618504.1515098578398@mail.yahoo.com>
References:  <1106737441.618504.1515098578398.ref@mail.yahoo.com> <1106737441.618504.1515098578398@mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
IMO, either is fine.  I think documentation may refer to docs outside
of the src tree, whereas this is in the src tree.  Thanks for the
submission.

Best,
Conrad

On Thu, Jan 4, 2018 at 12:42 PM, Leonardo Fogel
<leonardofogel@yahoo.com.br> wrote:
>
>
> Hi,
> I have written a short patch that replaces the legacy interface make_dev(=
9) with the newer one make_dev_s(9) in the DEV_MODULE(9) man page and in an=
 example that is included in the base. I do not know if I should submit it =
as a PR to "Base System" (since they are in the base tree) or to "Documenta=
tion".
> Please, could you kindly give me some suggestion?
> Thank you for your time.
>
> Index: src/share/examples/kld/cdev/module/cdevmod.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- src/share/examples/kld/cdev/module/cdevmod.c        (revision 327530)
> +++ src/share/examples/kld/cdev/module/cdevmod.c        (working copy)
> @@ -109,6 +109,7 @@
>  cdev_load(module_t mod, int cmd, void *arg)
>  {
>      int  err =3D 0;
> +    struct make_dev_args mda;
>
>      switch (cmd) {
>      case MOD_LOAD:
> @@ -120,9 +121,15 @@
>         printf("Copyright (c) 1998\n");
>         printf("Rajesh Vaidheeswarran\n");
>         printf("All rights reserved\n");
> -       sdev =3D make_dev(&my_devsw, 0, UID_ROOT, GID_WHEEL, 0600, "cdev"=
);
> -       break;          /* Success*/
>
> +       make_dev_args_init(&mda);
> +       mda.mda_devsw =3D &my_devsw;
> +       mda.mda_uid =3D UID_ROOT;
> +       mda.mda_gid =3D GID_WHEEL;
> +       mda.mda_mode =3D 0600;
> +       err =3D make_dev_s(&mda, &sdev, "cdev");
> +       break;
> +
>      case MOD_UNLOAD:
>         printf("Unloaded kld character device driver\n");
>         destroy_dev(sdev);
> Index: src/share/man/man9/DEV_MODULE.9
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- src/share/man/man9/DEV_MODULE.9     (revision 327530)
> +++ src/share/man/man9/DEV_MODULE.9     (working copy)
> @@ -58,11 +58,13 @@
>  .Xr DECLARE_MODULE 9
>  for more information).
>  The event handler is supposed to create the device with
> -.Fn make_dev
> +.Fn make_dev_s
>  on load and to destroy it when it is unloaded using
>  .Fn destroy_dev .
>  .Sh EXAMPLES
>  .Bd -literal
> +#include <sys/param.h>
> +#include <sys/kernel.h>
>  #include <sys/module.h>
>  #include <sys/conf.h>
>
> @@ -74,11 +76,17 @@
>  foo_load(module_t mod, int cmd, void *arg)
>  {
>      int err =3D 0;
> +    struct make_dev_args mda;
>
>      switch (cmd) {
>      case MOD_LOAD:
> -        sdev =3D make_dev(&foo_devsw, 0, UID_ROOT, GID_WHEEL, 0600, "foo=
");
> -        break;          /* Success*/
> +       make_dev_args_init(&mda);
> +       mda.mda_devsw =3D &foo_devsw;
> +       mda.mda_uid =3D UID_ROOT;
> +       mda.mda_gid =3D GID_WHEEL;
> +       mda.mda_mode =3D 0600;
> +       err =3D make_dev_s(&mda, &sdev, "foo");
> +       break;
>
>      case MOD_UNLOAD:
>      case MOD_SHUTDOWN:
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org=
"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpUb9HFzLS15tWnK%2B0sR99zTh%2B0oeKnUrjE5rteZPbXQLA>