All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/13] staging: mt7621-pinctrl: some cleanups
@ 2018-06-28 19:02 Sergio Paracuellos
  2018-06-28 19:02 ` [PATCH 01/13] staging: mt7621-pinctrl: avoid space after if condition Sergio Paracuellos
                   ` (12 more replies)
  0 siblings, 13 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:02 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

This patch series add remaining cleanups from previous series
which had problems to applied from here:

http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2018-June/121744.html

Just send remaining patches in a new patch serie.

Hope this helps.

Best regards,
    Sergio Paracuellos

Sergio Paracuellos (13):
  staging: mt7621-pinctrl: avoid space after if condition
  staging: mt7621-pinctrl: avoid lines over 80 chars
  staging: mt7621-pinctrl: replace seq_printf with seq_puts
  staging: mt7621-pinctrl: align function parameters in some functions
  staging: mt7621-pinctrl: use tabs instead of spaces in some
    indentations
  staging: mt7621-pinctrl: make use of pinctrl_utils_free_map
  staging: mt7621-pinctrl: replace uint8_t type with u8 for 'gpio' field
  staging: mt7621-pinctrl: make use of pinctrl_utils_reserve_map
  staging: mt7621-dts: use 'function' and 'group' for pinctrl bindings
  staging: mt7621-pinctrl: refactor rt2880_pinctrl_dt_node_to_map
    function
  staging: mt7621-pinctrl: use ternary operator return in
    rt2880_get_group_name
  staging: mt7621-pinctrl: remove 'rt2880_pinctrl_pin_dbg_show' callback
  staging: mt7621-pinctrl: replace core_initcall_sync with
    builtin_platform_driver

 drivers/staging/mt7621-dts/mt7621.dtsi          |  48 +++----
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 160 +++++++++---------------
 2 files changed, 80 insertions(+), 128 deletions(-)

-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 01/13] staging: mt7621-pinctrl: avoid space after if condition
  2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
@ 2018-06-28 19:02 ` Sergio Paracuellos
  2018-06-28 19:02 ` [PATCH 02/13] staging: mt7621-pinctrl: avoid lines over 80 chars Sergio Paracuellos
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:02 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

Adding spaces between if condition and parenthesis are not
needed at all and checkpatch script complains about them.
Fix one in driver code.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index 1e49a7b..6c9517f 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -357,7 +357,7 @@ static int rt2880_pinmux_pins(struct rt2880_priv *p)
 	p->pads = devm_kcalloc(p->dev,
 		p->max_pins, sizeof(struct pinctrl_pin_desc),
 		GFP_KERNEL);
