ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment
Subsystems (3)
PATCH 1/2 ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment
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.
--- sound/soc/ti/davinci-mcasp.c | 3 --- 1 file changed, 3 deletions(-)
sound/soc/ti/davinci-mcasp.c +0 -3
@@ -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); }
Signature · 1 line
2.33.0
PATCH 2/2 ASoC: ti: davinci-mcasp: Remove unnecessary conditional
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.
--- sound/soc/ti/davinci-mcasp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
sound/soc/ti/davinci-mcasp.c +3 -5
@@ -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,
Signature · 1 line
2.33.0
Quoted 3 lines · Andy Shevchenko
GPIO library does copy the
of_nodefrom the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove assignment here.
Thanks, looks good,
Quoted 1 line
For the details one may look into the
of_gpio_dev_init()implementation.
Which works after commit 1df62542e0161.
Quoted 20 lines
Signed-off-by Andy Shevchenko <[email protected]>--- sound/soc/ti/davinci-mcasp.c | 3 --- 1 file changed, 3 deletions(-)sound/soc/ti/davinci-mcasp.c +0
-3@@ -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); }
Signature · 1 line
Péter
Re: [PATCH v1 2/2] ASoC: ti: davinci-mcasp: Remove unnecessary conditional
In reply to Andy ShevchenkoQuoted 2 lines · Andy Shevchenko
Instead of double validating
of_node, return value of the boolean property directly.
Nice cleanup, thanks,
Quoted 29 lines
We can't remove ifdeffery, because in OF_GPIO=n cases it might bring unwanted surprises.
Signed-off-by Andy Shevchenko <[email protected]>--- sound/soc/ti/davinci-mcasp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)sound/soc/ti/davinci-mcasp.c +3
-5@@ -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,
Signature · 1 line
Péter
Quoted 7 lines · Péter Ujfalusi
Quoted 3 lines · Andy Shevchenko
GPIO library does copy the
of_nodefrom 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 <[email protected]>
Thanks!
Quoted 3 lines
Quoted 1 line
For the details one may look into the
of_gpio_dev_init()implementation.Which works after commit
1df62542e0161.
Actually even before that.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Mark Brown
maintainerQuoted 8 lines · Andy Shevchenko
GPIO library does copy the
of_nodefrom 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: c1a77ba466c0dd0bdf1ec2bbebb8996d7cd7b8f7All 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