Skip to content

Commit

Permalink
ASoC: codecs: wsa881x: Simplify &pdev->dev in probe
Browse files Browse the repository at this point in the history
The probe already stores pointer to &pdev->dev, so use it to make the
code a bit easier to read.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230102114152.297305-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Krzysztof Kozlowski authored and Mark Brown committed Jan 16, 2023
1 parent d5ce5d3 commit c617c9e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sound/soc/codecs/wsa881x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,20 +1113,20 @@ static int wsa881x_probe(struct sdw_slave *pdev,
struct wsa881x_priv *wsa881x;
struct device *dev = &pdev->dev;

wsa881x = devm_kzalloc(&pdev->dev, sizeof(*wsa881x), GFP_KERNEL);
wsa881x = devm_kzalloc(dev, sizeof(*wsa881x), GFP_KERNEL);
if (!wsa881x)
return -ENOMEM;

wsa881x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown",
wsa881x->sd_n = devm_gpiod_get_optional(dev, "powerdown",
GPIOD_FLAGS_BIT_NONEXCLUSIVE);
if (IS_ERR(wsa881x->sd_n)) {
dev_err(&pdev->dev, "Shutdown Control GPIO not found\n");
return PTR_ERR(wsa881x->sd_n);
}

dev_set_drvdata(&pdev->dev, wsa881x);
dev_set_drvdata(dev, wsa881x);
wsa881x->slave = pdev;
wsa881x->dev = &pdev->dev;
wsa881x->dev = dev;
wsa881x->sconfig.ch_count = 1;
wsa881x->sconfig.bps = 1;
wsa881x->sconfig.frame_rate = 48000;
Expand All @@ -1149,7 +1149,7 @@ static int wsa881x_probe(struct sdw_slave *pdev,
pm_runtime_set_active(dev);
pm_runtime_enable(dev);

return devm_snd_soc_register_component(&pdev->dev,
return devm_snd_soc_register_component(dev,
&wsa881x_component_drv,
wsa881x_dais,
ARRAY_SIZE(wsa881x_dais));
Expand Down

0 comments on commit c617c9e

Please sign in to comment.