-	if (!p->pads || !p->gpio ) {
+	if (!p->pads || !p->gpio) {
 		dev_err(p->dev, "Failed to allocate gpio data\n");
 		return -ENOMEM;
 	}
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 02/13] staging: mt7621-pinctrl: avoid lines over 80 chars
  2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
  2018-06-28 19:02 ` [PATCH 01/13] staging: mt7621-pinctrl: avoid space after if condition Sergio Paracuellos
@ 2018-06-28 19:02 ` Sergio Paracuellos
  2018-06-28 19:02 ` [PATCH 03/13] staging: mt7621-pinctrl: replace seq_printf with seq_puts Sergio Paracuellos
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:02 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

This commit silence checkpatch warnings about lines which
exceeds 80 chars.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 26 ++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index 6c9517f..849af87 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -205,7 +205,8 @@ static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev,
 
 	/* dont allow double use */
 	if (p->groups[group].enabled) {
-		dev_err(p->dev, "%s is already enabled\n", p->groups[group].name);
+		dev_err(p->dev, "%s is already enabled\n",
+			p->groups[group].name);
 		return -EBUSY;
 	}
 
@@ -283,8 +284,8 @@ static int rt2880_pinmux_index(struct rt2880_priv *p)
 	}
 
 	/* allocate the group names array needed by the gpio function */
-	p->group_names = devm_kcalloc(p->dev, p->group_count, sizeof(char *),
-				      GFP_KERNEL);
+	p->group_names = devm_kcalloc(p->dev, p->group_count,
+				      sizeof(char *), GFP_KERNEL);
 	if (!p->group_names)
 		return -1;
 
@@ -318,7 +319,8 @@ static int rt2880_pinmux_index(struct rt2880_priv *p)
 	for (i = 0; i < p->group_count; i++) {
 		for (j = 0; j < p->groups[i].func_count; j++) {
 			f[c] = &p->groups[i].func[j];
-			f[c]->groups = devm_kzalloc(p->dev, sizeof(int), GFP_KERNEL);
+			f[c]->groups = devm_kzalloc(p->dev, sizeof(int),
+						    GFP_KERNEL);
 			f[c]->groups[0] = i;
 			f[c]->group_count = 1;
 			c++;
@@ -331,7 +333,10 @@ static int rt2880_pinmux_pins(struct rt2880_priv *p)
 {
 	int i, j;
 
-	/* loop over the functions and initialize the pins array. also work out the highest pin used */
+	/*
+	 * loop over the functions and initialize the pins array.
+	 * also work out the highest pin used.
+	 */
 	for (i = 0; i < p->func_count; i++) {
 		int pin;
 
@@ -351,12 +356,11 @@ static int rt2880_pinmux_pins(struct rt2880_priv *p)
 	}
 
 	/* the buffer that tells us which pins are gpio */
-	p->gpio = devm_kcalloc(p->dev,p->max_pins, sizeof(uint8_t),
-			       GFP_KERNEL);
+	p->gpio = devm_kcalloc(p->dev, p->max_pins,
+			       sizeof(uint8_t), GFP_KERNEL);
 	/* the pads needed to tell pinctrl about our pins */
-	p->pads = devm_kcalloc(p->dev,
-		p->max_pins, sizeof(struct pinctrl_pin_desc),
-		GFP_KERNEL);
+	p->pads = devm_kcalloc(p->dev, p->max_pins,
+			       sizeof(struct pinctrl_pin_desc), GFP_KERNEL);
 	if (!p->pads || !p->gpio) {
 		dev_err(p->dev, "Failed to allocate gpio data\n");
 		return -ENOMEM;
@@ -439,7 +443,7 @@ static int rt2880_pinmux_probe(struct platform_device *pdev)
 			return -EINVAL;
 		}
 
-		range = devm_kzalloc(p->dev, sizeof(struct pinctrl_gpio_range) + 4, GFP_KERNEL);
+		range = devm_kzalloc(p->dev, sizeof(*range) + 4, GFP_KERNEL);
 		range->name = name = (char *) &range[1];
 		sprintf(name, "pio");
 		range->npins = __be32_to_cpu(*ngpio);
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 03/13] staging: mt7621-pinctrl: replace seq_printf with seq_puts
  2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
  2018-06-28 19:02 ` [PATCH 01/13] staging: mt7621-pinctrl: avoid space after if condition Sergio Paracuellos
  2018-06-28 19:02 ` [PATCH 02/13] staging: mt7621-pinctrl: avoid lines over 80 chars Sergio Paracuellos
@ 2018-06-28 19:02 ` Sergio Paracuellos
  2018-06-28 19:03 ` [PATCH 04/13] staging: mt7621-pinctrl: align function parameters in some functions Sergio Paracuellos
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:02 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

For a constant format without additional arguments, use seq_puts()
instead of seq_printf() fixing also the following checkpatch.pl
warning: 'Prefer seq_puts to seq_printf'

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index 849af87..ea37ae4 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -92,7 +92,7 @@ static void rt2880_pinctrl_pin_dbg_show(struct pinctrl_dev *pctrldev,
 					struct seq_file *s,
 					unsigned int offset)
 {
-	seq_printf(s, "ralink pio");
+	seq_puts(s, "ralink pio");
 }
 
 static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev,
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 04/13] staging: mt7621-pinctrl: align function parameters in some functions
  2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
                   ` (2 preceding siblings ...)
  2018-06-28 19:02 ` [PATCH 03/13] staging: mt7621-pinctrl: replace seq_printf with seq_puts Sergio Paracuellos
@ 2018-06-28 19:03 ` Sergio Paracuellos
  2018-06-28 19:03 ` [PATCH 05/13] staging: mt7621-pinctrl: use tabs instead of spaces in some indentations Sergio Paracuellos
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:03 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

Function parameters along the code has different alignment styles.
Just unify all of them making style consistent.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 29 ++++++++++++-------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index ea37ae4..52d4951 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -76,8 +76,8 @@ static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev,
 }
 
 static void rt2880_pinctrl_dt_free_map(struct pinctrl_dev *pctrldev,
-				    struct pinctrl_map *map,
-				    unsigned int num_maps)
+				       struct pinctrl_map *map,
+				       unsigned int num_maps)
 {
 	int i;
 
@@ -96,8 +96,8 @@ static void rt2880_pinctrl_pin_dbg_show(struct pinctrl_dev *pctrldev,
 }
 
 static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev,
-				struct device_node *np,
-				struct pinctrl_map **map)
+					     struct device_node *np,
+					     struct pinctrl_map **map)
 {
         const char *function;
 	int func = of_property_read_string(np, "ralink,function", &function);
@@ -121,9 +121,9 @@ static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev,
 }
 
 static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev,
-				struct device_node *np_config,
-				struct pinctrl_map **map,
-				unsigned int *num_maps)
+					 struct device_node *np_config,
+					 struct pinctrl_map **map,
+					 unsigned int *num_maps)
 {
 	int max_maps = 0;
 	struct pinctrl_map *tmp;
@@ -169,7 +169,7 @@ static int rt2880_pmx_func_count(struct pinctrl_dev *pctrldev)
 }
 
 static const char *rt2880_pmx_func_name(struct pinctrl_dev *pctrldev,
-					 unsigned int func)
+					unsigned int func)
 {
 	struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
 
@@ -177,9 +177,9 @@ static const char *rt2880_pmx_func_name(struct pinctrl_dev *pctrldev,
 }
 
 static int rt2880_pmx_group_get_groups(struct pinctrl_dev *pctrldev,
-				unsigned int func,
-				const char * const **groups,
-				unsigned int * const num_groups)
+				       unsigned int func,
+				       const char * const **groups,
+				       unsigned int * const num_groups)
 {
 	struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
 
@@ -194,8 +194,7 @@ static int rt2880_pmx_group_get_groups(struct pinctrl_dev *pctrldev,
 }
 
 static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev,
-				unsigned int func,
-				unsigned int group)
+				   unsigned int func, unsigned int group)
 {
 	struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
         u32 mode = 0;
@@ -239,8 +238,8 @@ static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev,
 }
 
 static int rt2880_pmx_group_gpio_request_enable(struct pinctrl_dev *pctrldev,
-				struct pinctrl_gpio_range *range,
-				unsigned int pin)
+						struct pinctrl_gpio_range *range,
+						unsigned int pin)
 {
 	struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
 
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 05/13] staging: mt7621-pinctrl: use tabs instead of spaces in some indentations
  2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
                   ` (3 preceding siblings ...)
  2018-06-28 19:03 ` [PATCH 04/13] staging: mt7621-pinctrl: align function parameters in some functions Sergio Paracuellos
@ 2018-06-28 19:03 ` Sergio Paracuellos
  2018-06-28 19:03 ` [PATCH 06/13] staging: mt7621-pinctrl: make use of pinctrl_utils_free_map Sergio Paracuellos
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:03 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

Kernel coding style use tabs for indent code instead of spaces.
Fix some places where spaces were being used silencing also
checkpatch script complains.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index 52d4951..bdee65c 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -99,7 +99,7 @@ static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev,
 					     struct device_node *np,
 					     struct pinctrl_map **map)
 {
-        const char *function;
+	const char *function;
 	int func = of_property_read_string(np, "ralink,function", &function);
 	int grps = of_property_count_strings(np, "ralink,group");
 	int i;
@@ -108,7 +108,7 @@ static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev,
 		return;
 
 	for (i = 0; i < grps; i++) {
-	        const char *group;
+		const char *group;
 
 		of_property_read_string_index(np, "ralink,group", i, &group);
 
@@ -197,7 +197,7 @@ static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev,
 				   unsigned int func, unsigned int group)
 {
 	struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
-        u32 mode = 0;
+	u32 mode = 0;
 	u32 reg = SYSC_REG_GPIO_MODE;
 	int i;
 	int shift;
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 06/13] staging: mt7621-pinctrl: make use of pinctrl_utils_free_map
  2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
                   ` (4 preceding siblings ...)
  2018-06-28 19:03 ` [PATCH 05/13] staging: mt7621-pinctrl: use tabs instead of spaces in some indentations Sergio Paracuellos
@ 2018-06-28 19:03 ` Sergio Paracuellos
  2018-06-28 19:03 ` [PATCH 07/13] staging: mt7621-pinctrl: replace uint8_t type with u8 for 'gpio' field Sergio Paracuellos
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:03 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

There was a custom 'rt2880_pinctrl_dt_free_map' function which
it was doing the same as pinctrl_utils_free_map defined in
'pinctrl-utils.h' header file. Use it instead avoiding
code duplications.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index bdee65c..d083866 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -20,6 +20,7 @@
 #include <asm/mach-ralink/mt7620.h>
 
 #include "core.h"
+#include "pinctrl-utils.h"
 
 #define SYSC_REG_GPIO_MODE	0x60
 #define SYSC_REG_GPIO_MODE2	0x64
@@ -75,19 +76,6 @@ static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev,
 	return 0;
 }
 
-static void rt2880_pinctrl_dt_free_map(struct pinctrl_dev *pctrldev,
-				       struct pinctrl_map *map,
-				       unsigned int num_maps)
-{
-	int i;
-
-	for (i = 0; i < num_maps; i++)
-		if (map[i].type == PIN_MAP_TYPE_CONFIGS_PIN ||
-		    map[i].type == PIN_MAP_TYPE_CONFIGS_GROUP)
-			kfree(map[i].data.configs.configs);
-	kfree(map);
-}
-
 static void rt2880_pinctrl_pin_dbg_show(struct pinctrl_dev *pctrldev,
 					struct seq_file *s,
 					unsigned int offset)
@@ -158,7 +146,7 @@ static const struct pinctrl_ops rt2880_pctrl_ops = {
 	.get_group_pins		= rt2880_get_group_pins,
 	.pin_dbg_show		= rt2880_pinctrl_pin_dbg_show,
 	.dt_node_to_map		= rt2880_pinctrl_dt_node_to_map,
-	.dt_free_map		= rt2880_pinctrl_dt_free_map,
+	.dt_free_map		= pinctrl_utils_free_map,
 };
 
 static int rt2880_pmx_func_count(struct pinctrl_dev *pctrldev)
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 07/13] staging: mt7621-pinctrl: replace uint8_t type with u8 for 'gpio' field
  2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
                   ` (5 preceding siblings ...)
  2018-06-28 19:03 ` [PATCH 06/13] staging: mt7621-pinctrl: make use of pinctrl_utils_free_map Sergio Paracuellos
@ 2018-06-28 19:03 ` Sergio Paracuellos
  2018-06-28 19:03 ` [PATCH 08/13] staging: mt7621-pinctrl: make use of pinctrl_utils_reserve_map Sergio Paracuellos
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:03 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

Struct 'rt2880_priv' contains a field 'gpio' which is defined
as uint8_t and should be defined with 'u8' which is preferred.
Update some cast along the code related with this new change.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index d083866..65c6b5a 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -38,7 +38,7 @@ struct rt2880_priv {
 	const char **group_names;
 	int group_count;
 
-	uint8_t *gpio;
+	u8 *gpio;
 	int max_pins;
 };
 
@@ -343,8 +343,7 @@ static int rt2880_pinmux_pins(struct rt2880_priv *p)
 	}
 
 	/* the buffer that tells us which pins are gpio */
-	p->gpio = devm_kcalloc(p->dev, p->max_pins,
-			       sizeof(uint8_t), GFP_KERNEL);
+	p->gpio = devm_kcalloc(p->dev, p->max_pins, sizeof(u8), GFP_KERNEL);
 	/* the pads needed to tell pinctrl about our pins */
 	p->pads = devm_kcalloc(p->dev, p->max_pins,
 			       sizeof(struct pinctrl_pin_desc), GFP_KERNEL);
@@ -353,7 +352,7 @@ static int rt2880_pinmux_pins(struct rt2880_priv *p)
 		return -ENOMEM;
 	}
 
-	memset(p->gpio, 1, sizeof(uint8_t) * p->max_pins);
+	memset(p->gpio, 1, sizeof(u8) * p->max_pins);
 	for (i = 0; i < p->func_count; i++) {
 		if (!p->func[i]->pin_count)
 			continue;
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 08/13] staging: mt7621-pinctrl: make use of pinctrl_utils_reserve_map
  2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
                   ` (6 preceding siblings ...)
  2018-06-28 19:03 ` [PATCH 07/13] staging: mt7621-pinctrl: replace uint8_t type with u8 for 'gpio' field Sergio Paracuellos
@ 2018-06-28 19:03 ` Sergio Paracuellos
  2018-06-28 19:03 ` [PATCH 09/13] staging: mt7621-dts: use 'function' and 'group' for pinctrl bindings Sergio Paracuellos
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:03 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

Function rt2880_pinctrl_dt_node_to_map was using 'kzalloc' to
reserve map memory. There is a 'pinctrl_utils_reserve_map' to
do this function. Just use it.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index 65c6b5a..8a196d3 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -113,7 +113,10 @@ static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev,
 					 struct pinctrl_map **map,
 					 unsigned int *num_maps)
 {
+	struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
+	int ret;
 	int max_maps = 0;
+	unsigned int reserved_maps = 0;
 	struct pinctrl_map *tmp;
 	struct device_node *np;
 
@@ -127,9 +130,12 @@ static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev,
 	if (!max_maps)
 		return max_maps;
 
-	*map = kcalloc(max_maps, sizeof(struct pinctrl_map), GFP_KERNEL);
-	if (!*map)
-		return -ENOMEM;
+	ret = pinctrl_utils_reserve_map(pctrldev, map, &reserved_maps,
+					num_maps, max_maps);
+	if (ret) {
+		dev_err(p->dev, "can't reserve map: %d\n", ret);
+		return ret;
+	}
 
 	tmp = *map;
 
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 09/13] staging: mt7621-dts: use 'function' and 'group' for pinctrl bindings
  2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
                   ` (7 preceding siblings ...)
  2018-06-28 19:03 ` [PATCH 08/13] staging: mt7621-pinctrl: make use of pinctrl_utils_reserve_map Sergio Paracuellos
@ 2018-06-28 19:03 ` Sergio Paracuellos
  2018-06-28 19:03 ` [PATCH 10/13] staging: mt7621-pinctrl: refactor rt2880_pinctrl_dt_node_to_map function Sergio Paracuellos
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:03 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

According to documentation 'pinctrl-bindings.txt' bindings 'group'
and 'function' can be used directly. So replace all of them.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-dts/mt7621.dtsi | 48 +++++++++++++++++-----------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts/mt7621.dtsi
index a87fcc6..4610403 100644
--- a/drivers/staging/mt7621-dts/mt7621.dtsi
+++ b/drivers/staging/mt7621-dts/mt7621.dtsi
@@ -204,83 +204,83 @@
 
 		i2c_pins: i2c {
 			i2c {
-				ralink,group = "i2c";
-				ralink,function = "i2c";
+				group = "i2c";
+				function = "i2c";
 			};
 		};
 
 		spi_pins: spi {
 			spi {
-				ralink,group = "spi";
-				ralink,function = "spi";
+				group = "spi";
+				function = "spi";
 			};
 		};
 
 		uart1_pins: uart1 {
 			uart1 {
-				ralink,group = "uart1";
-				ralink,function = "uart1";
+				group = "uart1";
+				function = "uart1";
 			};
 		};
 
 		uart2_pins: uart2 {
 			uart2 {
-				ralink,group = "uart2";
-				ralink,function = "uart2";
+				group = "uart2";
+				function = "uart2";
 			};
 		};
 
 		uart3_pins: uart3 {
 			uart3 {
-				ralink,group = "uart3";
-				ralink,function = "uart3";
+				group = "uart3";
+				function = "uart3";
 			};
 		};
 
 		rgmii1_pins: rgmii1 {
 			rgmii1 {
-				ralink,group = "rgmii1";
-				ralink,function = "rgmii1";
+				group = "rgmii1";
+				function = "rgmii1";
 			};
 		};
 
 		rgmii2_pins: rgmii2 {
 			rgmii2 {
-				ralink,group = "rgmii2";
-				ralink,function = "rgmii2";
+				group = "rgmii2";
+				function = "rgmii2";
 			};
 		};
 
 		mdio_pins: mdio {
 			mdio {
-				ralink,group = "mdio";
-				ralink,function = "mdio";
+				group = "mdio";
+				function = "mdio";
 			};
 		};
 
 		pcie_pins: pcie {
 			pcie {
-				ralink,group = "pcie";
-				ralink,function = "pcie rst";
+				group = "pcie";
+				function = "pcie rst";
 			};
 		};
 
 		nand_pins: nand {
 			spi-nand {
-				ralink,group = "spi";
-				ralink,function = "nand1";
+				group = "spi";
+				function = "nand1";
 			};
 
 			sdhci-nand {
-				ralink,group = "sdhci";
-				ralink,function = "nand2";
+				group = "sdhci";
+				function = "nand2";
 			};
 		};
 
 		sdhci_pins: sdhci {
 			sdhci {
-				ralink,group = "sdhci";
-				ralink,function = "sdhci";
+				group = "sdhci";
+				function = "sdhci";
 			};
 		};
 	};
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 10/13] staging: mt7621-pinctrl: refactor rt2880_pinctrl_dt_node_to_map function
  2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
                   ` (8 preceding siblings ...)
  2018-06-28 19:03 ` [PATCH 09/13] staging: mt7621-dts: use 'function' and 'group' for pinctrl bindings Sergio Paracuellos
@ 2018-06-28 19:03 ` Sergio Paracuellos
  2018-06-28 19:03 ` [PATCH 11/13] staging: mt7621-pinctrl: use ternary operator return in rt2880_get_group_name Sergio Paracuellos
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:03 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

Using 'function' and 'group' bindings in the device tree give the
posibility of refactor 'rt2880_pinctrl_dt_node_to_map' and simplify
it a lot. Make use of 'for_each_node_with_property' function to count
number of groups for the node and iterate over the groups using
'of_property_for_each_string' calling 'pinctrl_utils_add_map_mux'
function which is the same of the custom function in this driver code
'rt2880_pinctrl_dt_subnode_to_map' which is not needed anymore.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 58 +++++++------------------
 1 file changed, 15 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index 8a196d3..c022718 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -83,65 +83,37 @@ static void rt2880_pinctrl_pin_dbg_show(struct pinctrl_dev *pctrldev,
 	seq_puts(s, "ralink pio");
 }
 
-static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev,
-					     struct device_node *np,
-					     struct pinctrl_map **map)
-{
-	const char *function;
-	int func = of_property_read_string(np, "ralink,function", &function);
-	int grps = of_property_count_strings(np, "ralink,group");
-	int i;
-
-	if (func || !grps)
-		return;
-
-	for (i = 0; i < grps; i++) {
-		const char *group;
-
-		of_property_read_string_index(np, "ralink,group", i, &group);
-
-		(*map)->type = PIN_MAP_TYPE_MUX_GROUP;
-		(*map)->name = function;
-		(*map)->data.mux.group = group;
-		(*map)->data.mux.function = function;
-		(*map)++;
-	}
-}
-
 static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev,
 					 struct device_node *np_config,
 					 struct pinctrl_map **map,
 					 unsigned int *num_maps)
 {
 	struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
+	struct property *prop;
+	const char *function_name, *group_name;
 	int ret;
-	int max_maps = 0;
+	int ngroups;
 	unsigned int reserved_maps = 0;
-	struct pinctrl_map *tmp;
-	struct device_node *np;
-
-	for_each_child_of_node(np_config, np) {
-		int ret = of_property_count_strings(np, "ralink,group");
-
-		if (ret >= 0)
-			max_maps += ret;
-	}
 
-	if (!max_maps)
-		return max_maps;
+	for_each_node_with_property(np_config, "group")
+		ngroups++;
 
 	ret = pinctrl_utils_reserve_map(pctrldev, map, &reserved_maps,
-					num_maps, max_maps);
+					num_maps, ngroups);
 	if (ret) {
 		dev_err(p->dev, "can't reserve map: %d\n", ret);
 		return ret;
 	}
 
-	tmp = *map;
-
-	for_each_child_of_node(np_config, np)
-		rt2880_pinctrl_dt_subnode_to_map(pctrldev, np, &tmp);
-	*num_maps = max_maps;
+	of_property_for_each_string(np_config, "group", prop, group_name) {
+		ret = pinctrl_utils_add_map_mux(pctrldev, map, &reserved_maps,
+						num_maps, group_name,
+						function_name);
+		if (ret) {
+			dev_err(p->dev, "can't add map: %d\n", ret);
+			return ret;
+		}
+	}
 
 	return 0;
 }
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 11/13] staging: mt7621-pinctrl: use ternary operator return in rt2880_get_group_name
  2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
                   ` (9 preceding siblings ...)
  2018-06-28 19:03 ` [PATCH 10/13] staging: mt7621-pinctrl: refactor rt2880_pinctrl_dt_node_to_map function Sergio Paracuellos
@ 2018-06-28 19:03 ` Sergio Paracuellos
  2018-06-28 19:03 ` [PATCH 12/13] staging: mt7621-pinctrl: remove 'rt2880_pinctrl_pin_dbg_show' callback Sergio Paracuellos
  2018-06-28 19:03 ` [PATCH 13/13] staging: mt7621-pinctrl: replace core_initcall_sync with builtin_platform_driver Sergio Paracuellos
  12 siblings, 0 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:03 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

