alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment
@ 2021-12-02 20:56 Andy Shevchenko
  2021-12-02 20:56 ` [PATCH v1 2/2] ASoC: ti: davinci-mcasp: Remove unnecessary conditional Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andy Shevchenko @ 2021-12-02 20:56 UTC (permalink / raw)
  To: Peter Ujfalusi, alsa-devel, linux-kernel
  Cc: Takashi Iwai, Liam Girdwood, Mark Brown, Andy Shevchenko, Peter Ujfalusi

GPIO library does copy the of_node from the parent device of
the GPIO chip, there is no need to repeat this in the individual
drivers. Remove assignment here.

For the details one may look into the of_gpio_dev_init() implementation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 sound/soc/ti/davinci-mcasp.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index 56a19eeec5c7..81c1ccec5904 100644
--- a/sound/soc/ti/davinci-mcasp.c
+++ b/sound/soc/ti/davinci-mcasp.c
@@ -2230,9 +2230,6 @@ static int davinci_mcasp_init_gpiochip(struct davinci_mcasp *mcasp)
 	mcasp->gpio_chip = davinci_mcasp_template_chip;
 	mcasp->gpio_chip.label = dev_name(mcasp->dev);
 	mcasp->gpio_chip.parent = mcasp->dev;
-#ifdef CONFIG_OF_GPIO
-	mcasp->gpio_chip.of_node = mcasp->dev->of_node;
-#endif
 
 	return devm_gpiochip_add_data(mcasp->dev, &mcasp->gpio_chip, mcasp);
 }
-- 
2.33.0


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

* [PATCH v1 2/2] ASoC: ti: davinci-mcasp: Remove unnecessary conditional
  2021-12-02 20:56 [PATCH v1 1/2] ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment Andy Shevchenko
@ 2021-12-02 20:56 ` Andy Shevchenko
  2021-12-03 14:46   ` Péter Ujfalusi
  2021-12-03 14:45 ` [PATCH v1 1/2] ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment Péter Ujfalusi
  2021-12-06 18:00 ` Mark Brown
  2 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2021-12-02 20:56 UTC (permalink / raw)
  To: Peter Ujfalusi, alsa-devel, linux-kernel
  Cc: Takashi Iwai, Liam Girdwood, Mark Brown, Andy Shevchenko, Peter Ujfalusi

Instead of double validating of_node, return value of
the boolean property directly.

We can't remove ifdeffery, because in OF_GPIO=n cases
it might bring unwanted surprises.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 sound/soc/ti/davinci-mcasp.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index 81c1ccec5904..3e105caac95e 100644
--- a/sound/soc/ti/davinci-mcasp.c
+++ b/sound/soc/ti/davinci-mcasp.c
@@ -1870,12 +1870,10 @@ static int mcasp_reparent_fck(struct platform_device *pdev)
 static bool davinci_mcasp_have_gpiochip(struct davinci_mcasp *mcasp)
 {
 #ifdef CONFIG_OF_GPIO
-	if (mcasp->dev->of_node &&
-	    of_property_read_bool(mcasp->dev->of_node, "gpio-controller"))
-		return true;
-#endif
-
+	return of_property_read_bool(mcasp->dev->of_node, "gpio-controller");
+#else
 	return false;
+#endif
 }
 
 static int davinci_mcasp_get_config(struct davinci_mcasp *mcasp,
-- 
2.33.0


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

* Re: [PATCH v1 1/2] ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment
  2021-12-02 20:56 [PATCH v1 1/2] ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment Andy Shevchenko
  2021-12-02 20:56 ` [PATCH v1 2/2] ASoC: ti: davinci-mcasp: Remove unnecessary conditional Andy Shevchenko
@ 2021-12-03 14:45 ` Péter Ujfalusi
  2021-12-03 16:25   ` Andy Shevchenko
  2021-12-06 18:00 ` Mark Brown
  2 siblings, 1 reply; 6+ messages in thread
From: Péter Ujfalusi @ 2021-12-03 14:45 UTC (permalink / raw)
  To: Andy Shevchenko, Peter Ujfalusi, alsa-devel, linux-kernel
  Cc: Takashi Iwai, Mark Brown, Liam Girdwood



On 02/12/2021 22:56, Andy Shevchenko wrote:
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove assignment here.

Thanks, looks good,
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>

> For the details one may look into the of_gpio_dev_init() implementation.

Which works after commit 1df62542e0161.

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  sound/soc/ti/davinci-mcasp.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
> index 56a19eeec5c7..81c1ccec5904 100644
> --- a/sound/soc/ti/davinci-mcasp.c
> +++ b/sound/soc/ti/davinci-mcasp.c
> @@ -2230,9 +2230,6 @@ static int davinci_mcasp_init_gpiochip(struct davinci_mcasp *mcasp)
>  	mcasp->gpio_chip = davinci_mcasp_template_chip;
>  	mcasp->gpio_chip.label = dev_name(mcasp->dev);
>  	mcasp->gpio_chip.parent = mcasp->dev;
> -#ifdef CONFIG_OF_GPIO
> -	mcasp->gpio_chip.of_node = mcasp->dev->of_node;
> -#endif
>  
>  	return devm_gpiochip_add_data(mcasp->dev, &mcasp->gpio_chip, mcasp);
>  }
> 

-- 
Péter

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

* Re: [PATCH v1 2/2] ASoC: ti: davinci-mcasp: Remove unnecessary conditional
  2021-12-02 20:56 ` [PATCH v1 2/2] ASoC: ti: davinci-mcasp: Remove unnecessary conditional Andy Shevchenko
