All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build
@ 2016-07-09  5:31 Axel Lin
  2016-07-09  5:32 ` [RESEND][PATCH 2/2] i2c: versatile: Convert to use resource managed devm_* APIs Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Axel Lin @ 2016-07-09  5:31 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Lorenzo Pieralisi, Liviu Dudau, Sudeep Holla, Pawel Moll, linux-i2c

There is no build dependency for this driver, so enable COMPILE_TEST to get
better build coverage.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Resend with CC VE maintainers.
 drivers/i2c/busses/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index faa8e68..6e0bba0 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -924,7 +924,7 @@ config I2C_UNIPHIER_F
 
 config I2C_VERSATILE
 	tristate "ARM Versatile/Realview I2C bus support"
-	depends on ARCH_VERSATILE || ARCH_REALVIEW || ARCH_VEXPRESS
+	depends on ARCH_VERSATILE || ARCH_REALVIEW || ARCH_VEXPRESS || COMPILE_TEST
 	select I2C_ALGOBIT
 	help
 	  Say yes if you want to support the I2C serial bus on ARMs Versatile
-- 
2.5.0

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

* [RESEND][PATCH 2/2] i2c: versatile: Convert to use resource managed devm_* APIs
  2016-07-09  5:31 [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build Axel Lin
@ 2016-07-09  5:32 ` Axel Lin
  2016-07-14 12:23   ` Wolfram Sang
  2016-07-11  8:44 ` [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build Liviu Dudau
  2016-07-14 12:23 ` Wolfram Sang
  2 siblings, 1 reply; 8+ messages in thread
From: Axel Lin @ 2016-07-09  5:32 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Lorenzo Pieralisi, Liviu Dudau, Sudeep Holla, Pawel Moll, linux-i2c

Use devm_* APIs to simplify the code a bit.
This patch also fixes the memory leak when unload the module.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Resend with CC VE maintainers.
 drivers/i2c/busses/i2c-versatile.c | 46 +++++++++++---------------------------
 1 file changed, 13 insertions(+), 33 deletions(-)

diff --git a/drivers/i2c/busses/i2c-versatile.c b/drivers/i2c/busses/i2c-versatile.c
index 240637f..c73d2d2 100644
--- a/drivers/i2c/busses/i2c-versatile.c
+++ b/drivers/i2c/busses/i2c-versatile.c
@@ -70,28 +70,14 @@ static int i2c_versatile_probe(struct platform_device *dev)
 	struct resource *r;
 	int ret;
 
+	i2c = devm_kzalloc(&dev->dev, sizeof(struct i2c_versatile), GFP_KERNEL);
+	if (!i2c)
+		return -ENOMEM;
+
 	r = platform_get_resource(dev, IORESOURCE_MEM, 0);
-	if (!r) {
-		ret = -EINVAL;
-		goto err_out;
-	}
-
-	if (!request_mem_region(r->start, resource_size(r), "versatile-i2c")) {
-		ret = -EBUSY;
-		goto err_out;
-	}
-
-	i2c = kzalloc(sizeof(struct i2c_versatile), GFP_KERNEL);
-	if (!i2c) {
-		ret = -ENOMEM;
-		goto err_release;
-	}
-
-	i2c->base = ioremap(r->start, resource_size(r));
-	if (!i2c->base) {
-		ret = -ENOMEM;
-		goto err_free;
-	}
+	i2c->base = devm_ioremap_resource(&dev->dev, r);
+	if (IS_ERR(i2c->base))
+		return PTR_ERR(i2c->base);
 
 	writel(SCL | SDA, i2c->base + I2C_CONTROLS);
 
@@ -105,18 +91,12 @@ static int i2c_versatile_probe(struct platform_device *dev)
 
 	i2c->adap.nr = dev->id;
 	ret = i2c_bit_add_numbered_bus(&i2c->adap);
-	if (ret >= 0) {
-		platform_set_drvdata(dev, i2c);
-		return 0;
-	}
-
-	iounmap(i2c->base);
- err_free:
-	kfree(i2c);
- err_release:
-	release_mem_region(r->start, resource_size(r));
- err_out:
-	return ret;
+	if (ret < 0)
+		return ret;
+
+	platform_set_drvdata(dev, i2c);
+
+	return 0;
 }
 
 static int i2c_versatile_remove(struct platform_device *dev)
-- 
2.5.0

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

* Re: [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build
  2016-07-09  5:31 [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build Axel Lin
  2016-07-09  5:32 ` [RESEND][PATCH 2/2] i2c: versatile: Convert to use resource managed devm_* APIs Axel Lin
@ 2016-07-11  8:44 ` Liviu Dudau
  2016-07-14 10:51   ` Sudeep Holla
  2016-07-14 12:23 ` Wolfram Sang
  2 siblings, 1 reply; 8+ messages in thread
From: Liviu Dudau @ 2016-07-11  8:44 UTC (permalink / raw)
  To: Axel Lin
  Cc: Wolfram Sang, Lorenzo Pieralisi, Sudeep Holla, Pawel Moll, linux-i2c

On Sat, Jul 09, 2016 at 01:31:23PM +0800, Axel Lin wrote:
> There is no build dependency for this driver, so enable COMPILE_TEST to get
> better build coverage.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

For the whole series:

Tested-and-acked-by: Liviu Dudau <Liviu.Dudau@arm.com>

Thanks,
Liviu

> ---
> Resend with CC VE maintainers.
>  drivers/i2c/busses/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
> index faa8e68..6e0bba0 100644
> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -924,7 +924,7 @@ config I2C_UNIPHIER_F
>  
>  config I2C_VERSATILE
>  	tristate "ARM Versatile/Realview I2C bus support"
> -	depends on ARCH_VERSATILE || ARCH_REALVIEW || ARCH_VEXPRESS
> +	depends on ARCH_VERSATILE || ARCH_REALVIEW || ARCH_VEXPRESS || COMPILE_TEST
>  	select I2C_ALGOBIT
>  	help
>  	  Say yes if you want to support the I2C serial bus on ARMs Versatile
> -- 
> 2.5.0
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

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

* Re: [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build
  2016-07-11  8:44 ` [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build Liviu Dudau
@ 2016-07-14 10:51   ` Sudeep Holla
  2016-07-14 12:08     ` Wolfram Sang
  0 siblings, 1 reply; 8+ messages in thread
From: Sudeep Holla @ 2016-07-14 10:51 UTC (permalink / raw)
  To: Liviu Dudau, Axel Lin
  Cc: Sudeep Holla, Wolfram Sang, Lorenzo Pieralisi, Pawel Moll, linux-i2c



On 11/07/16 09:44, Liviu Dudau wrote:
> On Sat, Jul 09, 2016 at 01:31:23PM +0800, Axel Lin wrote:
>> There is no build dependency for this driver, so enable COMPILE_TEST to get
>> better build coverage.
>>
>> Signed-off-by: Axel Lin <axel.lin@ingics.com>
>
> For the whole series:
>
> Tested-and-acked-by: Liviu Dudau <Liviu.Dudau@arm.com>

Thanks Liviu for testing them. Since these are cleanup patches, they
need to wait for v4.9, PR for v4.8 already sent and pulled.

-- 
Regards,
Sudeep

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

* Re: [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build
  2016-07-14 10:51   ` Sudeep Holla
@ 2016-07-14 12:08     ` Wolfram Sang
  2016-07-14 12:33       ` Sudeep Holla
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfram Sang @ 2016-07-14 12:08 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Liviu Dudau, Axel Lin, Lorenzo Pieralisi, Pawel Moll, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]


> Thanks Liviu for testing them. Since these are cleanup patches, they
> need to wait for v4.9, PR for v4.8 already sent and pulled.

I'd think they should go via my I2C tree anyhow.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build
  2016-07-09  5:31 [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build Axel Lin
  2016-07-09  5:32 ` [RESEND][PATCH 2/2] i2c: versatile: Convert to use resource managed devm_* APIs Axel Lin
  2016-07-11  8:44 ` [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build Liviu Dudau
@ 2016-07-14 12:23 ` Wolfram Sang
  2 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2016-07-14 12:23 UTC (permalink / raw)
  To: Axel Lin
  Cc: Lorenzo Pieralisi, Liviu Dudau, Sudeep Holla, Pawel Moll, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]

On Sat, Jul 09, 2016 at 01:31:23PM +0800, Axel Lin wrote:
> There is no build dependency for this driver, so enable COMPILE_TEST to get
> better build coverage.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [RESEND][PATCH 2/2] i2c: versatile: Convert to use resource managed devm_* APIs
  2016-07-09  5:32 ` [RESEND][PATCH 2/2] i2c: versatile: Convert to use resource managed devm_* APIs Axel Lin
@ 2016-07-14 12:23   ` Wolfram Sang
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2016-07-14 12:23 UTC (permalink / raw)
  To: Axel Lin
  Cc: Lorenzo Pieralisi, Liviu Dudau, Sudeep Holla, Pawel Moll, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 258 bytes --]

On Sat, Jul 09, 2016 at 01:32:23PM +0800, Axel Lin wrote:
> Use devm_* APIs to simplify the code a bit.
> This patch also fixes the memory leak when unload the module.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build
  2016-07-14 12:08     ` Wolfram Sang
@ 2016-07-14 12:33       ` Sudeep Holla
  0 siblings, 0 replies; 8+ messages in thread
From: Sudeep Holla @ 2016-07-14 12:33 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Sudeep Holla, Liviu Dudau, Axel Lin, Lorenzo Pieralisi,
	Pawel Moll, linux-i2c



On 14/07/16 13:08, Wolfram Sang wrote:
>> Thanks Liviu for testing them. Since these are cleanup patches, they
>> need to wait for v4.9, PR for v4.8 already sent and pulled.
>
> I'd think they should go via my I2C tree anyhow.
>

Sorry, I was wrong, I misread the path. Thanks for pulling.

-- 
Regards,
Sudeep

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

end of thread, other threads:[~2016-07-14 12:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-09  5:31 [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build Axel Lin
2016-07-09  5:32 ` [RESEND][PATCH 2/2] i2c: versatile: Convert to use resource managed devm_* APIs Axel Lin
2016-07-14 12:23   ` Wolfram Sang
2016-07-11  8:44 ` [RESEND][PATCH 1/2] i2c: versatile: Allow compile test build Liviu Dudau
2016-07-14 10:51   ` Sudeep Holla
2016-07-14 12:08     ` Wolfram Sang
2016-07-14 12:33       ` Sudeep Holla
2016-07-14 12:23 ` Wolfram Sang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.