Trivial change to have only one return in 'rt2880_get_group_name'
function using a ternary operator instead of an if statement and
two returns.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index c022718..a15e8e8 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -54,10 +54,7 @@ static const char *rt2880_get_group_name(struct pinctrl_dev *pctrldev,
 {
 	struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
 
-	if (group >= p->group_count)
-		return NULL;
-
-	return p->group_names[group];
+	return (group >= p->group_count) ? NULL : p->group_names[group];
 }
 
 static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev,
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 12/13] staging: mt7621-pinctrl: remove 'rt2880_pinctrl_pin_dbg_show' callback
  2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
                   ` (10 preceding siblings ...)
  2018-06-28 19:03 ` [PATCH 11/13] staging: mt7621-pinctrl: use ternary operator return in rt2880_get_group_name Sergio Paracuellos
@ 2018-06-28 19:03 ` Sergio Paracuellos
  2018-06-28 19:03 ` [PATCH 13/13] staging: mt7621-pinctrl: replace core_initcall_sync with builtin_platform_driver Sergio Paracuellos
  12 siblings, 0 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:03 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

The debug information provided by this function does not make
sense at all, so just remove it.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index a15e8e8..2cce212 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -73,13 +73,6 @@ static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev,
 	return 0;
 }
 
-static void rt2880_pinctrl_pin_dbg_show(struct pinctrl_dev *pctrldev,
-					struct seq_file *s,
-					unsigned int offset)
-{
-	seq_puts(s, "ralink pio");
-}
-
 static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev,
 					 struct device_node *np_config,
 					 struct pinctrl_map **map,
