From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9813320FAAA; Sun, 24 Mar 2024 23:08:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321684; cv=none; b=tjnNOIrOMuYQytS0yyouoaMMj66Ofk1XAaC5+ACwEdiYsW77rd99a8OKFIRLvBR75S+8RWCf1x1IOF9s2fCU2D5ZLcOaSpCCVV3vrkMQ3pt6Gw3HoukDSzKTgaDyokpVxAGrPGzSJdD7sWW7aN+YORX17udhulFVKjlr+iLRRqU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711321684; c=relaxed/simple; bh=PtAQUABtyxDZgdlJVsykILPS9lA4896XsifrH3VUvDw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WQzVvSvrOnUzZd+2Ab0iAHdEc5PhRxBkoUl92WGO1lBdoehygJeVAP2UWG9DNyGEZyYcGKuwJDZPOeBn3w+J9e9GjYpkUPFY32pHy1/abvt/1eaLHyO0L2L20BumHBi85uUL1WN6xvJ9cfR18ODZZ8XHCXjkYniWRhKP+V5r2S4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Dh62Ej4q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Dh62Ej4q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46A31C433F1; Sun, 24 Mar 2024 23:08:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711321683; bh=PtAQUABtyxDZgdlJVsykILPS9lA4896XsifrH3VUvDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dh62Ej4qfMtBVWZ0mfrwaR5AD9hlBC89hzeDCCit5Z0JP9vfYwXwojtHSPdPxF99F WnG0nkMUWNd4tjMuiMnvmCaiuFjhwydoiYYz3/9ova3mDHpkxeHqiDrVuUrEcbtLMM C2SSkk9KFm4uEHx+Pf8Zvk3a0u3VCXYlZ2xns8QfYhimZ7/ornp2L9Kp10V38nkF0W F5O9o+WDTLT3FbWSUes8VH+ZQgtSQ/f5kVj4OG9HOcaBUay0ROdeQtDM6sOK3GZ4Qr QDvf98kd0PDeqJSV6yltRx0WWx9PBwYEGiq6HDS7SkAsVfatpDGiiUJlZOQyME9gcA pft1VzFy+a7Gg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Jerome Brunet , Arnd Bergmann , Justin Stitt , Mark Brown , Sasha Levin Subject: [PATCH 6.6 411/638] ASoC: meson: aiu: fix function pointer type mismatch Date: Sun, 24 Mar 2024 18:57:28 -0400 Message-ID: <20240324230116.1348576-412-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324230116.1348576-1-sashal@kernel.org> References: <20240324230116.1348576-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Jerome Brunet [ Upstream commit 98ac85a00f31d2e9d5452b825a9ed0153d934043 ] clang-16 warns about casting functions to incompatible types, as is done here to call clk_disable_unprepare: sound/soc/meson/aiu.c:243:12: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 243 | (void(*)(void *))clk_disable_unprepare, The pattern of getting, enabling and setting a disable callback for a clock can be replaced with devm_clk_get_enabled(), which also fixes this warning. Fixes: 6ae9ca9ce986 ("ASoC: meson: aiu: add i2s and spdif support") Reported-by: Arnd Bergmann Signed-off-by: Jerome Brunet Reviewed-by: Justin Stitt Link: https://msgid.link/r/20240213215807.3326688-2-jbrunet@baylibre.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/meson/aiu.c | 19 ++++--------------- sound/soc/meson/aiu.h | 1 - 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c index 7109b81cc3d0a..5d1419ed7a62d 100644 --- a/sound/soc/meson/aiu.c +++ b/sound/soc/meson/aiu.c @@ -212,11 +212,12 @@ static const char * const aiu_spdif_ids[] = { static int aiu_clk_get(struct device *dev) { struct aiu *aiu = dev_get_drvdata(dev); + struct clk *pclk; int ret; - aiu->pclk = devm_clk_get(dev, "pclk"); - if (IS_ERR(aiu->pclk)) - return dev_err_probe(dev, PTR_ERR(aiu->pclk), "Can't get the aiu pclk\n"); + pclk = devm_clk_get_enabled(dev, "pclk"); + if (IS_ERR(pclk)) + return dev_err_probe(dev, PTR_ERR(pclk), "Can't get the aiu pclk\n"); aiu->spdif_mclk = devm_clk_get(dev, "spdif_mclk"); if (IS_ERR(aiu->spdif_mclk)) @@ -233,18 +234,6 @@ static int aiu_clk_get(struct device *dev) if (ret) return dev_err_probe(dev, ret, "Can't get the spdif clocks\n"); - ret = clk_prepare_enable(aiu->pclk); - if (ret) { - dev_err(dev, "peripheral clock enable failed\n"); - return ret; - } - - ret = devm_add_action_or_reset(dev, - (void(*)(void *))clk_disable_unprepare, - aiu->pclk); - if (ret) - dev_err(dev, "failed to add reset action on pclk"); - return ret; } diff --git a/sound/soc/meson/aiu.h b/sound/soc/meson/aiu.h index 393b6c2307e49..0f94c8bf60818 100644 --- a/sound/soc/meson/aiu.h +++ b/sound/soc/meson/aiu.h @@ -33,7 +33,6 @@ struct aiu_platform_data { }; struct aiu { - struct clk *pclk; struct clk *spdif_mclk; struct aiu_interface i2s; struct aiu_interface spdif; -- 2.43.0