@ 2021-12-03 14:46   ` Péter Ujfalusi
  0 siblings, 0 replies; 6+ messages in thread
From: Péter Ujfalusi @ 2021-12-03 14:46 UTC (permalink / raw)
  To: Andy Shevchenko, Peter Ujfalusi, alsa-devel, linux-kernel
  Cc: Takashi Iwai, Mark Brown, Liam Girdwood



On 02/12/2021 22:56, Andy Shevchenko wrote:
> Instead of double validating of_node, return value of
> the boolean property directly.

Nice cleanup, thanks,
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>

> We can't remove ifdeffery, because in OF_GPIO=n cases
> it might bring unwanted surprises.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  sound/soc/ti/davinci-mcasp.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
> index 81c1ccec5904..3e105caac95e 100644
> --- a/sound/soc/ti/davinci-mcasp.c
> +++ b/sound/soc/ti/davinci-mcasp.c
> @@ -1870,12 +1870,10 @@ static int mcasp_reparent_fck(struct platform_device *pdev)
>  static bool davinci_mcasp_have_gpiochip(struct davinci_mcasp *mcasp)
>  {
>  #ifdef CONFIG_OF_GPIO
> -	if (mcasp->dev->of_node &&
> -	    of_property_read_bool(mcasp->dev->of_node, "gpio-controller"))
> -		return true;
> -#endif
> -
> +	return of_property_read_bool(mcasp->dev->of_node, "gpio-controller");
> +#else
>  	return false;
> +#endif
>  }
>  
>  static int davinci_mcasp_get_config(struct davinci_mcasp *mcasp,
> 

-- 
Péter

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

* Re: [PATCH v1 1/2] ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment
  2021-12-03 14:45 ` [PATCH v1 1/2] ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment Péter Ujfalusi
@ 2021-12-03 16:25   ` Andy Shevchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Andy Shevchenko @ 2021-12-03 16:25 UTC (permalink / raw)
  To: Péter Ujfalusi
  Cc: alsa-devel, Liam Girdwood, Takashi Iwai, linux-kernel,
	Peter Ujfalusi, Mark Brown

On Fri, Dec 03, 2021 at 04:45:31PM +0200, Péter Ujfalusi wrote:
> On 02/12/2021 22:56, Andy Shevchenko wrote:
> > GPIO library does copy the of_node from the parent device of
> > the GPIO chip, there is no need to repeat this in the individual
> > drivers. Remove assignment here.
> 
> Thanks, looks good,
> Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>

Thanks!

> > For the details one may look into the of_gpio_dev_init() implementation.
> 
> Which works after commit 1df62542e0161.

Actually even before that.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v1 1/2] ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment
  2021-12-02 20:56 [PATCH v1 1/2] ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment Andy Shevchenko
  2021-12-02 20:56 ` [PATCH v1 2/2] ASoC: ti: davinci-mcasp: Remove unnecessary conditional Andy Shevchenko
  2021-12-03 14:45 ` [PATCH v1 1/2] ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment Péter Ujfalusi
@ 2021-12-06 18:00 ` Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2021-12-06 18:00 UTC (permalink / raw)
  To: Andy Shevchenko, alsa-devel, Peter Ujfalusi, linux-kernel
  Cc: Liam Girdwood, Peter Ujfalusi, Takashi Iwai

On Thu, 2 Dec 2021 22:56:11 +0200, Andy Shevchenko wrote:
> GPIO library does copy the of_node from the parent device of
> the GPIO chip, there is no need to repeat this in the individual
> drivers. Remove assignment here.
> 
> For the details one may look into the of_gpio_dev_init() implementation.
> 
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment
      commit: 4db32072b8ab18a8b90191c57c74f42d00bf9991
[2/2] ASoC: ti: davinci-mcasp: Remove unnecessary conditional
      commit: c1a77ba466c0dd0bdf1ec2bbebb8996d7cd7b8f7

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

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

end of thread, other threads:[~2021-12-06 18:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02 20:56 [PATCH v1 1/2] ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment Andy Shevchenko
2021-12-02 20:56 ` [PATCH v1 2/2] ASoC: ti: davinci-mcasp: Remove unnecessary conditional Andy Shevchenko
2021-12-03 14:46   ` Péter Ujfalusi
2021-12-03 14:45 ` [PATCH v1 1/2] ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment Péter Ujfalusi
2021-12-03 16:25   ` Andy Shevchenko
2021-12-06 18:00 ` 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).