@@ -119,7 +112,6 @@ static const struct pinctrl_ops rt2880_pctrl_ops = {
 	.get_groups_count	= rt2880_get_group_count,
 	.get_group_name		= rt2880_get_group_name,
 	.get_group_pins		= rt2880_get_group_pins,
-	.pin_dbg_show		= rt2880_pinctrl_pin_dbg_show,
 	.dt_node_to_map		= rt2880_pinctrl_dt_node_to_map,
 	.dt_free_map		= pinctrl_utils_free_map,
 };
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 13/13] staging: mt7621-pinctrl: replace core_initcall_sync with builtin_platform_driver
  2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
                   ` (11 preceding siblings ...)
  2018-06-28 19:03 ` [PATCH 12/13] staging: mt7621-pinctrl: remove 'rt2880_pinctrl_pin_dbg_show' callback Sergio Paracuellos
@ 2018-06-28 19:03 ` Sergio Paracuellos
  2018-07-08 23:40   ` NeilBrown
  12 siblings, 1 reply; 18+ messages in thread
From: Sergio Paracuellos @ 2018-06-28 19:03 UTC (permalink / raw)
  To: gregkh; +Cc: neil, driverdev-devel

We don't really need initialization of this at such an early stage.
Just use builtin_platform_driver to initialize this driver.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
index 2cce212..7025942 100644
--- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
+++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
@@ -422,9 +422,4 @@ static struct platform_driver rt2880_pinmux_driver = {
 	},
 };
 
