linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: samsung: Remove checks for CONFIG_SAMSUNG_CLOCK
@ 2014-10-06 10:07 Paul Bolle
  2014-11-03 11:55 ` Paul Bolle
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Bolle @ 2014-10-06 10:07 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: Valentin Rothberg, linux-serial, linux-kernel

Commit 32726d2d5502 ("ARM: SAMSUNG: Remove legacy clock code") removed
the Kconfig symbol SAMSUNG_CLOCK. Remove the last checks for its macro,
and the dead code they hide, too.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
This trivial fix has been discussed for some time now in the thread
starting at http://lkml.kernel.org/r/1405502840.4408.2.camel@x220 It
seems it's time to submit it.

Build tested on top of next-20141003, on x86_64 (!), with these horrific
commands:
    make EXTRA_CFLAGS=-DCONFIG_SERIAL_SAMSUNG_UARTS=3 drivers/tty/serial/samsung.o
    make EXTRA_CFLAGS=-DCONFIG_SERIAL_SAMSUNG_UARTS=4 drivers/tty/serial/samsung.o

Please note that
    make EXTRA_CFLAGS=-DCONFIG_SERIAL_SAMSUNG_UARTS=0 drivers/tty/serial/samsung.o

doesn't build. Perhaps some "range" should be added to config
SERIAL_SAMSUNG_UARTS. And I also wonder whether SERIAL_SAMSUNG_UARTS
should be a dependency (somehow) of config SERIAL_SAMSUNG. I have not
looked into those questions.

 drivers/tty/serial/samsung.c | 27 ---------------------------
 1 file changed, 27 deletions(-)

diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index c78f43a481ce..796c04c77dc1 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1226,24 +1226,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
 	return 0;
 }
 
-#ifdef CONFIG_SAMSUNG_CLOCK
-static ssize_t s3c24xx_serial_show_clksrc(struct device *dev,
-					  struct device_attribute *attr,
-					  char *buf)
-{
-	struct uart_port *port = s3c24xx_dev_to_port(dev);
-	struct s3c24xx_uart_port *ourport = to_ourport(port);
-
-	if (IS_ERR(ourport->baudclk))
-		return -EINVAL;
-
-	return snprintf(buf, PAGE_SIZE, "* %s\n",
-			ourport->baudclk->name ?: "(null)");
-}
-
-static DEVICE_ATTR(clock_source, S_IRUGO, s3c24xx_serial_show_clksrc, NULL);
-#endif
-
 /* Device driver serial port probe */
 
 static const struct of_device_id s3c24xx_uart_dt_match[];
@@ -1329,12 +1311,6 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
 	 */
 	clk_disable_unprepare(ourport->clk);
 
-#ifdef CONFIG_SAMSUNG_CLOCK
-	ret = device_create_file(&pdev->dev, &dev_attr_clock_source);
-	if (ret < 0)
-		dev_err(&pdev->dev, "failed to add clock source attr.\n");
-#endif
-
 	ret = s3c24xx_serial_cpufreq_register(ourport);
 	if (ret < 0)
 		dev_err(&pdev->dev, "failed to add cpufreq notifier\n");
@@ -1348,9 +1324,6 @@ static int s3c24xx_serial_remove(struct platform_device *dev)
 
 	if (port) {
 		s3c24xx_serial_cpufreq_deregister(to_ourport(port));
-#ifdef CONFIG_SAMSUNG_CLOCK
-		device_remove_file(&dev->dev, &dev_attr_clock_source);
-#endif
 		uart_remove_one_port(&s3c24xx_uart_drv, port);
 	}
 
-- 
1.9.3


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

* Re: [PATCH] serial: samsung: Remove checks for CONFIG_SAMSUNG_CLOCK
  2014-10-06 10:07 [PATCH] serial: samsung: Remove checks for CONFIG_SAMSUNG_CLOCK Paul Bolle
@ 2014-11-03 11:55 ` Paul Bolle
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Bolle @ 2014-11-03 11:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: Valentin Rothberg, linux-serial, linux-kernel

Hi Greg, Hi Jiri,

