linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] rtc: jz4740: remove unused EXPORT_SYMBOL
@ 2016-11-09  0:37 Alexandre Belloni
  2016-11-09  0:37 ` [PATCH 2/2] rtc: jz4740: make the driver builtin only Alexandre Belloni
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Belloni @ 2016-11-09  0:37 UTC (permalink / raw)
  To: Alessandro Zummo
  Cc: Paul Cercueil, rtc-linux, linux-kernel, Alexandre Belloni

jz4740_rtc_poweroff() is only called from the driver, stop exporting it.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 drivers/rtc/rtc-jz4740.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c
index 33ccd73ee947..18feae6c4e95 100644
--- a/drivers/rtc/rtc-jz4740.c
+++ b/drivers/rtc/rtc-jz4740.c
@@ -252,12 +252,11 @@ static irqreturn_t jz4740_rtc_irq(int irq, void *data)
 	return IRQ_HANDLED;
 }
 
-void jz4740_rtc_poweroff(struct device *dev)
+static void jz4740_rtc_poweroff(struct device *dev)
 {
 	struct jz4740_rtc *rtc = dev_get_drvdata(dev);
 	jz4740_rtc_reg_write(rtc, JZ_REG_RTC_HIBERNATE, 1);
 }
-EXPORT_SYMBOL_GPL(jz4740_rtc_poweroff);
 
 static void jz4740_rtc_power_off(void)
 {
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] rtc: jz4740: make the driver builtin only
  2016-11-09  0:37 [PATCH 1/2] rtc: jz4740: remove unused EXPORT_SYMBOL Alexandre Belloni
@ 2016-11-09  0:37 ` Alexandre Belloni
  2016-12-19  8:03   ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Belloni @ 2016-11-09  0:37 UTC (permalink / raw)
  To: Alessandro Zummo
  Cc: Paul Cercueil, rtc-linux, linux-kernel, Alexandre Belloni

Since the driver is now calling machine_halt() that is not exported, it has
to be built in the kernel. Building it as a module will fail at linking
time.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 drivers/rtc/Kconfig      |  5 +----
 drivers/rtc/rtc-jz4740.c | 10 +---------
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 4259ce61c31b..24b0778f6e28 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -1550,15 +1550,12 @@ config RTC_DRV_MPC5121
 	  will be called rtc-mpc5121.
 
 config RTC_DRV_JZ4740
-	tristate "Ingenic JZ4740 SoC"
+	bool "Ingenic JZ4740 SoC"
 	depends on MACH_INGENIC || COMPILE_TEST
 	help
 	  If you say yes here you get support for the Ingenic JZ47xx SoCs RTC
 	  controllers.
 
-	  This driver can also be buillt as a module. If so, the module
-	  will be called rtc-jz4740.
-
 config RTC_DRV_LPC24XX
 	tristate "NXP RTC for LPC178x/18xx/408x/43xx"
 	depends on ARCH_LPC18XX || COMPILE_TEST
diff --git a/drivers/rtc/rtc-jz4740.c b/drivers/rtc/rtc-jz4740.c
index 18feae6c4e95..72918c1ba092 100644
--- a/drivers/rtc/rtc-jz4740.c
+++ b/drivers/rtc/rtc-jz4740.c
@@ -17,7 +17,6 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/reboot.h>
@@ -303,7 +302,6 @@ static const struct of_device_id jz4740_rtc_of_match[] = {
 	{ .compatible = "ingenic,jz4780-rtc", .data = (void *)ID_JZ4780 },
 	{},
 };