-int __init rt2880_pinmux_init(void)
-{
-	return platform_driver_register(&rt2880_pinmux_driver);
-}
-
-core_initcall_sync(rt2880_pinmux_init);
+builtin_platform_driver(rt2880_pinmux_driver);
-- 
2.7.4

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 13/13] staging: mt7621-pinctrl: replace core_initcall_sync with builtin_platform_driver
  2018-06-28 19:03 ` [PATCH 13/13] staging: mt7621-pinctrl: replace core_initcall_sync with builtin_platform_driver Sergio Paracuellos
@ 2018-07-08 23:40   ` NeilBrown
  2018-07-09  4:30     ` Sergio Paracuellos
  0 siblings, 1 reply; 18+ messages in thread
From: NeilBrown @ 2018-07-08 23:40 UTC (permalink / raw)
  To: Sergio Paracuellos, gregkh; +Cc: driverdev-devel


[-- Attachment #1.1: Type: text/plain, Size: 1231 bytes --]

On Thu, Jun 28 2018, Sergio Paracuellos wrote:

> We don't really need initialization of this at such an early stage.
> Just use builtin_platform_driver to initialize this driver.
>
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---
>  drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> index 2cce212..7025942 100644
> --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> @@ -422,9 +422,4 @@ static struct platform_driver rt2880_pinmux_driver = {
>  	},
>  };
>  
> -int __init rt2880_pinmux_init(void)
> -{
> -	return platform_driver_register(&rt2880_pinmux_driver);
> -}
> -
> -core_initcall_sync(rt2880_pinmux_init);
> +builtin_platform_driver(rt2880_pinmux_driver);
> -- 
> 2.7.4

This patch causes the network interface on my device to stop working.
device_initcall() is called much later than core_initcall_sync() and
that seem to be a problem.
I think this needs to be reverted - at least until it is understood.

Thanks,
NeilBrown

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

[-- Attachment #2: Type: text/plain, Size: 169 bytes --]

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 13/13] staging: mt7621-pinctrl: replace core_initcall_sync with builtin_platform_driver
  2018-07-08 23:40   ` NeilBrown
