linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] regmap: mmio: clean up the code
@ 2015-12-03  5:27 Xiubo Li
  2015-12-03  5:27 ` [PATCH 1/2] regmap: mmio: remove the useless code Xiubo Li
  2015-12-03  5:27 ` [PATCH 2/2] regmap: mmio: Add regmap_mmio_get_min_stride Xiubo Li
  0 siblings, 2 replies; 5+ messages in thread
From: Xiubo Li @ 2015-12-03  5:27 UTC (permalink / raw)
  To: broonie; +Cc: linux-kernel, Xiubo Li

Xiubo Li (2):
  regmap: mmio: remove the useless code
  regmap: mmio: Add regmap_mmio_get_min_stride

 drivers/base/regmap/regmap-mmio.c | 50 +++++++++++++++++++++++----------------
 1 file changed, 30 insertions(+), 20 deletions(-)

-- 
1.8.3.1



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

* [PATCH 1/2] regmap: mmio: remove the useless code
  2015-12-03  5:27 [PATCH 0/2] regmap: mmio: clean up the code Xiubo Li
@ 2015-12-03  5:27 ` Xiubo Li
  2015-12-08 19:11   ` Applied "regmap: mmio: remove the useless code" to the regmap tree Mark Brown
  2015-12-03  5:27 ` [PATCH 2/2] regmap: mmio: Add regmap_mmio_get_min_stride Xiubo Li
  1 sibling, 1 reply; 5+ messages in thread
From: Xiubo Li @ 2015-12-03  5:27 UTC (permalink / raw)
  To: broonie; +Cc: linux-kernel, Xiubo Li

Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
---
 drivers/base/regmap/regmap-mmio.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/base/regmap/regmap-mmio.c b/drivers/base/regmap/regmap-mmio.c
index 426a57e..38d0dc0 100644
--- a/drivers/base/regmap/regmap-mmio.c
+++ b/drivers/base/regmap/regmap-mmio.c
@@ -247,7 +247,6 @@ static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev,
 		min_stride = 8;
 		break;
 #endif
-		break;
 	default:
 		return ERR_PTR(-EINVAL);
 	}
-- 
1.8.3.1



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

* [PATCH 2/2] regmap: mmio: Add regmap_mmio_get_min_stride
  2015-12-03  5:27 [PATCH 0/2] regmap: mmio: clean up the code Xiubo Li
  2015-12-03  5:27 ` [PATCH 1/2] regmap: mmio: remove the useless code Xiubo Li
@ 2015-12-03  5:27 ` Xiubo Li
  2015-12-08 19:11   ` Applied "regmap: mmio: Add regmap_mmio_get_min_stride" to the regmap tree Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Xiubo Li @ 2015-12-03  5:27 UTC (permalink / raw)
  To: broonie; +Cc: linux-kernel, Xiubo Li

Splite the minimal stride parsing into one signal function.

Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
---
 drivers/base/regmap/regmap-mmio.c | 49 ++++++++++++++++++++++++---------------
 1 file changed, 30 insertions(+), 19 deletions(-)

diff --git a/drivers/base/regmap/regmap-mmio.c b/drivers/base/regmap/regmap-mmio.c
index 38d0dc0..eea5156 100644
--- a/drivers/base/regmap/regmap-mmio.c
+++ b/drivers/base/regmap/regmap-mmio.c
@@ -61,6 +61,33 @@ static int regmap_mmio_regbits_check(size_t reg_bits)
 	}
 }
 
