* Re: (Subject) [PATCH] misc: add simple hello world driver
[not found] <CAPWuoRHO13=CQh7D_+AircPfj=CnmrRiX89Nh_TCUEH=yFkx1A@mail.gmail.com>
@ 2026-10-04 6:25 ` gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2026-10-04 6:25 UTC (permalink / raw)
To: Amir Ali Tadayyon; +Cc: linux-kernel
On Sat, Oct 03, 2026 at 09:11:49PM +0330, Amir Ali Tadayyon wrote:
> Add a minimal misc driver that prints a message to the kernel log
> on load and unload. This serves as a starting point for new
> contributors to understand the module init/exit flow.
>
> Signed-off-by: Amir Ali <a.tadayyon12@gmail.com>
> ---
> drivers/misc/Kconfig | 7 +++++++
> drivers/misc/Makefile | 1 +
> drivers/misc/hello_driver.c | 32 ++++++++++++++++++++++++++++++++
> 3 files changed, 40 insertions(+)
> create mode 100644 drivers/misc/hello_driver.c
>
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 1234567..89abcde 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -1,3 +1,10 @@
> # SPDX-License-Identifier: GPL-2.0-only
> +config HELLO_DRIVER
> + tristate "Hello world driver"
> + help
> + A simple hello world driver that prints a message
> + on load and unload.
> +
> + If unsure, say N.
> +
> config IBM_ASM
> tristate "IBM ASM device"
> diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
> index 1234567..89abcde 100644
> --- a/drivers/misc/Makefile
> +++ b/drivers/misc/Makefile
> @@ -1,3 +1,4 @@
> # SPDX-License-Identifier: GPL-2.0
> +obj-$(CONFIG_HELLO_DRIVER) += hello_driver.o
> obj-$(CONFIG_IBM_ASM) += ibmasm/
> obj-$(CONFIG_AD525X_DPOT) += ad525x_dpot.o
> diff --git a/drivers/misc/hello_driver.c b/drivers/misc/hello_driver.c
> new file mode 100644
> index 0000000..1234567
> --- /dev/null
> +++ b/drivers/misc/hello_driver.c
> @@ -0,0 +1,32 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * hello_driver.c - A simple hello world driver
> + */
> +
> +#include <linux/module.h>
> +#include <linux/kernel.h>
> +#include <linux/init.h>
> +
> +MODULE_LICENSE("GPL");
> +MODULE_AUTHOR("Amir Ali <a.tadayyon12@gmail.com>");
> +MODULE_DESCRIPTION("A simple hello world driver");
> +
> +static int __init hello_init(void)
> +{
> + pr_info("Hello, Linux kernel!\n");
> + return 0;
> +}
> +
> +static void __exit hello_exit(void)
> +{
> + pr_info("Goodbye, Linux kernel!\n");
> +}
> +
> +module_init(hello_init);
> +module_exit(hello_exit);
Did you really mean to send this?
Also, the patch is corrupted and can't be applied :(
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-04 6:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CAPWuoRHO13=CQh7D_+AircPfj=CnmrRiX89Nh_TCUEH=yFkx1A@mail.gmail.com>
2026-10-04 6:25 ` (Subject) [PATCH] misc: add simple hello world driver gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®