@ 2018-07-09  4:30     ` Sergio Paracuellos
  2018-07-09  7:39       ` Greg KH
  0 siblings, 1 reply; 18+ messages in thread
From: Sergio Paracuellos @ 2018-07-09  4:30 UTC (permalink / raw)
  To: NeilBrown; +Cc: gregkh, driverdev-devel

On Mon, Jul 09, 2018 at 09:40:18AM +1000, NeilBrown wrote:
> On Thu, Jun 28 2018, Sergio Paracuellos wrote:
> 
> > We don't really need initialization of this at such an early stage.
> > Just use builtin_platform_driver to initialize this driver.
> >
> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> > ---
> >  drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 7 +------
> >  1 file changed, 1 insertion(+), 6 deletions(-)
> >
> > diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> > index 2cce212..7025942 100644
> > --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> > +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> > @@ -422,9 +422,4 @@ static struct platform_driver rt2880_pinmux_driver = {
> >  	},
> >  };
> >  
> > -int __init rt2880_pinmux_init(void)
> > -{
> > -	return platform_driver_register(&rt2880_pinmux_driver);
> > -}
> > -
> > -core_initcall_sync(rt2880_pinmux_init);
> > +builtin_platform_driver(rt2880_pinmux_driver);
> > -- 
> > 2.7.4
> 
> This patch causes the network interface on my device to stop working.
> device_initcall() is called much later than core_initcall_sync() and
> that seem to be a problem.
> I think this needs to be reverted - at least until it is understood.

