未验证 提交 766cc7f1 编写于 作者: A Andy Shevchenko 提交者: Mark Brown

ASoC: zl38060: Setup parent device and get rid of unnecessary of_node assignment

Some of the drivers do not set parent device. This may lead to obstacles
during debugging or understanding the device relations from the Linux
point of view. Assign parent device for GPIO chips created by these
drivers.

While at it, let GPIO library to assign of_node from the parent device.
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20211202204838.75287-1-andriy.shevchenko@linux.intel.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 c686316e
...@@ -589,9 +589,7 @@ static int zl38_spi_probe(struct spi_device *spi) ...@@ -589,9 +589,7 @@ static int zl38_spi_probe(struct spi_device *spi)
sizeof(template_chip), GFP_KERNEL); sizeof(template_chip), GFP_KERNEL);
if (!priv->gpio_chip) if (!priv->gpio_chip)
return -ENOMEM; return -ENOMEM;
#ifdef CONFIG_OF_GPIO priv->gpio_chip->parent = dev;
priv->gpio_chip->of_node = dev->of_node;
#endif
err = devm_gpiochip_add_data(dev, priv->gpio_chip, priv->regmap); err = devm_gpiochip_add_data(dev, priv->gpio_chip, priv->regmap);
if (err) if (err)
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册