Message ID | 20240213101220.459641-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-63320-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp441846dyb; Tue, 13 Feb 2024 02:19:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV1e0XSHWZ8dsuI8AtHRMQJVoLtYl7nJ3yGE2n2N3UOXm3kEkImoOTJrwjSG6Vn80nTz832deilNIPci+ySA0LaM3HovA== X-Google-Smtp-Source: AGHT+IGS0SXd24ytVBrSu0WBTgxGlQN3xlBFxNF1J3wvO8PZMVPOgYMvGiB27H+CH7/s9tvJ9HPR X-Received: by 2002:a9d:6358:0:b0:6e1:73b8:d6a9 with SMTP id y24-20020a9d6358000000b006e173b8d6a9mr8464573otk.33.1707819566537; Tue, 13 Feb 2024 02:19:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707819566; cv=pass; d=google.com; s=arc-20160816; b=JQ8x79RlHNKKR0UDfdqwFV2QMZpC/2eC9EKBeFFIZBKVXyCg29PcyIub3pVGybM7iG w+d5AyoLf5S1FY2QB6VurCC7pOF1pZ1yF2/dDy80RiMacPXxRNxh6yK964zUozJFfH+x yX5vMuSaEEPSQCELnBtnLqX0GcSLrN6MyWDJ0+qPTNozC/7RV0TBIsHaIYkBEXi3gHbr yYt8fCSxWWU+1T67CJ5yxBxayH5GCq1hcqJTRRMcWtEtj7ahUMbpm7IyQBj1gUFORGgE ZdeMX15O7lAhDWoivzAizZl+wJrffERvhWkXnXzswhM93ss7Upsq6bSIwWy+ws6tv6kv NLCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=f6Ub5OzzGIvbxIAiBFDyCWqwwj5yXwT6Ofi4rz6+1yM=; fh=JOsvx7/6HSgSOyUa43DeS3f6nArUQslZoBcEBXulI2E=; b=WGoc3maxd1/FCPZ31mYEAn6q/bhvBg+FWCPaw5OJQpPLLRTBZD5+/m3eqkvHrl3/Ic hA4b8t7jbL5iX/G7oC7SFHU7+K6NP6HPS2aq5w6hS0fBZiOi7z3774PcKUoRxqsCG1x7 dstnjWwsMAUHW1rfZm5iLBHzaWe7LNxiz1lz8U6zudcqWbuE0Nz18fNyuXjvIpjXnSUr qRA3dYhhhtKl5ed+UlQuoZ2labEVUhz5LPPq/dBRelFUIPjrp5mQuTg+PAl/DwfqTurj 6Du3ABfNCjCveI1C8FRjZXAbwqUOWNaJMHIJqQe3iRqYc0jiwsVGCgBp2YKiWffbwpHa cdUQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K5QajlV1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63320-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63320-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCU1HChViQ6/NumbGsWC876wgJ8OmNm5tz5pQx3+UBxzj32Ce8W4ffuLcLILoW5UTvXURowoVpdGMKrxfwxpaGQURMM+0w== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p29-20020a637f5d000000b005d3fad648d9si1746052pgn.296.2024.02.13.02.19.26 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:19:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63320-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K5QajlV1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63320-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63320-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5F76A282107 for <ouuuleilei@gmail.com>; Tue, 13 Feb 2024 10:13:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4D5C22636; Tue, 13 Feb 2024 10:12:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="K5QajlV1" 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 29165224E6; Tue, 13 Feb 2024 10:12:28 +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=1707819149; cv=none; b=OiWP7qugw2d8KzxwVRu929eDZeLjkCcHj6EX0sFxGnsvjtFd9PoeXiOEym/tZAfVLB+hFAURUwn9oEQOgCU5UIJ/h6IjUi4M5mlv42J5T68xmE8xmNc9K2kFEcyBZfoHcde99Hx1i/1F8/Sgl5jGyHYMLwHNX/4xNOZ2eOnQRBI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707819149; c=relaxed/simple; bh=ywd10UsSv5X9PzwqZG/+YKBc+M0eD2jqf72bCCzxHWk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=gQwKMPq4EAdWqB9OKeLnPzpzES1QDfI4NM9dFUDJ/MIsDT3Zar3B2Uuy+B5O2S56Ilo/NfqSHiAjUxqmoerBOb841izLudenoWFPhHEziiUhBQtSWKslrBzfbaUTKrK9LhlQJCSDbCDi2jKt7fcrvApgisShbOUInmIEtLE3QkA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K5QajlV1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE8CCC433F1; Tue, 13 Feb 2024 10:12:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707819148; bh=ywd10UsSv5X9PzwqZG/+YKBc+M0eD2jqf72bCCzxHWk=; h=From:To:Cc:Subject:Date:From; b=K5QajlV1GWq4RfRrLAujUEthGfd1J4/FV2WEAhnBYNNYS83VXXKZZVK9zlpZSWVP4 spDptzhPgge/ohUOgNZJCavEXt2CVrTDosHIWs6o2LgQfPp/Dfgd9fHRelSs0EMT7s 6EG+p3qHVJil9fOuZfFcQEMAGTw/cjPSFaoom6UKV+8L/i4JFgdEXzT3KXo+IRAJuW c+2Fge13nZ26rX96sAbnQVXoYyGo3hsbktzqCf1NoeN15BOqRNA3GqhNnIHZQ87IjE JKC9YYTujQWktn83sCyNQNvoaRDQr0xmrgrJTsUkKvjn+lgz24AOT5beYT4fVQQZbX rkmuRxgmeY7Lw== From: Arnd Bergmann <arnd@kernel.org> To: Mark Brown <broonie@kernel.org> Cc: Arnd Bergmann <arnd@arndb.de>, Jerome Brunet <jbrunet@baylibre.com>, Liam Girdwood <lgirdwood@gmail.com>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Neil Armstrong <neil.armstrong@linaro.org>, Kevin Hilman <khilman@baylibre.com>, Martin Blumenstingl <martin.blumenstingl@googlemail.com>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Bill Wendling <morbo@google.com>, Justin Stitt <justinstitt@google.com>, alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] ASoC: meson: add helpers for clk_disable_unprepare Date: Tue, 13 Feb 2024 11:11:38 +0100 Message-Id: <20240213101220.459641-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790778609832852165 X-GMAIL-MSGID: 1790778609832852165 |
Series |
ASoC: meson: add helpers for clk_disable_unprepare
|
|
Commit Message
Arnd Bergmann
Feb. 13, 2024, 10:11 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de> Casting between incompatible function types causes a warning with clang-16 because it breaks control flow integrity (KCFI) rules: 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, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/device.h:406:34: note: expanded from macro 'devm_add_action_or_reset' 406 | __devm_add_action_or_reset(dev, action, data, #action) | ^~~~~~ sound/soc/meson/t9015.c:274:4: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 274 | (void(*)(void *))clk_disable_unprepare, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/device.h:406:34: note: expanded from macro 'devm_add_action_or_reset' 406 | __devm_add_action_or_reset(dev, action, data, #action) | ^~~~~~ These two meson drivers cast clk_disable_unprepare() into a different type in order to have it automatically called from the driver relase. Add trivial helpers to do the same using correct types. Fixes: 33901f5b9b16 ("ASoC: meson: add t9015 internal DAC driver") Fixes: 6ae9ca9ce986 ("ASoC: meson: aiu: add i2s and spdif support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- sound/soc/meson/aiu.c | 9 ++++++--- sound/soc/meson/t9015.c | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-)
Comments
On 13/02/2024 11:11, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > Casting between incompatible function types causes a warning with clang-16 > because it breaks control flow integrity (KCFI) rules: > > 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, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/device.h:406:34: note: expanded from macro 'devm_add_action_or_reset' > 406 | __devm_add_action_or_reset(dev, action, data, #action) > | ^~~~~~ > sound/soc/meson/t9015.c:274:4: error: cast from 'void (*)(struct clk *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] > 274 | (void(*)(void *))clk_disable_unprepare, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/device.h:406:34: note: expanded from macro 'devm_add_action_or_reset' > 406 | __devm_add_action_or_reset(dev, action, data, #action) > | ^~~~~~ > > These two meson drivers cast clk_disable_unprepare() into a different type > in order to have it automatically called from the driver relase. Add > trivial helpers to do the same using correct types. > > Fixes: 33901f5b9b16 ("ASoC: meson: add t9015 internal DAC driver") > Fixes: 6ae9ca9ce986 ("ASoC: meson: aiu: add i2s and spdif support") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > sound/soc/meson/aiu.c | 9 ++++++--- > sound/soc/meson/t9015.c | 9 ++++++--- > 2 files changed, 12 insertions(+), 6 deletions(-) > > diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c > index 7109b81cc3d0..211f360df284 100644 > --- a/sound/soc/meson/aiu.c > +++ b/sound/soc/meson/aiu.c > @@ -209,6 +209,11 @@ static const char * const aiu_spdif_ids[] = { > [MCLK] = "spdif_mclk_sel" > }; > > +static void aiu_clk_disable(void *clk) > +{ > + clk_disable_unprepare(clk); > +} > + > static int aiu_clk_get(struct device *dev) > { > struct aiu *aiu = dev_get_drvdata(dev); > @@ -239,9 +244,7 @@ static int aiu_clk_get(struct device *dev) > return ret; > } > > - ret = devm_add_action_or_reset(dev, > - (void(*)(void *))clk_disable_unprepare, > - aiu->pclk); > + ret = devm_add_action_or_reset(dev, aiu_clk_disable, aiu->pclk); > if (ret) > dev_err(dev, "failed to add reset action on pclk"); > > diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c > index 9c6b4dac6893..e0f9a603a5e9 100644 > --- a/sound/soc/meson/t9015.c > +++ b/sound/soc/meson/t9015.c > @@ -243,6 +243,11 @@ static const struct regmap_config t9015_regmap_config = { > .max_register = POWER_CFG, > }; > > +static void t9015_clk_disable(void *clk) > +{ > + clk_disable_unprepare(clk); > +} > + > static int t9015_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > @@ -270,9 +275,7 @@ static int t9015_probe(struct platform_device *pdev) > return ret; > } > > - ret = devm_add_action_or_reset(dev, > - (void(*)(void *))clk_disable_unprepare, > - priv->pclk); > + ret = devm_add_action_or_reset(dev, t9015_clk_disable, priv->pclk); > if (ret) > return ret; > Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
On Tue 13 Feb 2024 at 11:11, Arnd Bergmann <arnd@kernel.org> wrote: > From: Arnd Bergmann <arnd@arndb.de> > > Casting between incompatible function types causes a warning with clang-16 > because it breaks control flow integrity (KCFI) rules: > > 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, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/device.h:406:34: note: expanded from macro 'devm_add_action_or_reset' > 406 | __devm_add_action_or_reset(dev, action, data, #action) > | ^~~~~~ > sound/soc/meson/t9015.c:274:4: error: cast from 'void (*)(struct clk *)' to > 'void (*)(void *)' converts to incompatible function type > [-Werror,-Wcast-function-type-strict] > 274 | (void(*)(void *))clk_disable_unprepare, > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > include/linux/device.h:406:34: note: expanded from macro 'devm_add_action_or_reset' > 406 | __devm_add_action_or_reset(dev, action, data, #action) > | ^~~~~~ > > These two meson drivers cast clk_disable_unprepare() into a different type > in order to have it automatically called from the driver relase. Add > trivial helpers to do the same using correct types. > > Fixes: 33901f5b9b16 ("ASoC: meson: add t9015 internal DAC driver") > Fixes: 6ae9ca9ce986 ("ASoC: meson: aiu: add i2s and spdif support") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > sound/soc/meson/aiu.c | 9 ++++++--- > sound/soc/meson/t9015.c | 9 ++++++--- > 2 files changed, 12 insertions(+), 6 deletions(-) > > diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c > index 7109b81cc3d0..211f360df284 100644 > --- a/sound/soc/meson/aiu.c > +++ b/sound/soc/meson/aiu.c > @@ -209,6 +209,11 @@ static const char * const aiu_spdif_ids[] = { > [MCLK] = "spdif_mclk_sel" > }; > > +static void aiu_clk_disable(void *clk) > +{ > + clk_disable_unprepare(clk); > +} > + > static int aiu_clk_get(struct device *dev) > { > struct aiu *aiu = dev_get_drvdata(dev); > @@ -239,9 +244,7 @@ static int aiu_clk_get(struct device *dev) > return ret; > } > > - ret = devm_add_action_or_reset(dev, > - (void(*)(void *))clk_disable_unprepare, > - aiu->pclk); > + ret = devm_add_action_or_reset(dev, aiu_clk_disable, aiu->pclk); Hi Arnd, This probably pre-dates the introduction of devm_clk_get_enabled() It would probably be better to use that instead of duplicating helper functions which do the same thing. If for any reason it is not possible, a common helper in clk.h would preferable I think. > if (ret) > dev_err(dev, "failed to add reset action on pclk"); > > diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c > index 9c6b4dac6893..e0f9a603a5e9 100644 > --- a/sound/soc/meson/t9015.c > +++ b/sound/soc/meson/t9015.c > @@ -243,6 +243,11 @@ static const struct regmap_config t9015_regmap_config = { > .max_register = POWER_CFG, > }; > > +static void t9015_clk_disable(void *clk) > +{ > + clk_disable_unprepare(clk); > +} > + > static int t9015_probe(struct platform_device *pdev) > { > struct device *dev = &pdev->dev; > @@ -270,9 +275,7 @@ static int t9015_probe(struct platform_device *pdev) > return ret; > } > > - ret = devm_add_action_or_reset(dev, > - (void(*)(void *))clk_disable_unprepare, > - priv->pclk); > + ret = devm_add_action_or_reset(dev, t9015_clk_disable, priv->pclk); > if (ret) > return ret;
On Tue, Feb 13, 2024, at 11:36, Jerome Brunet wrote: > On Tue 13 Feb 2024 at 11:11, Arnd Bergmann <arnd@kernel.org> wrote: > This probably pre-dates the introduction of devm_clk_get_enabled() > It would probably be better to use that instead of duplicating helper > functions which do the same thing. Ah, I had not thought of that interface either, so you are probably right that this is the best way to do it. Can you send a replacement patch then and add my Reported-by? I also sent the same patch for drivers/nvmem/meson-efuse.c, which I guess will also need the same treatment. I also checked and saw that all three files already had this code in linux-6.0 when devm_clk_get_enabled() got added. > If for any reason it is not possible, a common helper in clk.h would > preferable I think. I can't think of anything that prevents us from using devm_clk_get_enabled() here. Arnd
On Tue 13 Feb 2024 at 11:52, "Arnd Bergmann" <arnd@arndb.de> wrote: > On Tue, Feb 13, 2024, at 11:36, Jerome Brunet wrote: >> On Tue 13 Feb 2024 at 11:11, Arnd Bergmann <arnd@kernel.org> wrote: > >> This probably pre-dates the introduction of devm_clk_get_enabled() >> It would probably be better to use that instead of duplicating helper >> functions which do the same thing. > > Ah, I had not thought of that interface either, so you are probably > right that this is the best way to do it. > Can you send a replacement patch then and add my Reported-by? Sure. How may I reproduce the problem ? Just tried with 'Debian clang version 16.0.6 (19)', no warning. I suppose I need to add something ? > > I also sent the same patch for drivers/nvmem/meson-efuse.c, which > I guess will also need the same treatment. I also checked and saw > that all three files already had this code in linux-6.0 when > devm_clk_get_enabled() got added. > >> If for any reason it is not possible, a common helper in clk.h would >> preferable I think. > > I can't think of anything that prevents us from using > devm_clk_get_enabled() here. > > Arnd
On Tue, Feb 13, 2024, at 12:09, Jerome Brunet wrote: > On Tue 13 Feb 2024 at 11:52, "Arnd Bergmann" <arnd@arndb.de> wrote: > >> On Tue, Feb 13, 2024, at 11:36, Jerome Brunet wrote: >>> On Tue 13 Feb 2024 at 11:11, Arnd Bergmann <arnd@kernel.org> wrote: >> >>> This probably pre-dates the introduction of devm_clk_get_enabled() >>> It would probably be better to use that instead of duplicating helper >>> functions which do the same thing. >> >> Ah, I had not thought of that interface either, so you are probably >> right that this is the best way to do it. >> Can you send a replacement patch then and add my Reported-by? > > Sure. > > How may I reproduce the problem ? > Just tried with 'Debian clang version 16.0.6 (19)', no warning. > > I suppose I need to add something ? The warning is currently only enabled at W=1 level until we have fixed all the existing diagnostic output. I have sent the other ones today, but for now, please test with 'make W=1'. Arnd
diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c index 7109b81cc3d0..211f360df284 100644 --- a/sound/soc/meson/aiu.c +++ b/sound/soc/meson/aiu.c @@ -209,6 +209,11 @@ static const char * const aiu_spdif_ids[] = { [MCLK] = "spdif_mclk_sel" }; +static void aiu_clk_disable(void *clk) +{ + clk_disable_unprepare(clk); +} + static int aiu_clk_get(struct device *dev) { struct aiu *aiu = dev_get_drvdata(dev); @@ -239,9 +244,7 @@ static int aiu_clk_get(struct device *dev) return ret; } - ret = devm_add_action_or_reset(dev, - (void(*)(void *))clk_disable_unprepare, - aiu->pclk); + ret = devm_add_action_or_reset(dev, aiu_clk_disable, aiu->pclk); if (ret) dev_err(dev, "failed to add reset action on pclk"); diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c index 9c6b4dac6893..e0f9a603a5e9 100644 --- a/sound/soc/meson/t9015.c +++ b/sound/soc/meson/t9015.c @@ -243,6 +243,11 @@ static const struct regmap_config t9015_regmap_config = { .max_register = POWER_CFG, }; +static void t9015_clk_disable(void *clk) +{ + clk_disable_unprepare(clk); +} + static int t9015_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -270,9 +275,7 @@ static int t9015_probe(struct platform_device *pdev) return ret; } - ret = devm_add_action_or_reset(dev, - (void(*)(void *))clk_disable_unprepare, - priv->pclk); + ret = devm_add_action_or_reset(dev, t9015_clk_disable, priv->pclk); if (ret) return ret;