All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: syscon: Remove usage of syscon_regmap_lookup_by_compatible
@ 2022-04-20  6:51 Alexander Shiyan
  2022-04-22 21:54 ` Linus Walleij
  2022-05-02  8:43 ` Bartosz Golaszewski
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Shiyan @ 2022-04-20  6:51 UTC (permalink / raw)
  To: linux-gpio; +Cc: Linus Walleij, Bartosz Golaszewski, Alexander Shiyan

Since version 5.13, the standard syscon bindings have been added
to all clps711x DT nodes, so we can now use the more general
syscon_regmap_lookup_by_phandle function to get the syscon pointer.

This patch removes the usage of the syscon_regmap_lookup_by_compatible
function as it is no longer used in the driver.

Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
 drivers/gpio/gpio-syscon.c | 49 +++++++++++++++-----------------------
 1 file changed, 19 insertions(+), 30 deletions(-)

diff --git a/drivers/gpio/gpio-syscon.c b/drivers/gpio/gpio-syscon.c
index fdd3d497b535..6076937b18e7 100644
--- a/drivers/gpio/gpio-syscon.c
+++ b/drivers/gpio/gpio-syscon.c
@@ -38,7 +38,6 @@
  */
 
 struct syscon_gpio_data {
-	const char	*compatible;
 	unsigned int	flags;
 	unsigned int	bit_count;
 	unsigned int	dat_bit_offset;
@@ -125,7 +124,6 @@ static int syscon_gpio_dir_out(struct gpio_chip *chip, unsigned offset, int val)
 
 static const struct syscon_gpio_data clps711x_mctrl_gpio = {
 	/* ARM CLPS711X SYSFLG1 Bits 8-10 */
-	.compatible	= "cirrus,ep7209-syscon1",
 	.flags		= GPIO_SYSCON_FEAT_IN,
 	.bit_count	= 3,
 	.dat_bit_offset	= 0x40 * 8 + 8,
@@ -182,7 +180,6 @@ static void keystone_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
 
 static const struct syscon_gpio_data keystone_dsp_gpio = {
 	/* ARM Keystone 2 */
-	.compatible	= NULL,
 	.flags		= GPIO_SYSCON_FEAT_OUT,
 	.bit_count	= 28,
 	.dat_bit_offset	= 4,
@@ -219,33 +216,25 @@ static int syscon_gpio_probe(struct platform_device *pdev)
 
 	priv->data = of_device_get_match_data(dev);
 
-	if (priv->data->compatible) {
-		priv->syscon = syscon_regmap_lookup_by_compatible(
-					priv->data->compatible);
-		if (IS_ERR(priv->syscon))
-			return PTR_ERR(priv->syscon);
-	} else {
-		priv->syscon =
-			syscon_regmap_lookup_by_phandle(np, "gpio,syscon-dev");
-		if (IS_ERR(priv->syscon) && np->parent)
-			priv->syscon = syscon_node_to_regmap(np->parent);
-		if (IS_ERR(priv->syscon))
-			return PTR_ERR(priv->syscon);
-
-		ret = of_property_read_u32_index(np, "gpio,syscon-dev", 1,
-						 &priv->dreg_offset);
-		if (ret)
-			dev_err(dev, "can't read the data register offset!\n");
-
-		priv->dreg_offset <<= 3;
-
-		ret = of_property_read_u32_index(np, "gpio,syscon-dev", 2,
-						 &priv->dir_reg_offset);
-		if (ret)
-			dev_dbg(dev, "can't read the dir register offset!\n");
-
-		priv->dir_reg_offset <<= 3;
-	}
+	priv->syscon = syscon_regmap_lookup_by_phandle(np, "gpio,syscon-dev");
+	if (IS_ERR(priv->syscon) && np->parent)
+		priv->syscon = syscon_node_to_regmap(np->parent);
+	if (IS_ERR(priv->syscon))
+		return PTR_ERR(priv->syscon);
+
+	ret = of_property_read_u32_index(np, "gpio,syscon-dev", 1,
+					 &priv->dreg_offset);
+	if (ret)
+		dev_err(dev, "can't read the data register offset!\n");
+
+	priv->dreg_offset <<= 3;
+
+	ret = of_property_read_u32_index(np, "gpio,syscon-dev", 2,
+					 &priv->dir_reg_offset);
+	if (ret)
+		dev_dbg(dev, "can't read the dir register offset!\n");
+
+	priv->dir_reg_offset <<= 3;
 
 	priv->chip.parent = dev;
 	priv->chip.owner = THIS_MODULE;
-- 
2.32.0


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

* Re: [PATCH] gpio: syscon: Remove usage of syscon_regmap_lookup_by_compatible
  2022-04-20  6:51 [PATCH] gpio: syscon: Remove usage of syscon_regmap_lookup_by_compatible Alexander Shiyan
@ 2022-04-22 21:54 ` Linus Walleij
  2022-05-02  8:43 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2022-04-22 21:54 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: linux-gpio, Bartosz Golaszewski

On Wed, Apr 20, 2022 at 8:51 AM Alexander Shiyan
<eagle.alexander923@gmail.com> wrote:

> Since version 5.13, the standard syscon bindings have been added
> to all clps711x DT nodes, so we can now use the more general
> syscon_regmap_lookup_by_phandle function to get the syscon pointer.
>
> This patch removes the usage of the syscon_regmap_lookup_by_compatible
> function as it is no longer used in the driver.
>
> Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>

Nice!

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH] gpio: syscon: Remove usage of syscon_regmap_lookup_by_compatible
  2022-04-20  6:51 [PATCH] gpio: syscon: Remove usage of syscon_regmap_lookup_by_compatible Alexander Shiyan
  2022-04-22 21:54 ` Linus Walleij
@ 2022-05-02  8:43 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2022-05-02  8:43 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: open list:GPIO SUBSYSTEM, Linus Walleij

On Wed, Apr 20, 2022 at 8:51 AM Alexander Shiyan
<eagle.alexander923@gmail.com> wrote:
>
> Since version 5.13, the standard syscon bindings have been added
> to all clps711x DT nodes, so we can now use the more general
> syscon_regmap_lookup_by_phandle function to get the syscon pointer.
>
> This patch removes the usage of the syscon_regmap_lookup_by_compatible
> function as it is no longer used in the driver.
>
> Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
> ---

Applied, thanks!

Bart

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

end of thread, other threads:[~2022-05-02  8:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20  6:51 [PATCH] gpio: syscon: Remove usage of syscon_regmap_lookup_by_compatible Alexander Shiyan
2022-04-22 21:54 ` Linus Walleij
2022-05-02  8:43 ` Bartosz Golaszewski

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.