public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mfd: ipaq-micro: clean up development cruft
@ 2015-07-22  7:55 Linus Walleij
  2015-07-22  7:55 ` [PATCH 2/3] mfd: ipaq-micro: convert prints to debug prints Linus Walleij
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Linus Walleij @ 2015-07-22  7:55 UTC (permalink / raw)
  To: Samuel Ortiz, Lee Jones, linux-kernel; +Cc: Linus Walleij

Clean out a misspelled "HW" (MW) and remove commented-out
codeline.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mfd/ipaq-micro.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c
index 8df3266064e4..99bc2e844c29 100644
--- a/drivers/mfd/ipaq-micro.c
+++ b/drivers/mfd/ipaq-micro.c
@@ -250,7 +250,7 @@ static void ipaq_micro_eeprom_dump(struct ipaq_micro *micro)
 	ipaq_micro_eeprom_read(micro, 0, 128, dump);
 	str = ipaq_micro_str(dump, 10);
 	if (str) {
-		dev_info(micro->dev, "HM version %s\n", str);
+		dev_info(micro->dev, "HW version %s\n", str);
 		kfree(str);
 	}
 	str = ipaq_micro_str(dump+10, 40);
@@ -474,7 +474,6 @@ static struct platform_driver micro_device_driver = {
 	},
 	.probe    = micro_probe,
 	.remove   = micro_remove,
-	/* .shutdown = micro_suspend, // FIXME */
 };
 module_platform_driver(micro_device_driver);
 
-- 
2.4.3


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

* [PATCH 2/3] mfd: ipaq-micro: convert prints to debug prints
  2015-07-22  7:55 [PATCH 1/3] mfd: ipaq-micro: clean up development cruft Linus Walleij
@ 2015-07-22  7:55 ` Linus Walleij
  2015-07-23 15:41   ` Lee Jones
  2015-07-22  7:55 ` [PATCH 3/3] mfd: ipaq-micro: convert to builtin platform driver Linus Walleij
  2015-07-23 15:41 ` [PATCH 1/3] mfd: ipaq-micro: clean up development cruft Lee Jones
  2 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2015-07-22  7:55 UTC (permalink / raw)
  To: Samuel Ortiz, Lee Jones, linux-kernel; +Cc: Linus Walleij

There is a special function for debug prints rather than the
usual hexdump function, let's use it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mfd/ipaq-micro.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c
index 99bc2e844c29..9bfe2462c5c5 100644
--- a/drivers/mfd/ipaq-micro.c
+++ b/drivers/mfd/ipaq-micro.c
@@ -53,8 +53,8 @@ static void ipaq_micro_trigger_tx(struct ipaq_micro *micro)
 	tx->buf[bp++] = checksum;
 	tx->len = bp;
 	tx->index = 0;
-	print_hex_dump(KERN_DEBUG, "data: ", DUMP_PREFIX_OFFSET, 16, 1,
-		       tx->buf, tx->len, true);
+	print_hex_dump_debug("data: ", DUMP_PREFIX_OFFSET, 16, 1,
+			     tx->buf, tx->len, true);
 
 	/* Enable interrupt */
 	val = readl(micro->base + UTCR3);
@@ -281,8 +281,8 @@ static void ipaq_micro_eeprom_dump(struct ipaq_micro *micro)
 	dev_info(micro->dev, "RAM size: %u KiB\n", ipaq_micro_to_u16(dump+92));
 	dev_info(micro->dev, "screen: %u x %u\n",
 		 ipaq_micro_to_u16(dump+94), ipaq_micro_to_u16(dump+96));
-	print_hex_dump(KERN_DEBUG, "eeprom: ", DUMP_PREFIX_OFFSET, 16, 1,
-		       dump, 256, true);
+	print_hex_dump_debug("eeprom: ", DUMP_PREFIX_OFFSET, 16, 1,
+			     dump, 256, true);
 
 }
 
-- 
2.4.3


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

* [PATCH 3/3] mfd: ipaq-micro: convert to builtin platform driver
  2015-07-22  7:55 [PATCH 1/3] mfd: ipaq-micro: clean up development cruft Linus Walleij
  2015-07-22  7:55 ` [PATCH 2/3] mfd: ipaq-micro: convert prints to debug prints Linus Walleij