-MODULE_DEVICE_TABLE(of, jz4740_rtc_of_match);
 
 static int jz4740_rtc_probe(struct platform_device *pdev)
 {
@@ -431,7 +429,6 @@ static const struct platform_device_id jz4740_rtc_ids[] = {
 	{ "jz4780-rtc", ID_JZ4780 },
 	{}
 };
-MODULE_DEVICE_TABLE(platform, jz4740_rtc_ids);
 
 static struct platform_driver jz4740_rtc_driver = {
 	.probe	 = jz4740_rtc_probe,
@@ -443,9 +440,4 @@ static struct platform_driver jz4740_rtc_driver = {
 	.id_table = jz4740_rtc_ids,
 };
 
-module_platform_driver(jz4740_rtc_driver);
-
-MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("RTC driver for the JZ4740 SoC\n");
-MODULE_ALIAS("platform:jz4740-rtc");
+builtin_platform_driver(jz4740_rtc_driver);
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] rtc: jz4740: make the driver builtin only
  2016-11-09  0:37 ` [PATCH 2/2] rtc: jz4740: make the driver builtin only Alexandre Belloni
@ 2016-12-19  8:03   ` Geert Uytterhoeven
  2016-12-19  9:47     ` Alexandre Belloni
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2016-12-19  8:03 UTC (permalink / raw)
  To: Alexandre Belloni; +Cc: Alessandro Zummo, Paul Cercueil, RTCLINUX, linux-kernel

Hi Alexandre,

On Wed, Nov 9, 2016 at 1:37 AM, Alexandre Belloni
<alexandre.belloni@free-electrons.com> wrote:
> Since the driver is now calling machine_halt() that is not exported, it has
> to be built in the kernel. Building it as a module will fail at linking
> time.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  drivers/rtc/Kconfig      |  5 +----
>  drivers/rtc/rtc-jz4740.c | 10 +---------
>  2 files changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> index 4259ce61c31b..24b0778f6e28 100644
> --- a/drivers/rtc/Kconfig
> +++ b/drivers/rtc/Kconfig
> @@ -1550,15 +1550,12 @@ config RTC_DRV_MPC5121
>           will be called rtc-mpc5121.
>
>  config RTC_DRV_JZ4740
> -       tristate "Ingenic JZ4740 SoC"
> +       bool "Ingenic JZ4740 SoC"

Just noticed RTC_DRV_JZ4740 flipped from m to y.

This is bad for distribution kernels.
Can't the driver just call kernel_halt() instead of machine_halt()?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] rtc: jz4740: make the driver builtin only
  2016-12-19  8:03   ` Geert Uytterhoeven
@ 2016-12-19  9:47     ` Alexandre Belloni
  0 siblings, 0 replies; 4+ messages in thread
From: Alexandre Belloni @ 2016-12-19  9:47 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Alessandro Zummo, Paul Cercueil, RTCLINUX, linux-kernel

Hi,

On 19/12/2016 at 09:03:17 +0100, Geert Uytterhoeven wrote :
> On Wed, Nov 9, 2016 at 1:37 AM, Alexandre Belloni
> <alexandre.belloni@free-electrons.com> wrote:
> > Since the driver is now calling machine_halt() that is not exported, it has
> > to be built in the kernel. Building it as a module will fail at linking
> > time.
> >
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> > ---
> >  drivers/rtc/Kconfig      |  5 +----
> >  drivers/rtc/rtc-jz4740.c | 10 +---------
> >  2 files changed, 2 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
> > index 4259ce61c31b..24b0778f6e28 100644
> > --- a/drivers/rtc/Kconfig
> > +++ b/drivers/rtc/Kconfig
> > @@ -1550,15 +1550,12 @@ config RTC_DRV_MPC5121
> >           will be called rtc-mpc5121.
> >
> >  config RTC_DRV_JZ4740
> > -       tristate "Ingenic JZ4740 SoC"
> > +       bool "Ingenic JZ4740 SoC"
> 
> Just noticed RTC_DRV_JZ4740 flipped from m to y.
> 
> This is bad for distribution kernels.
> Can't the driver just call kernel_halt() instead of machine_halt()?
> 

I'm not sure and I can't test. Paul, can you test?

Maybe the other concern is that users that are not loading the rtc
module will probably complain their machine is not powering off.


-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-12-19  9:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-09  0:37 [PATCH 1/2] rtc: jz4740: remove unused EXPORT_SYMBOL Alexandre Belloni
2016-11-09  0:37 ` [PATCH 2/2] rtc: jz4740: make the driver builtin only Alexandre Belloni
2016-12-19  8:03   ` Geert Uytterhoeven
2016-12-19  9:47     ` Alexandre Belloni

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).