On Mon, 2014-10-06 at 12:07 +0200, Paul Bolle wrote:
> Commit 32726d2d5502 ("ARM: SAMSUNG: Remove legacy clock code") removed
> the Kconfig symbol SAMSUNG_CLOCK. Remove the last checks for its macro,
> and the dead code they hide, too.
> 
> Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
> ---
> This trivial fix has been discussed for some time now in the thread
> starting at http://lkml.kernel.org/r/1405502840.4408.2.camel@x220 It
> seems it's time to submit it.
> 
> Build tested on top of next-20141003, on x86_64 (!), with these horrific
> commands:
>     make EXTRA_CFLAGS=-DCONFIG_SERIAL_SAMSUNG_UARTS=3 drivers/tty/serial/samsung.o
>     make EXTRA_CFLAGS=-DCONFIG_SERIAL_SAMSUNG_UARTS=4 drivers/tty/serial/samsung.o
> 
> Please note that
>     make EXTRA_CFLAGS=-DCONFIG_SERIAL_SAMSUNG_UARTS=0 drivers/tty/serial/samsung.o
> 
> doesn't build. Perhaps some "range" should be added to config
> SERIAL_SAMSUNG_UARTS. And I also wonder whether SERIAL_SAMSUNG_UARTS
> should be a dependency (somehow) of config SERIAL_SAMSUNG. I have not
> looked into those questions.

I noticed this still applies on top of next-20141103. Have you had time
to look at this yet?

>  drivers/tty/serial/samsung.c | 27 ---------------------------
>  1 file changed, 27 deletions(-)
> 
> diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
> index c78f43a481ce..796c04c77dc1 100644
> --- a/drivers/tty/serial/samsung.c
> +++ b/drivers/tty/serial/samsung.c
> @@ -1226,24 +1226,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
>  	return 0;
>  }
>  
> -#ifdef CONFIG_SAMSUNG_CLOCK
> -static ssize_t s3c24xx_serial_show_clksrc(struct device *dev,
> -					  struct device_attribute *attr,
> -					  char *buf)
> -{
> -	struct uart_port *port = s3c24xx_dev_to_port(dev);
> -	struct s3c24xx_uart_port *ourport = to_ourport(port);
> -
> -	if (IS_ERR(ourport->baudclk))
> -		return -EINVAL;
> -
> -	return snprintf(buf, PAGE_SIZE, "* %s\n",
> -			ourport->baudclk->name ?: "(null)");
> -}
> -
> -static DEVICE_ATTR(clock_source, S_IRUGO, s3c24xx_serial_show_clksrc, NULL);
> -#endif
> -
>  /* Device driver serial port probe */
>  
>  static const struct of_device_id s3c24xx_uart_dt_match[];
> @@ -1329,12 +1311,6 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
>  	 */
>  	clk_disable_unprepare(ourport->clk);
>  
> -#ifdef CONFIG_SAMSUNG_CLOCK
> -	ret = device_create_file(&pdev->dev, &dev_attr_clock_source);
> -	if (ret < 0)
> -		dev_err(&pdev->dev, "failed to add clock source attr.\n");
> -#endif
> -
>  	ret = s3c24xx_serial_cpufreq_register(ourport);
>  	if (ret < 0)
>  		dev_err(&pdev->dev, "failed to add cpufreq notifier\n");
> @@ -1348,9 +1324,6 @@ static int s3c24xx_serial_remove(struct platform_device *dev)
>  
>  	if (port) {
>  		s3c24xx_serial_cpufreq_deregister(to_ourport(port));
> -#ifdef CONFIG_SAMSUNG_CLOCK
> -		device_remove_file(&dev->dev, &dev_attr_clock_source);
> -#endif
>  		uart_remove_one_port(&s3c24xx_uart_drv, port);
>  	}
>  


Paul Bolle


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

end of thread, other threads:[~2014-11-03 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-06 10:07 [PATCH] serial: samsung: Remove checks for CONFIG_SAMSUNG_CLOCK Paul Bolle
2014-11-03 11:55 ` Paul Bolle

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