@ 2015-07-22  7:55 ` Linus Walleij
  2015-07-23 15:42   ` Lee Jones
  2015-07-23 15:41 ` [PATCH 1/3] mfd: ipaq-micro: clean up development cruft Lee Jones
  2 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2015-07-22  7:55 UTC (permalink / raw)
  To: Samuel Ortiz, Lee Jones, linux-kernel; +Cc: Linus Walleij

Signal that this is a builting driver and call its probe function
immediately on init. Suppress binding attributes and delete the
.remove() function since it is never unloaded. Tag probe() and
functions only called from probe() with __init. Delete all module
macros since this is a pure builtin.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mfd/ipaq-micro.c | 27 ++++-----------------------
 1 file changed, 4 insertions(+), 23 deletions(-)

diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c
index 9bfe2462c5c5..a41859c55bda 100644
--- a/drivers/mfd/ipaq-micro.c
+++ b/drivers/mfd/ipaq-micro.c
@@ -242,7 +242,7 @@ static u16 ipaq_micro_to_u16(u8 *data)
 	return data[1] << 8 | data[0];
 }
 
-static void ipaq_micro_eeprom_dump(struct ipaq_micro *micro)
+static void __init ipaq_micro_eeprom_dump(struct ipaq_micro *micro)
 {
 	u8 dump[256];
 	char *str;
@@ -386,7 +386,7 @@ static int micro_resume(struct device *dev)
 	return 0;
 }
 
-static int micro_probe(struct platform_device *pdev)
+static int __init micro_probe(struct platform_device *pdev)
 {
 	struct ipaq_micro *micro;
 	struct resource *res;
@@ -448,21 +448,6 @@ static int micro_probe(struct platform_device *pdev)
 	return 0;
 }
 
-static int micro_remove(struct platform_device *pdev)
-{
-	struct ipaq_micro *micro = platform_get_drvdata(pdev);
-	u32 val;
-
-	mfd_remove_devices(&pdev->dev);
-
-	val = readl(micro->base + UTCR3);
-	val &= ~(UTCR3_RXE | UTCR3_RIE); /* disable receive interrupt */
-	val &= ~(UTCR3_TXE | UTCR3_TIE); /* disable transmit interrupt */
-	writel(val, micro->base + UTCR3);
-
-	return 0;
-}
-
 static const struct dev_pm_ops micro_dev_pm_ops = {
 	SET_SYSTEM_SLEEP_PM_OPS(NULL, micro_resume)
 };
@@ -471,11 +456,7 @@ static struct platform_driver micro_device_driver = {
 	.driver   = {
 		.name	= "ipaq-h3xxx-micro",
 		.pm	= &micro_dev_pm_ops,
+		.suppress_bind_attrs = true,
 	},
-	.probe    = micro_probe,
-	.remove   = micro_remove,
 };
-module_platform_driver(micro_device_driver);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("driver for iPAQ Atmel micro core and backlight");
+builtin_platform_driver_probe(micro_device_driver, micro_probe);
-- 
2.4.3


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

* Re: [PATCH 1/3] mfd: ipaq-micro: clean up development cruft
  2015-07-22  7:55 [PATCH 1/3] mfd: ipaq-micro: clean up development cruft Linus Walleij
  2015-07-22  7:55 ` [PATCH 2/3] mfd: ipaq-micro: convert prints to debug prints Linus Walleij
  2015-07-22  7:55 ` [PATCH 3/3] mfd: ipaq-micro: convert to builtin platform driver Linus Walleij
@ 2015-07-23 15:41 ` Lee Jones
  2 siblings, 0 replies; 6+ messages in thread
From: Lee Jones @ 2015-07-23 15:41 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Samuel Ortiz, linux-kernel

On Wed, 22 Jul 2015, Linus Walleij wrote:

> Clean out a misspelled "HW" (MW) and remove commented-out
> codeline.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/mfd/ipaq-micro.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c
> index 8df3266064e4..99bc2e844c29 100644
> --- a/drivers/mfd/ipaq-micro.c
> +++ b/drivers/mfd/ipaq-micro.c
> @@ -250,7 +250,7 @@ static void ipaq_micro_eeprom_dump(struct ipaq_micro *micro)
>  	ipaq_micro_eeprom_read(micro, 0, 128, dump);
>  	str = ipaq_micro_str(dump, 10);
>  	if (str) {
> -		dev_info(micro->dev, "HM version %s\n", str);
> +		dev_info(micro->dev, "HW version %s\n", str);
>  		kfree(str);
>  	}
>  	str = ipaq_micro_str(dump+10, 40);
> @@ -474,7 +474,6 @@ static struct platform_driver micro_device_driver = {
>  	},
>  	.probe    = micro_probe,
>  	.remove   = micro_remove,
> -	/* .shutdown = micro_suspend, // FIXME */
>  };
>  module_platform_driver(micro_device_driver);
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 2/3] mfd: ipaq-micro: convert prints to debug prints
  2015-07-22  7:55 ` [PATCH 2/3] mfd: ipaq-micro: convert prints to debug prints Linus Walleij
@ 2015-07-23 15:41   ` Lee Jones
  0 siblings, 0 replies; 6+ messages in thread
From: Lee Jones @ 2015-07-23 15:41 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Samuel Ortiz, linux-kernel

On Wed, 22 Jul 2015, Linus Walleij wrote:

