* [PATCH] vme: make core vme support explicitly non-modular
@ 2016-07-03 18:05 Paul Gortmaker
2016-07-07 9:51 ` Martyn Welch
0 siblings, 1 reply; 2+ messages in thread
From: Paul Gortmaker @ 2016-07-03 18:05 UTC (permalink / raw)
To: linux-kernel
Cc: Paul Gortmaker, Martyn Welch, Manohar Vanga, Greg Kroah-Hartman,
devel
The Kconfig currently controlling compilation of this code is:
drivers/vme/Kconfig:menuconfig VME_BUS
drivers/vme/Kconfig: bool "VME bridge support"
...meaning that it currently is not being built as a module by anyone.
Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.
We replace module.h and moduleparam.h (unused) with init.h and also
export.h ; the latter since this file does export some syms.
Since this is a struct bus_type and not a platform_driver, we don't
have any ".suppress_bind_attrs" to be concerned about when we
drop the ".remove" code from this file.
Since module_init was not in use by this code, the init ordering
remains unchanged with this commit.
Cc: Martyn Welch <martyn@welchs.me.uk>
Cc: Manohar Vanga <manohar.vanga@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/vme/vme.c | 27 ++-------------------------
1 file changed, 2 insertions(+), 25 deletions(-)
diff --git a/drivers/vme/vme.c b/drivers/vme/vme.c
index 37ac0a58e59a..557149f0f88a 100644
--- a/drivers/vme/vme.c
+++ b/drivers/vme/vme.c
@@ -13,8 +13,8 @@
* option) any later version.
*/
-#include <linux/module.h>
-#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/export.h>
#include <linux/mm.h>
#include <linux/types.h>
#include <linux/kernel.h>
@@ -39,7 +39,6 @@ static unsigned int vme_bus_numbers;
static LIST_HEAD(vme_bus_list);
static DEFINE_MUTEX(vme_buses_lock);
-static void __exit vme_exit(void);
static int __init vme_init(void);
static struct vme_dev *dev_to_vme_dev(struct device *dev)
@@ -1622,25 +1621,10 @@ static int vme_bus_probe(struct device *dev)
return retval;
}
-static int vme_bus_remove(struct device *dev)
-{
- int retval = -ENODEV;
- struct vme_driver *driver;
- struct vme_dev *vdev = dev_to_vme_dev(dev);
-
- driver = dev->platform_data;
-
- if (driver->remove != NULL)
- retval = driver->remove(vdev);
-
- return retval;
-}
-
struct bus_type vme_bus_type = {
.name = "vme",
.match = vme_bus_match,
.probe = vme_bus_probe,
- .remove = vme_bus_remove,
};
EXPORT_SYMBOL(vme_bus_type);
@@ -1648,11 +1632,4 @@ static int __init vme_init(void)
{
return bus_register(&vme_bus_type);
}
-
-static void __exit vme_exit(void)
-{
- bus_unregister(&vme_bus_type);
-}
-
subsys_initcall(vme_init);
-module_exit(vme_exit);
--
2.8.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] vme: make core vme support explicitly non-modular
2016-07-03 18:05 [PATCH] vme: make core vme support explicitly non-modular Paul Gortmaker
@ 2016-07-07 9:51 ` Martyn Welch
0 siblings, 0 replies; 2+ messages in thread
From: Martyn Welch @ 2016-07-07 9:51 UTC (permalink / raw)
To: Paul Gortmaker, linux-kernel
Cc: Martyn Welch, Manohar Vanga, Greg Kroah-Hartman, devel
On 03/07/16 19:05, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
>
> drivers/vme/Kconfig:menuconfig VME_BUS
> drivers/vme/Kconfig: bool "VME bridge support"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
>
> We replace module.h and moduleparam.h (unused) with init.h and also
> export.h ; the latter since this file does export some syms.
>
> Since this is a struct bus_type and not a platform_driver, we don't
> have any ".suppress_bind_attrs" to be concerned about when we
> drop the ".remove" code from this file.
>
> Since module_init was not in use by this code, the init ordering
> remains unchanged with this commit.
>
> Cc: Martyn Welch <martyn@welchs.me.uk>
> Cc: Manohar Vanga <manohar.vanga@gmail.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: devel@driverdev.osuosl.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Martyn Welch <martyn@welchs.me.uk>
> ---
> drivers/vme/vme.c | 27 ++-------------------------
> 1 file changed, 2 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/vme/vme.c b/drivers/vme/vme.c
> index 37ac0a58e59a..557149f0f88a 100644
> --- a/drivers/vme/vme.c
> +++ b/drivers/vme/vme.c
> @@ -13,8 +13,8 @@
> * option) any later version.
> */
>
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
> +#include <linux/init.h>
> +#include <linux/export.h>
> #include <linux/mm.h>
> #include <linux/types.h>
> #include <linux/kernel.h>
> @@ -39,7 +39,6 @@ static unsigned int vme_bus_numbers;
> static LIST_HEAD(vme_bus_list);
> static DEFINE_MUTEX(vme_buses_lock);
>
> -static void __exit vme_exit(void);
> static int __init vme_init(void);
>
> static struct vme_dev *dev_to_vme_dev(struct device *dev)
> @@ -1622,25 +1621,10 @@ static int vme_bus_probe(struct device *dev)
> return retval;
> }
>
> -static int vme_bus_remove(struct device *dev)
> -{
> - int retval = -ENODEV;
> - struct vme_driver *driver;
> - struct vme_dev *vdev = dev_to_vme_dev(dev);
> -
> - driver = dev->platform_data;
> -
> - if (driver->remove != NULL)
> - retval = driver->remove(vdev);
> -
> - return retval;
> -}
> -
> struct bus_type vme_bus_type = {
> .name = "vme",
> .match = vme_bus_match,
> .probe = vme_bus_probe,
> - .remove = vme_bus_remove,
> };
> EXPORT_SYMBOL(vme_bus_type);
>
> @@ -1648,11 +1632,4 @@ static int __init vme_init(void)
> {
> return bus_register(&vme_bus_type);
> }
> -
> -static void __exit vme_exit(void)
> -{
> - bus_unregister(&vme_bus_type);
> -}
> -
> subsys_initcall(vme_init);
> -module_exit(vme_exit);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-07-07 9:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-03 18:05 [PATCH] vme: make core vme support explicitly non-modular Paul Gortmaker
2016-07-07 9:51 ` Martyn Welch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox