From patchwork Mon Jan 2 11:41:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 638813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C004C3DA7A for ; Mon, 2 Jan 2023 11:42:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232686AbjABLmM (ORCPT ); Mon, 2 Jan 2023 06:42:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232666AbjABLmA (ORCPT ); Mon, 2 Jan 2023 06:42:00 -0500 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D91D6E80 for ; Mon, 2 Jan 2023 03:41:58 -0800 (PST) Received: by mail-lf1-x12b.google.com with SMTP id bt23so24592511lfb.5 for ; Mon, 02 Jan 2023 03:41:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ot07odIMBdi99ZptGGtgBesy1j3BRGxC/hcJ0N+TCxs=; b=ROrZRy6C2QbxPLI+6Vx8HBTPv6HMBgAkapWo4sNLlX5XPiqHt6cS/4G2lfiTCCQmUj pGJ0nRz91ehp4Po8Du+hLVqytJyUgi90OkhcfIv0jKwYu4ZfVVt8MxDUZmQH5FORMLSW 67wHSUpVcnXxIT0LsIhhTdu3JD/UxQ9HrbZc7Ep98ixE7tTtP3o7Xw3OSIqwMNjnf9jH ZlJ3UOr7X3M/fcDlNiUneZk2HyBMw6rLHFMI1zFTWVsIrRxzWj/XJ21W8o9WqBpcVnl9 HcUGI6MVNFYOGKxf9p4soTjaWJKwHlvEhG+4qPrFw+/9Cz+vQ16xPrV/AjN/u1Fezuvk SHvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ot07odIMBdi99ZptGGtgBesy1j3BRGxC/hcJ0N+TCxs=; b=I6t3tbsM7EPFLTX/Wfpehlfw7FwDl2q4T/OP88K6sXoKZCEZXsh5CzagSsJFeN6+W/ FyHD6PZ9CZywcv10y4Jhb9YmDgvqBi6fPKOdcJF56PRhs0VkqeivpzjUr6AkAJQubA/F tfBzN3I+KGNpVaoag4doja5+zgOYD4YW9H26/XYQ/B/dBuoNmXLmkrKCA/eA/m0KP3pb fAaVjg3djFZEJxfMgiaX8Jrao/k8bx+hOFKhw4gaR4BArSSH4tanXqPeWGESqTYZEuto zMAH+482tSsyLqdBvkEQZKM3qZjpifo/6tHWa1Cl+5Hin59wi6J7QVJ5Lr+YJTOwe0ER tIfA== X-Gm-Message-State: AFqh2koq+33OSF2R+Xi953FS9nAQtebIiVmf40ld6rqnQOXvG8FoAz+c pgCONaG6kOC1xgBlnBqCuc2pNA== X-Google-Smtp-Source: AMrXdXvnjqG2Y/pyr5nZjYWE9uLYb988hSA8gSfnRbitymR+6iWVJQzN6BffnHeN7xCV/A4uvftQNA== X-Received: by 2002:a19:f517:0:b0:4c3:35b3:9a0e with SMTP id j23-20020a19f517000000b004c335b39a0emr9440867lfb.56.1672659717229; Mon, 02 Jan 2023 03:41:57 -0800 (PST) Received: from krzk-bin.NAT.warszawa.vectranet.pl (088156142067.dynamic-2-waw-k-3-2-0.vectranet.pl. [88.156.142.67]) by smtp.gmail.com with ESMTPSA id c20-20020ac24154000000b0048a8c907fe9sm4356397lfi.167.2023.01.02.03.41.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 03:41:56 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/8] ASoC: codecs: wsa883x: Simplify &pdev->dev in probe Date: Mon, 2 Jan 2023 12:41:45 +0100 Message-Id: <20230102114152.297305-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- sound/soc/codecs/wsa883x.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/codecs/wsa883x.c b/sound/soc/codecs/wsa883x.c index 966ba4909204..8d69ed340e83 100644 --- a/sound/soc/codecs/wsa883x.c +++ b/sound/soc/codecs/wsa883x.c @@ -1375,7 +1375,7 @@ static int wsa883x_probe(struct sdw_slave *pdev, struct device *dev = &pdev->dev; int ret; - wsa883x = devm_kzalloc(&pdev->dev, sizeof(*wsa883x), GFP_KERNEL); + wsa883x = devm_kzalloc(dev, sizeof(*wsa883x), GFP_KERNEL); if (!wsa883x) return -ENOMEM; @@ -1388,17 +1388,17 @@ static int wsa883x_probe(struct sdw_slave *pdev, if (ret) return dev_err_probe(dev, ret, "Failed to enable vdd regulator\n"); - wsa883x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown", + wsa883x->sd_n = devm_gpiod_get_optional(dev, "powerdown", GPIOD_FLAGS_BIT_NONEXCLUSIVE | GPIOD_OUT_HIGH); if (IS_ERR(wsa883x->sd_n)) { - ret = dev_err_probe(&pdev->dev, PTR_ERR(wsa883x->sd_n), + ret = dev_err_probe(dev, PTR_ERR(wsa883x->sd_n), "Shutdown Control GPIO not found\n"); goto err; } - dev_set_drvdata(&pdev->dev, wsa883x); + dev_set_drvdata(dev, wsa883x); wsa883x->slave = pdev; - wsa883x->dev = &pdev->dev; + wsa883x->dev = dev; wsa883x->sconfig.ch_count = 1; wsa883x->sconfig.bps = 1; wsa883x->sconfig.direction = SDW_DATA_DIR_RX; @@ -1413,7 +1413,7 @@ static int wsa883x_probe(struct sdw_slave *pdev, wsa883x->regmap = devm_regmap_init_sdw(pdev, &wsa883x_regmap_config); if (IS_ERR(wsa883x->regmap)) { gpiod_direction_output(wsa883x->sd_n, 1); - ret = dev_err_probe(&pdev->dev, PTR_ERR(wsa883x->regmap), + ret = dev_err_probe(dev, PTR_ERR(wsa883x->regmap), "regmap_init failed\n"); goto err; } @@ -1423,7 +1423,7 @@ static int wsa883x_probe(struct sdw_slave *pdev, pm_runtime_set_active(dev); pm_runtime_enable(dev); - ret = devm_snd_soc_register_component(&pdev->dev, + ret = devm_snd_soc_register_component(dev, &wsa883x_component_drv, wsa883x_dais, ARRAY_SIZE(wsa883x_dais));