+static int regmap_mmio_get_min_stride(size_t val_bits)
+{
+	int min_stride;
+
+	switch (val_bits) {
+	case 8:
+		/* The core treats 0 as 1 */
+		min_stride = 0;
+		return 0;
+	case 16:
+		min_stride = 2;
+		break;
+	case 32:
+		min_stride = 4;
+		break;
+#ifdef CONFIG_64BIT
+	case 64:
+		min_stride = 8;
+		break;
+#endif
+	default:
+		return -EINVAL;
+	}
+
+	return min_stride;
+}
+
 static inline void regmap_mmio_count_check(size_t count, u32 offset)
 {
 	BUG_ON(count <= offset);
@@ -231,25 +258,9 @@ static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev,
 	if (config->pad_bits)
 		return ERR_PTR(-EINVAL);
 
-	switch (config->val_bits) {
-	case 8:
-		/* The core treats 0 as 1 */
-		min_stride = 0;
-		break;
-	case 16:
-		min_stride = 2;
-		break;
-	case 32:
-		min_stride = 4;
-		break;
-#ifdef CONFIG_64BIT
-	case 64:
-		min_stride = 8;
-		break;
-#endif
-	default:
-		return ERR_PTR(-EINVAL);
-	}
+	min_stride = regmap_mmio_get_min_stride(config->val_bits);
+	if (min_stride < 0)
+		return ERR_PTR(min_stride);
 
 	if (config->reg_stride < min_stride)
 		return ERR_PTR(-EINVAL);
-- 
1.8.3.1



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

* Applied "regmap: mmio: Add regmap_mmio_get_min_stride" to the regmap tree
  2015-12-03  5:27 ` [PATCH 2/2] regmap: mmio: Add regmap_mmio_get_min_stride Xiubo Li
@ 2015-12-08 19:11   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2015-12-08 19:11 UTC (permalink / raw)
  To: Xiubo Li, Mark Brown; +Cc: linux-kernel

The patch

   regmap: mmio: Add regmap_mmio_get_min_stride

has been applied to the regmap tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 75fb0aaea18dbcde60a740c5d62af705366d6357 Mon Sep 17 00:00:00 2001
From: Xiubo Li <lixiubo@cmss.chinamobile.com>
Date: Thu, 3 Dec 2015 13:27:21 +0800
Subject: [PATCH] regmap: mmio: Add regmap_mmio_get_min_stride

Splite the minimal stride parsing into one signal function.

Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/base/regmap/regmap-mmio.c | 49 ++++++++++++++++++++++++---------------
 1 file changed, 30 insertions(+), 19 deletions(-)

diff --git a/drivers/base/regmap/regmap-mmio.c b/drivers/base/regmap/regmap-mmio.c
index dc991c3bec25..8812bfb9e3b8 100644
--- a/drivers/base/regmap/regmap-mmio.c
+++ b/drivers/base/regmap/regmap-mmio.c
@@ -61,6 +61,33 @@ static int regmap_mmio_regbits_check(size_t reg_bits)
 	}
 }
 
+static int regmap_mmio_get_min_stride(size_t val_bits)
+{
+	int min_stride;
+
+	switch (val_bits) {
+	case 8:
+		/* The core treats 0 as 1 */
+		min_stride = 0;
+		return 0;
+	case 16:
+		min_stride = 2;
+		break;
+	case 32:
+		min_stride = 4;
+		break;
+#ifdef CONFIG_64BIT
+	case 64:
+		min_stride = 8;
+		break;
+#endif
+	default:
+		return -EINVAL;
+	}
+
+	return min_stride;
+}
+
 static inline void regmap_mmio_count_check(size_t count, u32 offset)
 {
 	BUG_ON(count <= offset);
@@ -231,25 +258,9 @@ static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev,
 	if (config->pad_bits)
 		return ERR_PTR(-EINVAL);
 
-	switch (config->val_bits) {
-	case 8:
-		/* The core treats 0 as 1 */
-		min_stride = 0;
-		break;
-	case 16:
-		min_stride = 2;
-		break;
-	case 32:
-		min_stride = 4;
-		break;
-#ifdef CONFIG_64BIT
-	case 64:
-		min_stride = 8;
-		break;
-#endif
-	default:
-		return ERR_PTR(-EINVAL);
-	}
+	min_stride = regmap_mmio_get_min_stride(config->val_bits);
+	if (min_stride < 0)
+		return ERR_PTR(min_stride);
 
 	if (config->reg_stride < min_stride)
 		return ERR_PTR(-EINVAL);
-- 
2.6.2


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

* Applied "regmap: mmio: remove the useless code" to the regmap tree
  2015-12-03  5:27 ` [PATCH 1/2] regmap: mmio: remove the useless code Xiubo Li
@ 2015-12-08 19:11   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2015-12-08 19:11 UTC (permalink / raw)
  To: Xiubo Li, Mark Brown; +Cc: linux-kernel

The patch

   regmap: mmio: remove the useless code

has been applied to the regmap tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 9d98fa712920a393591f446fa76cb277309dd37b Mon Sep 17 00:00:00 2001
From: Xiubo Li <lixiubo@cmss.chinamobile.com>
Date: Thu, 3 Dec 2015 13:27:20 +0800
Subject: [PATCH] regmap: mmio: remove the useless code

Signed-off-by: Xiubo Li <lixiubo@cmss.chinamobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/base/regmap/regmap-mmio.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/base/regmap/regmap-mmio.c b/drivers/base/regmap/regmap-mmio.c
index 8a77876d439a..dc991c3bec25 100644
--- a/drivers/base/regmap/regmap-mmio.c
+++ b/drivers/base/regmap/regmap-mmio.c
@@ -247,7 +247,6 @@ static struct regmap_mmio_context *regmap_mmio_gen_context(struct device *dev,
 		min_stride = 8;
 		break;
 #endif
-		break;
 	default:
 		return ERR_PTR(-EINVAL);
 	}
-- 
2.6.2


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

end of thread, other threads:[~2015-12-08 19:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-03  5:27 [PATCH 0/2] regmap: mmio: clean up the code Xiubo Li
2015-12-03  5:27 ` [PATCH 1/2] regmap: mmio: remove the useless code Xiubo Li
2015-12-08 19:11   ` Applied "regmap: mmio: remove the useless code" to the regmap tree Mark Brown
2015-12-03  5:27 ` [PATCH 2/2] regmap: mmio: Add regmap_mmio_get_min_stride Xiubo Li
2015-12-08 19:11   ` Applied "regmap: mmio: Add regmap_mmio_get_min_stride" to the regmap tree Mark Brown

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