Ok, if that is the case, Greg, please revert this commit.

Thanks in advance.

> 
> Thanks,
> NeilBrown

Best regards,
    Sergio Paracuellos
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 13/13] staging: mt7621-pinctrl: replace core_initcall_sync with builtin_platform_driver
  2018-07-09  4:30     ` Sergio Paracuellos
@ 2018-07-09  7:39       ` Greg KH
  2018-07-09 10:19         ` Sergio Paracuellos
  0 siblings, 1 reply; 18+ messages in thread
From: Greg KH @ 2018-07-09  7:39 UTC (permalink / raw)
  To: Sergio Paracuellos; +Cc: NeilBrown, driverdev-devel

On Mon, Jul 09, 2018 at 06:30:07AM +0200, Sergio Paracuellos wrote:
> On Mon, Jul 09, 2018 at 09:40:18AM +1000, NeilBrown wrote:
> > On Thu, Jun 28 2018, Sergio Paracuellos wrote:
> > 
> > > We don't really need initialization of this at such an early stage.
> > > Just use builtin_platform_driver to initialize this driver.
> > >
> > > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> > > ---
> > >  drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 7 +------
> > >  1 file changed, 1 insertion(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> > > index 2cce212..7025942 100644
> > > --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> > > +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> > > @@ -422,9 +422,4 @@ static struct platform_driver rt2880_pinmux_driver = {
> > >  	},
> > >  };
> > >  
> > > -int __init rt2880_pinmux_init(void)
> > > -{
> > > -	return platform_driver_register(&rt2880_pinmux_driver);
> > > -}
> > > -
> > > -core_initcall_sync(rt2880_pinmux_init);
> > > +builtin_platform_driver(rt2880_pinmux_driver);
> > > -- 
> > > 2.7.4
> > 
> > This patch causes the network interface on my device to stop working.
> > device_initcall() is called much later than core_initcall_sync() and
> > that seem to be a problem.
> > I think this needs to be reverted - at least until it is understood.
> 
> Ok, if that is the case, Greg, please revert this commit.

Please send a revert.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 13/13] staging: mt7621-pinctrl: replace core_initcall_sync with builtin_platform_driver
  2018-07-09  7:39       ` Greg KH
