From nobody Sun Nov 24 02:34:18 2024 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A51E91F1319 for ; Fri, 8 Nov 2024 10:50:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731063047; cv=none; b=iMSNd4DJWBjPum8UtS8TSmh//Rz8OIWjt8hROkg+R2kduuDKKUTvlWj5hoimHMxstD85WuISFNKdDMbUGBa6q0iNcPK6WFGtZ53Xu7XUUWWWuSRAlOkyfd51OBnd0Kqku4OJHD38H8rrk7T9E3rSOOpgw8b2KmkLojMvaPWH/rI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731063047; c=relaxed/simple; bh=NwMwmtlaT18hJnHfLU6mTOWxZRQJqMvTs4mxCmNNjKI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rb+94DVHz17rhXgPLmEcXF5LNgNMzDFwAONgclTQ5SMxH1XUhRdGeKphn4PkVy9JWbBYecuBzRvZmlMFhWW2TvKte7jjGdXXMa2IF/JmoGA84OCq3RWZO/yQEzfrZ8w7aByvKaQCDvboHpP8BDJX5U8i+SED9qoeeF9Hx9mLQpA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=WDxuLwej; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="WDxuLwej" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a99e3b3a411so522240366b.0 for ; Fri, 08 Nov 2024 02:50:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1731063044; x=1731667844; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SJOEZBvPvjW7K+H1RBTXNfb6F0+/L3JfoVyW1uUG2Ac=; b=WDxuLwejB5Tr9/xMjgdisgYk1CBr/620ZpNfeUK/go8XzGcJzNuSlTkVe6Ryn3RcqZ JRZjkdtOvWgJencYN+c76xZiMIaTgYEkbxKoO8HRPzbBAEC5cOvS5WK/IjykAb8+Liks 95GqJK3UCFzU8sfEMG10tYreTVVQb7x+w46QT6voRdvLcfcuQ/4SKcoB8s5XV2qMYKVe 9aho1W4WTjtAsHsDaxmOB/nkumlU0UGytUGO3dQDTCRTyJTgBc/dCgF8sm9mR7v7T4Db Xaoy8+6/oYxqzJKACyaQ+zFVdFo/27FeduIYmqM746JhfaALIH/aTKvL9WSAKBRJNqWj B47Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731063044; x=1731667844; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SJOEZBvPvjW7K+H1RBTXNfb6F0+/L3JfoVyW1uUG2Ac=; b=Us9XTVkAcZ2KH1HIt3I9sb3UzM4WltT9MLvj73yVKnN4qUW4C4CjHd9OKVJhAheLe7 eLE7r9pJa6j658wJEUZRUJRorQWAsoMI2oZu1Etsr9T/K4lXE6WDa/AaDswqoDmcg7JS 5b9/YQlqZdmVNNkfhoQDLsVt3L+0tlbQJqTRqzfUxzICDjnIUB1RuuZ9nM0QrwJI0SVO 77dsw0tWHsfQkVQap9L0Xaxd4Mo9den5PzGpGNw0pEoXX50ha9G5Gc0o4JCpUnRsxUKV 1fRVM/m41rza3kLjEpTFQ9BvA/Hz7nI0yoCViWbTJs5XtpP31xAe08jG0D8ytI90q3Dm 8TBA== X-Forwarded-Encrypted: i=1; AJvYcCViDOtsd25TA4mRErGIT9F1Z+bkg+1uFEZjcHOZyfdMvCisuHvPcFuCUU/FLfNevpwg1t42kTO2TLW6r/A=@vger.kernel.org X-Gm-Message-State: AOJu0Yy3BTAAGbfZOU2m2slqCEYyeLqUJBc4R1ebQ2MTSeyhzeXYatdE oOJ5QFPPr9cPI82bcncvlLg58Il8Xtvlv/jgL+OC7M0CHSAVfMpMus0OLOtgsvtHDD5sK7gzfCe 2 X-Google-Smtp-Source: AGHT+IH/99y+0YANpW/8sxDIiFKmQLtyD61rPWyljhpIaIihSrGsIz6DNWsbJUmatJ8M/8RbrS7BXA== X-Received: by 2002:a17:906:ee86:b0:a9e:c5a2:9cda with SMTP id a640c23a62f3a-a9eeca85d0emr286051066b.20.1731063044037; Fri, 08 Nov 2024 02:50:44 -0800 (PST) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.28]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9ee0dc574dsm220464866b.101.2024.11.08.02.50.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2024 02:50:43 -0800 (PST) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, biju.das.jz@bp.renesas.com, prabhakar.mahadev-lad.rj@bp.renesas.com, lgirdwood@gmail.com, broonie@kernel.org, magnus.damm@gmail.com, linus.walleij@linaro.org, perex@perex.cz, tiwai@suse.com, p.zabel@pengutronix.de Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sound@vger.kernel.org, linux-gpio@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v2 13/25] ASoC: sh: rz-ssi: Use temporary variable for struct device Date: Fri, 8 Nov 2024 12:49:46 +0200 Message-Id: <20241108104958.2931943-14-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20241108104958.2931943-1-claudiu.beznea.uj@bp.renesas.com> References: <20241108104958.2931943-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea Use a temporary variable for the struct device pointers to avoid dereferencing. Signed-off-by: Claudiu Beznea --- Changes in v2: - none sound/soc/renesas/rz-ssi.c | 62 +++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/sound/soc/renesas/rz-ssi.c b/sound/soc/renesas/rz-ssi.c index aa175803867f..2f56c63582e7 100644 --- a/sound/soc/renesas/rz-ssi.c +++ b/sound/soc/renesas/rz-ssi.c @@ -1021,36 +1021,37 @@ static const struct snd_soc_component_driver rz_ssi= _soc_component =3D { =20 static int rz_ssi_probe(struct platform_device *pdev) { + struct device *dev =3D &pdev->dev; struct rz_ssi_priv *ssi; struct clk *audio_clk; struct resource *res; int ret; =20 - ssi =3D devm_kzalloc(&pdev->dev, sizeof(*ssi), GFP_KERNEL); + ssi =3D devm_kzalloc(dev, sizeof(*ssi), GFP_KERNEL); if (!ssi) return -ENOMEM; =20 - ssi->dev =3D &pdev->dev; + ssi->dev =3D dev; ssi->base =3D devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(ssi->base)) return PTR_ERR(ssi->base); =20 ssi->phys =3D res->start; - ssi->clk =3D devm_clk_get(&pdev->dev, "ssi"); + ssi->clk =3D devm_clk_get(dev, "ssi"); if (IS_ERR(ssi->clk)) return PTR_ERR(ssi->clk); =20 - ssi->sfr_clk =3D devm_clk_get(&pdev->dev, "ssi_sfr"); + ssi->sfr_clk =3D devm_clk_get(dev, "ssi_sfr"); if (IS_ERR(ssi->sfr_clk)) return PTR_ERR(ssi->sfr_clk); =20 - audio_clk =3D devm_clk_get(&pdev->dev, "audio_clk1"); + audio_clk =3D devm_clk_get(dev, "audio_clk1"); if (IS_ERR(audio_clk)) return dev_err_probe(&pdev->dev, PTR_ERR(audio_clk), "no audio clk1"); =20 ssi->audio_clk_1 =3D clk_get_rate(audio_clk); - audio_clk =3D devm_clk_get(&pdev->dev, "audio_clk2"); + audio_clk =3D devm_clk_get(dev, "audio_clk2"); if (IS_ERR(audio_clk)) return dev_err_probe(&pdev->dev, PTR_ERR(audio_clk), "no audio clk2"); @@ -1063,13 +1064,13 @@ static int rz_ssi_probe(struct platform_device *pde= v) ssi->audio_mck =3D ssi->audio_clk_1 ? ssi->audio_clk_1 : ssi->audio_clk_2; =20 /* Detect DMA support */ - ret =3D rz_ssi_dma_request(ssi, &pdev->dev); + ret =3D rz_ssi_dma_request(ssi, dev); if (ret < 0) { - dev_warn(&pdev->dev, "DMA not available, using PIO\n"); + dev_warn(dev, "DMA not available, using PIO\n"); ssi->playback.transfer =3D rz_ssi_pio_send; ssi->capture.transfer =3D rz_ssi_pio_recv; } else { - dev_info(&pdev->dev, "DMA enabled"); + dev_info(dev, "DMA enabled"); ssi->playback.transfer =3D rz_ssi_dma_transfer; ssi->capture.transfer =3D rz_ssi_dma_transfer; } @@ -1078,7 +1079,7 @@ static int rz_ssi_probe(struct platform_device *pdev) ssi->capture.priv =3D ssi; =20 spin_lock_init(&ssi->lock); - dev_set_drvdata(&pdev->dev, ssi); + dev_set_drvdata(dev, ssi); =20 /* Error Interrupt */ ssi->irq_int =3D platform_get_irq_byname(pdev, "int_req"); @@ -1087,12 +1088,11 @@ static int rz_ssi_probe(struct platform_device *pde= v) return ssi->irq_int; } =20 - ret =3D devm_request_irq(&pdev->dev, ssi->irq_int, &rz_ssi_interrupt, - 0, dev_name(&pdev->dev), ssi); + ret =3D devm_request_irq(dev, ssi->irq_int, &rz_ssi_interrupt, + 0, dev_name(dev), ssi); if (ret < 0) { rz_ssi_release_dma_channels(ssi); - return dev_err_probe(&pdev->dev, ret, - "irq request error (int_req)\n"); + return dev_err_probe(dev, ret, "irq request error (int_req)\n"); } =20 if (!rz_ssi_is_dma_enabled(ssi)) { @@ -1104,11 +1104,11 @@ static int rz_ssi_probe(struct platform_device *pde= v) if (ssi->irq_rt < 0) return ssi->irq_rt; =20 - ret =3D devm_request_irq(&pdev->dev, ssi->irq_rt, + ret =3D devm_request_irq(dev, ssi->irq_rt, &rz_ssi_interrupt, 0, - dev_name(&pdev->dev), ssi); + dev_name(dev), ssi); if (ret < 0) - return dev_err_probe(&pdev->dev, ret, + return dev_err_probe(dev, ret, "irq request error (dma_rt)\n"); } else { if (ssi->irq_tx < 0) @@ -1117,50 +1117,50 @@ static int rz_ssi_probe(struct platform_device *pde= v) if (ssi->irq_rx < 0) return ssi->irq_rx; =20 - ret =3D devm_request_irq(&pdev->dev, ssi->irq_tx, + ret =3D devm_request_irq(dev, ssi->irq_tx, &rz_ssi_interrupt, 0, - dev_name(&pdev->dev), ssi); + dev_name(dev), ssi); if (ret < 0) - return dev_err_probe(&pdev->dev, ret, + return dev_err_probe(dev, ret, "irq request error (dma_tx)\n"); =20 - ret =3D devm_request_irq(&pdev->dev, ssi->irq_rx, + ret =3D devm_request_irq(dev, ssi->irq_rx, &rz_ssi_interrupt, 0, - dev_name(&pdev->dev), ssi); + dev_name(dev), ssi); if (ret < 0) - return dev_err_probe(&pdev->dev, ret, + return dev_err_probe(dev, ret, "irq request error (dma_rx)\n"); } } =20 - ssi->rstc =3D devm_reset_control_get_exclusive(&pdev->dev, NULL); + ssi->rstc =3D devm_reset_control_get_exclusive(dev, NULL); if (IS_ERR(ssi->rstc)) { ret =3D PTR_ERR(ssi->rstc); goto err_reset; } =20 reset_control_deassert(ssi->rstc); - pm_runtime_enable(&pdev->dev); - ret =3D pm_runtime_resume_and_get(&pdev->dev); + pm_runtime_enable(dev); + ret =3D pm_runtime_resume_and_get(dev); if (ret < 0) { - dev_err(&pdev->dev, "pm_runtime_resume_and_get failed\n"); + dev_err(dev, "pm_runtime_resume_and_get failed\n"); goto err_pm; } =20 - ret =3D devm_snd_soc_register_component(&pdev->dev, &rz_ssi_soc_component, + ret =3D devm_snd_soc_register_component(dev, &rz_ssi_soc_component, rz_ssi_soc_dai, ARRAY_SIZE(rz_ssi_soc_dai)); if (ret < 0) { - dev_err(&pdev->dev, "failed to register snd component\n"); + dev_err(dev, "failed to register snd component\n"); goto err_snd_soc; } =20 return 0; =20 err_snd_soc: - pm_runtime_put(ssi->dev); + pm_runtime_put(dev); err_pm: - pm_runtime_disable(ssi->dev); + pm_runtime_disable(dev); reset_control_assert(ssi->rstc); err_reset: rz_ssi_release_dma_channels(ssi); --=20 2.39.2