From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Lars-Peter Clausen <lars@metafoo.de>,
Nuno Sa <nuno.sa@analog.com>
Subject: Re: [PATCH v2 7/8] iio: core: Move initcalls closer to the respective calls
Date: Sun, 23 Jul 2023 10:23:35 +0100 [thread overview]
Message-ID: <20230723102335.6df07e6d@jic23-huawei> (raw)
In-Reply-To: <20230721170022.3461-8-andriy.shevchenko@linux.intel.com>
On Fri, 21 Jul 2023 20:00:21 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> Move subsys_initcall() and module_exit() closer to the respective calls.
Why? For this particular set of macros I can see advantages to them being
near the code and to them being in a fairly predictable location (end of
file).
I think the patch description should make the why argument.
Jonathan
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Nuno Sa <nuno.sa@analog.com>
> ---
> drivers/iio/industrialio-core.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
> index a9b9804097ab..5c9c68d69fc6 100644
> --- a/drivers/iio/industrialio-core.c
> +++ b/drivers/iio/industrialio-core.c
> @@ -354,6 +354,7 @@ static int __init iio_init(void)
> error_nothing:
> return ret;
> }
> +subsys_initcall(iio_init);
>
> static void __exit iio_exit(void)
> {
> @@ -362,6 +363,7 @@ static void __exit iio_exit(void)
> bus_unregister(&iio_bus_type);
> debugfs_remove(iio_debugfs_dentry);
> }
> +module_exit(iio_exit);
>
> #if defined(CONFIG_DEBUG_FS)
> static ssize_t iio_debugfs_read_reg(struct file *file, char __user *userbuf,
> @@ -2118,9 +2120,6 @@ int iio_device_get_current_mode(struct iio_dev *indio_dev)
> }
> EXPORT_SYMBOL_GPL(iio_device_get_current_mode);
>
> -subsys_initcall(iio_init);
> -module_exit(iio_exit);
> -
> MODULE_AUTHOR("Jonathan Cameron <jic23@kernel.org>");
> MODULE_DESCRIPTION("Industrial I/O core");
> MODULE_LICENSE("GPL");
next prev parent reply other threads:[~2023-07-23 9:23 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-21 17:00 [PATCH v2 0/8] iio: core: A few code cleanups and documentation fixes Andy Shevchenko
2023-07-21 17:00 ` [PATCH v2 1/8] iio: core: Add opaque_struct_size() helper and use it Andy Shevchenko
2023-07-21 17:22 ` Andy Shevchenko
2023-07-21 17:25 ` Andy Shevchenko
2023-07-21 17:27 ` Andy Shevchenko
2023-07-21 18:12 ` Uwe Kleine-König
2023-07-21 17:00 ` [PATCH v2 2/8] iio: core: Use sysfs_match_string() helper Andy Shevchenko
2023-07-22 17:11 ` Jonathan Cameron
2023-07-21 17:00 ` [PATCH v2 3/8] iio: core: Switch to krealloc_array() Andy Shevchenko
2023-07-22 17:28 ` Jonathan Cameron
2023-07-24 10:37 ` Andy Shevchenko
2023-07-21 17:00 ` [PATCH v2 4/8] iio: core: Use min() instead of min_t() to make code more robust Andy Shevchenko
2023-07-23 9:14 ` Jonathan Cameron
2023-07-21 17:00 ` [PATCH v2 5/8] iio: core: Get rid of redundant 'else' Andy Shevchenko
2023-07-23 9:16 ` Jonathan Cameron
2023-07-21 17:00 ` [PATCH v2 6/8] iio: core: Fix issues and style of the comments Andy Shevchenko
2023-07-21 20:48 ` Randy Dunlap
2023-07-21 21:37 ` andy.shevchenko
2023-07-23 9:21 ` Jonathan Cameron
2023-07-21 17:00 ` [PATCH v2 7/8] iio: core: Move initcalls closer to the respective calls Andy Shevchenko
2023-07-23 9:23 ` Jonathan Cameron [this message]
2023-07-24 10:53 ` Andy Shevchenko
2023-07-21 17:00 ` [PATCH v2 8/8] iio: core: Improve indentation in a few places Andy Shevchenko
2023-07-23 9:24 ` Jonathan Cameron
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=20230723102335.6df07e6d@jic23-huawei \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.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