@ 2018-07-09 10:19         ` Sergio Paracuellos
  0 siblings, 0 replies; 18+ messages in thread
From: Sergio Paracuellos @ 2018-07-09 10:19 UTC (permalink / raw)
  To: Greg KH; +Cc: NeilBrown, driverdev-devel

On Mon, Jul 09, 2018 at 09:39:19AM +0200, Greg KH wrote:
> On Mon, Jul 09, 2018 at 06:30:07AM +0200, Sergio Paracuellos wrote:
> > On Mon, Jul 09, 2018 at 09:40:18AM +1000, NeilBrown wrote:
> > > On Thu, Jun 28 2018, Sergio Paracuellos wrote:
> > > 
> > > > We don't really need initialization of this at such an early stage.
> > > > Just use builtin_platform_driver to initialize this driver.
> > > >
> > > > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> > > > ---
> > > >  drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c | 7 +------
> > > >  1 file changed, 1 insertion(+), 6 deletions(-)
> > > >
> > > > diff --git a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> > > > index 2cce212..7025942 100644
> > > > --- a/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> > > > +++ b/drivers/staging/mt7621-pinctrl/pinctrl-rt2880.c
> > > > @@ -422,9 +422,4 @@ static struct platform_driver rt2880_pinmux_driver = {
> > > >  	},
> > > >  };
> > > >  
> > > > -int __init rt2880_pinmux_init(void)
> > > > -{
> > > > -	return platform_driver_register(&rt2880_pinmux_driver);
> > > > -}
> > > > -
> > > > -core_initcall_sync(rt2880_pinmux_init);
> > > > +builtin_platform_driver(rt2880_pinmux_driver);
> > > > -- 
> > > > 2.7.4
> > > 
> > > This patch causes the network interface on my device to stop working.
> > > device_initcall() is called much later than core_initcall_sync() and
> > > that seem to be a problem.
> > > I think this needs to be reverted - at least until it is understood.
> > 
> > Ok, if that is the case, Greg, please revert this commit.
> 
> Please send a revert.

Sent. Thanks.
> 
> thanks,
> 
> greg k-h

Best regards,
    Sergio Paracuellos
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2018-07-09 10:19 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-28 19:02 [PATCH 00/13] staging: mt7621-pinctrl: some cleanups Sergio Paracuellos
2018-06-28 19:02 ` [PATCH 01/13] staging: mt7621-pinctrl: avoid space after if condition Sergio Paracuellos
2018-06-28 19:02 ` [PATCH 02/13] staging: mt7621-pinctrl: avoid lines over 80 chars Sergio Paracuellos
2018-06-28 19:02 ` [PATCH 03/13] staging: mt7621-pinctrl: replace seq_printf with seq_puts Sergio Paracuellos
2018-06-28 19:03 ` [PATCH 04/13] staging: mt7621-pinctrl: align function parameters in some functions Sergio Paracuellos
2018-06-28 19:03 ` [PATCH 05/13] staging: mt7621-pinctrl: use tabs instead of spaces in some indentations Sergio Paracuellos
2018-06-28 19:03 ` [PATCH 06/13] staging: mt7621-pinctrl: make use of pinctrl_utils_free_map Sergio Paracuellos
2018-06-28 19:03 ` [PATCH 07/13] staging: mt7621-pinctrl: replace uint8_t type with u8 for 'gpio' field Sergio Paracuellos
2018-06-28 19:03 ` [PATCH 08/13] staging: mt7621-pinctrl: make use of pinctrl_utils_reserve_map Sergio Paracuellos
2018-06-28 19:03 ` [PATCH 09/13] staging: mt7621-dts: use 'function' and 'group' for pinctrl bindings Sergio Paracuellos
2018-06-28 19:03 ` [PATCH 10/13] staging: mt7621-pinctrl: refactor rt2880_pinctrl_dt_node_to_map function Sergio Paracuellos
2018-06-28 19:03 ` [PATCH 11/13] staging: mt7621-pinctrl: use ternary operator return in rt2880_get_group_name Sergio Paracuellos
2018-06-28 19:03 ` [PATCH 12/13] staging: mt7621-pinctrl: remove 'rt2880_pinctrl_pin_dbg_show' callback Sergio Paracuellos
2018-06-28 19:03 ` [PATCH 13/13] staging: mt7621-pinctrl: replace core_initcall_sync with builtin_platform_driver Sergio Paracuellos
2018-07-08 23:40   ` NeilBrown
2018-07-09  4:30     ` Sergio Paracuellos
2018-07-09  7:39       ` Greg KH
2018-07-09 10:19         ` Sergio Paracuellos

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.