> There is a special function for debug prints rather than the
> usual hexdump function, let's use it.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/mfd/ipaq-micro.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c
> index 99bc2e844c29..9bfe2462c5c5 100644
> --- a/drivers/mfd/ipaq-micro.c
> +++ b/drivers/mfd/ipaq-micro.c
> @@ -53,8 +53,8 @@ static void ipaq_micro_trigger_tx(struct ipaq_micro *micro)
>  	tx->buf[bp++] = checksum;
>  	tx->len = bp;
>  	tx->index = 0;
> -	print_hex_dump(KERN_DEBUG, "data: ", DUMP_PREFIX_OFFSET, 16, 1,
> -		       tx->buf, tx->len, true);
> +	print_hex_dump_debug("data: ", DUMP_PREFIX_OFFSET, 16, 1,
> +			     tx->buf, tx->len, true);
>  
>  	/* Enable interrupt */
>  	val = readl(micro->base + UTCR3);
> @@ -281,8 +281,8 @@ static void ipaq_micro_eeprom_dump(struct ipaq_micro *micro)
>  	dev_info(micro->dev, "RAM size: %u KiB\n", ipaq_micro_to_u16(dump+92));
>  	dev_info(micro->dev, "screen: %u x %u\n",
>  		 ipaq_micro_to_u16(dump+94), ipaq_micro_to_u16(dump+96));
> -	print_hex_dump(KERN_DEBUG, "eeprom: ", DUMP_PREFIX_OFFSET, 16, 1,
> -		       dump, 256, true);
> +	print_hex_dump_debug("eeprom: ", DUMP_PREFIX_OFFSET, 16, 1,
> +			     dump, 256, true);
>  
>  }
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 3/3] mfd: ipaq-micro: convert to builtin platform driver
  2015-07-22  7:55 ` [PATCH 3/3] mfd: ipaq-micro: convert to builtin platform driver Linus Walleij
@ 2015-07-23 15:42   ` Lee Jones
  0 siblings, 0 replies; 6+ messages in thread
From: Lee Jones @ 2015-07-23 15:42 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Samuel Ortiz, linux-kernel

On Wed, 22 Jul 2015, Linus Walleij wrote:

> Signal that this is a builting driver and call its probe function
> immediately on init. Suppress binding attributes and delete the
> .remove() function since it is never unloaded. Tag probe() and
> functions only called from probe() with __init. Delete all module
> macros since this is a pure builtin.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/mfd/ipaq-micro.c | 27 ++++-----------------------
>  1 file changed, 4 insertions(+), 23 deletions(-)

Fixed up the typo in the commit log and applied, thanks.

> diff --git a/drivers/mfd/ipaq-micro.c b/drivers/mfd/ipaq-micro.c
> index 9bfe2462c5c5..a41859c55bda 100644
> --- a/drivers/mfd/ipaq-micro.c
> +++ b/drivers/mfd/ipaq-micro.c
> @@ -242,7 +242,7 @@ static u16 ipaq_micro_to_u16(u8 *data)
>  	return data[1] << 8 | data[0];
>  }
>  
> -static void ipaq_micro_eeprom_dump(struct ipaq_micro *micro)
> +static void __init ipaq_micro_eeprom_dump(struct ipaq_micro *micro)
>  {
>  	u8 dump[256];
>  	char *str;
> @@ -386,7 +386,7 @@ static int micro_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static int micro_probe(struct platform_device *pdev)
> +static int __init micro_probe(struct platform_device *pdev)
>  {
>  	struct ipaq_micro *micro;
>  	struct resource *res;
> @@ -448,21 +448,6 @@ static int micro_probe(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int micro_remove(struct platform_device *pdev)
> -{
> -	struct ipaq_micro *micro = platform_get_drvdata(pdev);
> -	u32 val;
> -
> -	mfd_remove_devices(&pdev->dev);
> -
> -	val = readl(micro->base + UTCR3);
> -	val &= ~(UTCR3_RXE | UTCR3_RIE); /* disable receive interrupt */
> -	val &= ~(UTCR3_TXE | UTCR3_TIE); /* disable transmit interrupt */
> -	writel(val, micro->base + UTCR3);
> -
> -	return 0;
> -}
> -
>  static const struct dev_pm_ops micro_dev_pm_ops = {
>  	SET_SYSTEM_SLEEP_PM_OPS(NULL, micro_resume)
>  };
> @@ -471,11 +456,7 @@ static struct platform_driver micro_device_driver = {
>  	.driver   = {
>  		.name	= "ipaq-h3xxx-micro",
>  		.pm	= &micro_dev_pm_ops,
> +		.suppress_bind_attrs = true,
>  	},
> -	.probe    = micro_probe,
> -	.remove   = micro_remove,
>  };
> -module_platform_driver(micro_device_driver);
> -
> -MODULE_LICENSE("GPL");
> -MODULE_DESCRIPTION("driver for iPAQ Atmel micro core and backlight");
> +builtin_platform_driver_probe(micro_device_driver, micro_probe);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2015-07-23 15:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-22  7:55 [PATCH 1/3] mfd: ipaq-micro: clean up development cruft Linus Walleij
2015-07-22  7:55 ` [PATCH 2/3] mfd: ipaq-micro: convert prints to debug prints Linus Walleij
2015-07-23 15:41   ` Lee Jones
2015-07-22  7:55 ` [PATCH 3/3] mfd: ipaq-micro: convert to builtin platform driver Linus Walleij
2015-07-23 15:42   ` Lee Jones
2015-07-23 15:41 ` [PATCH 1/3] mfd: ipaq-micro: clean up development cruft Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox