From patchwork Tue Feb 13 21:58:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13555770 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD375C48260 for ; Tue, 13 Feb 2024 21:58:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rbDU5Ee00c7ubh9P7iL5SqjrKsAcT8MIber0HfkKlUI=; b=nepcmJwKPOG8xs h52D7ge3Tn/5TRWJ8NWR0ooSm2Lp2VQegZ4EvaDPoMwcLzOt191w93laWQSOVRE0msj+5pN5go/Pd 9IyswnTUWO3klGrOJAti8swpMBg4pWRvqjV8wqkqnC4xG2fdGBmRjFqSTaDS3A5NutoF/mUUS4+FV 2QzPQRk5Z/rU05pC61tKA/134xqR/CtDk96ug+a/6Hp5FPA+tNa2vSXZPsstWtEVAdMX2XAe0YwmN Qj/d7RqYC4ft/QpDUf0J+AaxHKdIT7VQ2amy3NWHuN3RXazb5GPPmZj83ZzddMpv7tuE8JV/BJg4p WSBO9PgkL1uNbLqHrCkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ra0nM-0000000Awc1-0SUh; Tue, 13 Feb 2024 21:58:28 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ra0nC-0000000AwXQ-3XxG for linux-arm-kernel@lists.infradead.org; Tue, 13 Feb 2024 21:58:21 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4108cbd92b9so26936555e9.1 for ; Tue, 13 Feb 2024 13:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1707861497; x=1708466297; darn=lists.infradead.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=fqyuBahTPLTAYF+110cUFRV0sBjf6cZZgU9lFVSbKt0=; b=Vkb1Hts2iG5HPxmQI51EX+mo2A3LnMkrKER4N+NK6YiV/K7YMkb9mtrbqzzNlMSKUj AsGsm6ogqL2uSKU4HD3/2giFXMOkos/mXKuZvZ1pVmL/WRqL8sGeMvcO6CKuO1aEmA/l S6NksFkgNsYNKojfSvnECI7z45t9GJsFx0I+J6D/eFfLORAD/04vF/8Kf47x+T+rK/7p xjPWp8gdO1zB6gQhub8x2vZ/oNKM6fxSnezKJS5ZJOB1tfX95+8AFoQ2jUUI7U41GHRr QviP9hEp2jawmq1tMR88UlSHdi2Vb5IA6Tu0hJ7HTsIqq9a4w+I95MepoGiVV6JEd6G9 YrhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707861497; x=1708466297; 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=fqyuBahTPLTAYF+110cUFRV0sBjf6cZZgU9lFVSbKt0=; b=XoNmDDjkihVO8wct39uVDf93rflWMCQwnc7F4fKNs974Kkya+wsHxy/W+FYoVgAUM3 GhmnBtuSgkRrwBHWYvkXyOmyduqxd4pMAaEaYp1uRJWYOb+atn6580bUMN96qXBopWKZ fvFmK27RAK0z4uQh/hACPM4OxLpAs8oFHbfFJB7mBV97NjoYnSbxznAYDcX30Y2DCuKD hWkWvbu8+l8XjLJ6bbshjtQQJotBA48P6/XzkVRMEEo0ZGaKuha7PUmiSiSJBmMEWm8V KJ/Z9vrX1tCu0zpvhrOLzu96+7gOMW/8mDM+6L8gZ6m4fQHH6+M5zxmgs6B5rjUkFC5w EBgg== X-Forwarded-Encrypted: i=1; AJvYcCWQHSAQwRL5mDohKcB3G1UxvAxLTaXDjlBwy2xNk14DDkHcUiQs6pkoXGDWy8D/IOSRV2mXnK6HP1c9LbWmDsTx1MAj3nHtmbYN597JpVfMh1qNJT0= X-Gm-Message-State: AOJu0Yw9vAjz48rPYPDRRNRA6W9y2upw0k2Sbmcv3er5PGeqRxoZ+PxH iYgEBFm/rY19MlS6bo7hs+/oroq8pwi4z4AMb3oEeSJyOasZ9vZZFIAXcgUum48= X-Google-Smtp-Source: AGHT+IFQmIg0n0GJLfQcjyAmY5aOtHbpVk0kKAcJWpMWmARHiy2H/vQt8V6epQv+QeBGgNL4tEMGfw== X-Received: by 2002:a5d:6ac3:0:b0:33c:e2d9:ad36 with SMTP id u3-20020a5d6ac3000000b0033ce2d9ad36mr369591wrw.20.1707861497019; Tue, 13 Feb 2024 13:58:17 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXatIVkhfi4XEgXz5p/gNLbo1vWmEs55v5qyHuI9D0zr8zRt8TJ8ZvxAEkAOJ8a3kznQNaB9CwA0yXFBxNMvj53rHwJ036OVmcocDuLVPfg+PhWLsrC9mlRpniTJxWwH6grCm6vDtmEPJKmWES7/cqSCgpdP/SP1XUCZZN/cAwDr9J27u3hbZyUxvljt3BMCZHmzTpd0QV0bB1cqVdFgl8r1MWmfH7UPkPZq5G2SLjKlWyYV1Bny7ioTDZ9a0tYFo0aVVX3mZT8YahfGGdNcI0a2y2v5rR2Q//H/EU2oWk+rBkR2RDeq8lDwto1myB3M5HTP7it3hesDm99vHUtWHz2n2VKv4Q4O3O2jjAJiuJUqYaCCLIdo0fHDM/dFr/tAaBy30Q6tJz0fcYSUXI8mhoAxW/AWT/oJ1y9vKLuEWj5f8/2i42oUMG6NlN/UzLWMOBw3vS/ecrqYiEobhSloI9qEMgg2SNdaAJXIWgEP2QA8Ev5ZO4piJzUKTZcua59IhWs2zPvSJydJocUe7HdqVKGsdBiuUkwwPb1YyCR9TYWE9OrWora9hpg0mrQsWDgwKLvGk2X3utxRuNVkTTdirRufduCj547YWj/gaQCGXx+o44FtvU= Received: from toaster.lan ([2a01:e0a:3c5:5fb1:af6b:4350:776e:dcda]) by smtp.googlemail.com with ESMTPSA id r3-20020adfca83000000b0033cdbe335bcsm2415244wrh.71.2024.02.13.13.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:58:16 -0800 (PST) From: Jerome Brunet To: Mark Brown Cc: Jerome Brunet , Arnd Bergmann , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Neil Armstrong , Kevin Hilman , Martin Blumenstingl , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , 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 v2 1/2] ASoC: meson: aiu: fix function pointer type mismatch Date: Tue, 13 Feb 2024 22:58:03 +0100 Message-ID: <20240213215807.3326688-2-jbrunet@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240213215807.3326688-1-jbrunet@baylibre.com> References: <20240213215807.3326688-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240213_135818_916546_7DD47BDE X-CRM114-Status: GOOD ( 15.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 7109b81cc3d0..5d1419ed7a62 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 393b6c2307e4..0f94c8bf6081 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; From patchwork Tue Feb 13 21:58:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13555769 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 585BFC4829A for ; Tue, 13 Feb 2024 21:58:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DuvsGfDy3ixrhcdHx49C0ouIZFSXAsyu6tyG/bVCsXY=; b=IlMVfH0bwQnu/q Cm0GJ8UTICDTR9C61XUmjVXByhHFwAqvlIVT+wdGrANzzN7DLJ84/M28Nyq/hZH8NtvrbDhT+uNS9 xhgsiKjShZBJ3v8tn6TKXexGiJYruCj3febYTGxt/WeUJr5bD8/O86T8SQ6+j2x71gysZcI4gDZVA YpYzNNcdFD4f5y2SgSrn1pUhhsdZVJU3x1jTkKltTx1xaTMx6ryLi6ZFZLnj7HEG0pOU/OlnmyNQa ju55JQNWra6uq0Bzu5KLq+YpcCHklslS80vRYPvShLsnGZP0ty95nsJCUwAP15ZU7QjWIqo2RTj9l 3tvLoA3+rCff33nthJig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ra0nN-0000000Awcc-0sEQ; Tue, 13 Feb 2024 21:58:29 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ra0nD-0000000AwXq-3WzC for linux-arm-kernel@lists.infradead.org; Tue, 13 Feb 2024 21:58:21 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3394ca0c874so3289623f8f.2 for ; Tue, 13 Feb 2024 13:58:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1707861498; x=1708466298; darn=lists.infradead.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=QhlnphO38kFK64rZw6/MYfY4vE6pLo1I8JNTrKfTc6I=; b=CEtk1Vj+zCzVtbNiHoXG8Qkf7tT4LqgZa17StUj7Iq9Iu9ZUaQaZxLn1WVn+FOJv/3 o0BAz9NgW8koc7zG/kEhgQN4ar3PMWIN+4GNnUBSjcM9D+7Xba59MGIS2hH8rLY0q8J8 zs6dm7IYXcC1GNaLQRD25MNzdO875QZcyKrWdcGtOD8YbxK6DXllNP+smbRtvVucYUQ+ 6W0fxGn2DpVriWXridYYJGjwEwIq1jTEw2VcnUT8ZEJl900Ko7b5XSA2khY4GGnQIXri Y8S/FcAHJuO7jbDamGrjk2BADb+PAFSUaBA7UtMFtpHawAcrcKF4kbd5mWAWjtEkGHMP k9fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707861498; x=1708466298; 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=QhlnphO38kFK64rZw6/MYfY4vE6pLo1I8JNTrKfTc6I=; b=IKWbeWdVDgPU1JTjayclB0LKiuNA+M/OhQqFwaz+kaF/tVZ4Ewl0JUvlJ4QiSCa6oc Ju+7QnDGHWwf2xOgXy+tFrb76htTUOEDyjVocQnYUK5LIcCR9FxPH6aAf4JrPfW54252 xfO6Nb/sEDH93CK1FN5ywUk8cdcR2kGi9PqPVwIgF8LBH6Ovcs/EiREq8x/MEM5X5q25 UyBVoTVHS7b4KqvZp5KjuD/3+cWlhG5pWq5OqzR0SEi3K7NN4AUBGXUnmb4WFZB4S42/ H88tkRbuKyLen7nB1fqj2FvGbGwMun1OSN3ij6FxXARQpt/qwZuSt1Nia122DwrWDrR4 noOw== X-Forwarded-Encrypted: i=1; AJvYcCW4SAjYJPlWOgLRSCgLZ3YP8cLwXXzFpjXBa+uDSe+i9WC8ug9YVmqRAvOhGe08s2AKZ0/j4LrLcSW1XsceBi6afC7dnzy3D3aOFn02axOqQDFR2/I= X-Gm-Message-State: AOJu0YzD9gxQv2y4JRzXkPd6+HNfQmDIjVdTvHG7Fk3EtGf+s39B0cP6 WhKb38UJFgu+0kjSsOFM3G8wQfmJ3/EMpETyDuaSsVCf7ifLJvgXBc63/RGrkjM= X-Google-Smtp-Source: AGHT+IFZ3n4e4596jcQPvb4/M0w5BxopAfbxvEnr7lIBU6iDbCf0cnXOAXxypGjN46bUXfIJV5p8/Q== X-Received: by 2002:a05:6000:8c:b0:33b:eef:86bf with SMTP id m12-20020a056000008c00b0033b0eef86bfmr388447wrx.25.1707861498107; Tue, 13 Feb 2024 13:58:18 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVJ0VVy771lMRNflwR2yXi3R6/+dub54OOGnNJcvbuYIcEQsS5QlZrroSyMaWyijwq5c2hC2NvAD1pLPuWErPD4resXTwAhLmgxRmddslpV+8WAJTZhqazEat8FROH6ieAWumwv9lwt2Yn+FPrC6KmppIxwT/69asnfrePkZYVyJm3MK8h6ONvWc4IVBliqIFds5PZnsuGbkN5YWb7v+EZ3lPaVlx8GQXS98E5BHdIkhe2fksr9g6fEQtBkmWZfjgIWHMdjABQC/Deor8k9BzNBZ/jZxeieUroSwXKpwXdAHo9GV7XRnDmuBhbRO+C92L59xtUs95jer13d1n3ZBFTan8/bDFyhPVJtW6W85pRJdzcG8SMhFTgzPnvTI9XyGvrfPCYEwTn2530CpHXZlnm58uKPeqEc/f4S8CjWah4EKiga/vB75UKu5a61ol+z+cTSNM2/+4nM0LDdsn3Xe02hOUew7hU8xN0JxTWaapP3O2LfNImUG8yZiMxgbypKxrbgjYv0pwfGsy5NiexdQymHchYp1g1/WlBYRa30jRBImDVuDC3qnO+VtTeO4PfPh4VlA4esexQfeGrSzLs05LRvxWwnxHyNEIOclcbc1msQ1BOqA/4= Received: from toaster.lan ([2a01:e0a:3c5:5fb1:af6b:4350:776e:dcda]) by smtp.googlemail.com with ESMTPSA id r3-20020adfca83000000b0033cdbe335bcsm2415244wrh.71.2024.02.13.13.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 13:58:17 -0800 (PST) From: Jerome Brunet To: Mark Brown Cc: Jerome Brunet , Arnd Bergmann , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Neil Armstrong , Kevin Hilman , Martin Blumenstingl , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , 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 v2 2/2] ASoC: meson: t9015: fix function pointer type mismatch Date: Tue, 13 Feb 2024 22:58:04 +0100 Message-ID: <20240213215807.3326688-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240213215807.3326688-1-jbrunet@baylibre.com> References: <20240213215807.3326688-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240213_135819_904835_6E2D9A8F X-CRM114-Status: GOOD ( 14.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org clang-16 warns about casting functions to incompatible types, as is done here to call clk_disable_unprepare: 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, 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: 33901f5b9b16 ("ASoC: meson: add t9015 internal DAC driver") Reported-by: Arnd Bergmann Signed-off-by: Jerome Brunet Reviewed-by: Justin Stitt --- sound/soc/meson/t9015.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c index 9c6b4dac6893..571f65788c59 100644 --- a/sound/soc/meson/t9015.c +++ b/sound/soc/meson/t9015.c @@ -48,7 +48,6 @@ #define POWER_CFG 0x10 struct t9015 { - struct clk *pclk; struct regulator *avdd; }; @@ -249,6 +248,7 @@ static int t9015_probe(struct platform_device *pdev) struct t9015 *priv; void __iomem *regs; struct regmap *regmap; + struct clk *pclk; int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); @@ -256,26 +256,14 @@ static int t9015_probe(struct platform_device *pdev) return -ENOMEM; platform_set_drvdata(pdev, priv); - priv->pclk = devm_clk_get(dev, "pclk"); - if (IS_ERR(priv->pclk)) - return dev_err_probe(dev, PTR_ERR(priv->pclk), "failed to get core clock\n"); + pclk = devm_clk_get_enabled(dev, "pclk"); + if (IS_ERR(pclk)) + return dev_err_probe(dev, PTR_ERR(pclk), "failed to get core clock\n"); priv->avdd = devm_regulator_get(dev, "AVDD"); if (IS_ERR(priv->avdd)) return dev_err_probe(dev, PTR_ERR(priv->avdd), "failed to AVDD\n"); - ret = clk_prepare_enable(priv->pclk); - if (ret) { - dev_err(dev, "core clock enable failed\n"); - return ret; - } - - ret = devm_add_action_or_reset(dev, - (void(*)(void *))clk_disable_unprepare, - priv->pclk); - if (ret) - return ret; - ret = device_reset(dev); if (ret) { dev_err(dev, "reset failed\n");