From patchwork Sat Aug 27 11:42:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12956994 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 ED7ABECAAD2 for ; Sat, 27 Aug 2022 11:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zhOvMo8crCwc83PCE9yPA+5gT29a+t96Ff1vnrbR/QY=; b=mqtFOaibBcVK7w8EK8JQ88R819 MVPMLaTdEoc/M8iRwM/drsEKmRl/sTexsO0wloKE+EiF6M16dSkGUHpqavEoiNAz40w6gPuhYYuoG CRYAN60V+L9rT13oyhhT6A5hmFJCFy5G7nXjrrxJZ0GZwu85pi2RWjeVIBOP8J+CZM175ku3RHich oHvJ98yK/TAMVav7Y5xXnqMOkG2rEcwQ6qMDg+UDaMn2j+j4enAyV+qANER2/wN8Sa++5PFuluohA Ktls2FCZCO1d5NYyfBvfP9A7b02UP5juHiPaq+gpv5SQSCvwBXJ1Pe8tZNiGLqsoRtsCiGRL7S+pq XX2lWf0Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRuCm-008zgj-H4; Sat, 27 Aug 2022 11:42:24 +0000 Received: from smtp-12.smtpout.orange.fr ([80.12.242.12] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRuCb-008zZp-GA for linux-mediatek@lists.infradead.org; Sat, 27 Aug 2022 11:42:14 +0000 Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id RuCVouLLlvbzbRuCVotLzE; Sat, 27 Aug 2022 13:42:10 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 27 Aug 2022 13:42:10 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: broonie@kernel.org, matthias.bgg@gmail.com, gregkh@linuxfoundation.org, neil@brown.name, blogic@openwrt.org Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 1/4] spi: mt7621: Fix an error message in mt7621_spi_probe() Date: Sat, 27 Aug 2022 13:42:07 +0200 Message-Id: <928f3fb507d53ba0774df27cea0bbba4b055993b.1661599671.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220827_044213_709937_72DD8DC3 X-CRM114-Status: GOOD ( 11.62 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 'status' is known to be 0 at this point. The expected error code is PTR_ERR(clk). Switch to dev_err_probe() in order to display the expected error code (in a human readable way). This also filters -EPROBE_DEFER cases, should it happen. Fixes: 1ab7f2a43558 ("staging: mt7621-spi: add mt7621 support") Signed-off-by: Christophe JAILLET Reviewed-by: Matthias Brugger Reviewed-by: AngeloGioacchino Del Regno --- drivers/spi/spi-mt7621.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-mt7621.c b/drivers/spi/spi-mt7621.c index b4b9b7309b5e..351b0ef52bbc 100644 --- a/drivers/spi/spi-mt7621.c +++ b/drivers/spi/spi-mt7621.c @@ -340,11 +340,9 @@ static int mt7621_spi_probe(struct platform_device *pdev) return PTR_ERR(base); clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(clk)) { - dev_err(&pdev->dev, "unable to get SYS clock, err=%d\n", - status); - return PTR_ERR(clk); - } + if (IS_ERR(clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(clk), + "unable to get SYS clock\n"); status = clk_prepare_enable(clk); if (status) From patchwork Sat Aug 27 11:42:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12956995 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 B79E4ECAAD2 for ; Sat, 27 Aug 2022 11:42:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=p349nESm6zuHc7TMCtHIOxkTvvK6qC0QPhMyWTzoaAc=; b=UFKZ2iJf+6CFypb80hqDx1iGFB WtvWCl6F46dzduycdkZDv0Ydkupy0RoInO+e54L2pMDHthfDjwccT9lH4h/X0N0mISDWFQs8ofozv knK2bkDTxDB7uT/32RyepL6fvJh/+VwCj/WZTwVFhL2TQ2/9fW616BI4bjXMRPWcmvfLUBhFyA16y bIByCQS6QhRTSrOqI/lQUvSrOP1xkUxkTBYksCusWRiPeGwzLp49Qa8xFhl+sQN20GQZSfxf9Tk8D E4KGkIMM2yrempXnB9QC7eM4H1ytHWsVaRGRlKfDjElqSu/+EdtluwzPn3H0hJMN0PZZrDdkqjRN5 +GSCVSJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRuCq-008zmU-42; Sat, 27 Aug 2022 11:42:28 +0000 Received: from smtp01.smtpout.orange.fr ([80.12.242.123] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRuCm-008zfz-Dx for linux-mediatek@lists.infradead.org; Sat, 27 Aug 2022 11:42:26 +0000 Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id RuCioaXfqLFqbRuCioufxe; Sat, 27 Aug 2022 13:42:21 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 27 Aug 2022 13:42:21 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: broonie@kernel.org, matthias.bgg@gmail.com, gregkh@linuxfoundation.org, neil@brown.name, blogic@openwrt.org Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 2/4] spi: mt7621: Use the devm_clk_get_enabled() helper to simplify error handling Date: Sat, 27 Aug 2022 13:42:19 +0200 Message-Id: <05a7fd22719008c8a905d6328aa9548ce40f2a7a.1661599671.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220827_044224_651293_94583AB9 X-CRM114-Status: GOOD ( 14.97 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The devm_clk_get_enabled() helper: - calls devm_clk_get() - calls clk_prepare_enable() and registers what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This helper is well suited for cases where the clock would be kept prepared or enabled for the whole lifetime of the driver. This simplifies the error handling a lot. The order between spi_unregister_controller() (in the remove function) and the clk_disable_unprepare() (now handle by a managed resource) is kept the same. (see commit 46b5c4fb87ce ("spi: mt7621: Don't leak SPI master in probe error path") to see why it matters) Signed-off-by: Christophe JAILLET Reviewed-by: Matthias Brugger Reviewed-by: AngeloGioacchino Del Regno --- The order with devm_spi_release_controller() (which undoes devm_spi_alloc_master()) is reversed, but I don't think it is an issue. --- drivers/spi/spi-mt7621.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/spi/spi-mt7621.c b/drivers/spi/spi-mt7621.c index 351b0ef52bbc..2580b28042be 100644 --- a/drivers/spi/spi-mt7621.c +++ b/drivers/spi/spi-mt7621.c @@ -327,7 +327,6 @@ static int mt7621_spi_probe(struct platform_device *pdev) struct spi_controller *master; struct mt7621_spi *rs; void __iomem *base; - int status = 0; struct clk *clk; int ret; @@ -339,19 +338,14 @@ static int mt7621_spi_probe(struct platform_device *pdev) if (IS_ERR(base)) return PTR_ERR(base); - clk = devm_clk_get(&pdev->dev, NULL); + clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(clk)) return dev_err_probe(&pdev->dev, PTR_ERR(clk), "unable to get SYS clock\n"); - status = clk_prepare_enable(clk); - if (status) - return status; - master = devm_spi_alloc_master(&pdev->dev, sizeof(*rs)); if (!master) { dev_info(&pdev->dev, "master allocation failed\n"); - clk_disable_unprepare(clk); return -ENOMEM; } @@ -376,13 +370,10 @@ static int mt7621_spi_probe(struct platform_device *pdev) ret = device_reset(&pdev->dev); if (ret) { dev_err(&pdev->dev, "SPI reset failed!\n"); - clk_disable_unprepare(clk); return ret; } ret = spi_register_controller(master); - if (ret) - clk_disable_unprepare(clk); return ret; } @@ -390,13 +381,10 @@ static int mt7621_spi_probe(struct platform_device *pdev) static int mt7621_spi_remove(struct platform_device *pdev) { struct spi_controller *master; - struct mt7621_spi *rs; master = dev_get_drvdata(&pdev->dev); - rs = spi_controller_get_devdata(master); spi_unregister_controller(master); - clk_disable_unprepare(rs->clk); return 0; } From patchwork Sat Aug 27 11:42:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12956996 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 6BD40ECAAD2 for ; Sat, 27 Aug 2022 11:43:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=a0PRij+SL4wQUfaCEgDjRngRmtlDHBwKf08I6E/KIO8=; b=ge5HapRqCOqksTpjBUa33/VUac hUy31jUR808lqdR2qthS9nP/IOnjGIgb1C7DqBDl9oUuBFY8VISE98rIWvw/AQ0P+Vq3P15Ru+GZ8 iYFeQ8GZ/YlSn8yhCHgfPYhlqHBMugFp6dJ3ywhKIab8B1O3IhjeBoInHrLNBWXDM92dpkNRBmpq/ 73pzmbgR4laVWuwICuT2QgxaQXZugHQXRF3w2Qg45A/BNTVL4KXRif1Ub7C8RztvXB3yE83qSnC+t ogiLAXmxRYGtvNcwFYwrbTt+aZxjcJzer/v9hgwD+SzFFkWo2cc4Wx6mF3+pIzkXXEjx1BIS/+54I 0qdfxaoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRuDV-0090UT-SI; Sat, 27 Aug 2022 11:43:09 +0000 Received: from smtp-22.smtpout.orange.fr ([80.12.242.22] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRuD4-008zry-9r for linux-mediatek@lists.infradead.org; Sat, 27 Aug 2022 11:42:43 +0000 Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id RuCroZ8bM5V1hRuCsopt76; Sat, 27 Aug 2022 13:42:33 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 27 Aug 2022 13:42:33 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: broonie@kernel.org, matthias.bgg@gmail.com, gregkh@linuxfoundation.org, neil@brown.name, blogic@openwrt.org Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 3/4] spi: mt7621: Use devm_spi_register_controller() Date: Sat, 27 Aug 2022 13:42:29 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220827_044242_555545_42FB13AE X-CRM114-Status: GOOD ( 12.63 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Now that clk_disable_unprepare(clk) is handled with a managed resource, we can use devm_spi_register_controller() and axe the .remove function. The order between spi_unregister_controller() and clk_disable_unprepare() is still the same. (see commit 46b5c4fb87ce ("spi: mt7621: Don't leak SPI master in probe error path") to see why it matters) Signed-off-by: Christophe JAILLET Reviewed-by: Matthias Brugger --- I guess that the dev_set_drvdata() in the probe can be removed as-well. But it is also harmless to leave it as-is. --- drivers/spi/spi-mt7621.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/spi/spi-mt7621.c b/drivers/spi/spi-mt7621.c index 2580b28042be..114f98dcae5e 100644 --- a/drivers/spi/spi-mt7621.c +++ b/drivers/spi/spi-mt7621.c @@ -373,20 +373,7 @@ static int mt7621_spi_probe(struct platform_device *pdev) return ret; } - ret = spi_register_controller(master); - - return ret; -} - -static int mt7621_spi_remove(struct platform_device *pdev) -{ - struct spi_controller *master; - - master = dev_get_drvdata(&pdev->dev); - - spi_unregister_controller(master); - - return 0; + return devm_spi_register_controller(&pdev->dev, master); } MODULE_ALIAS("platform:" DRIVER_NAME); @@ -397,7 +384,6 @@ static struct platform_driver mt7621_spi_driver = { .of_match_table = mt7621_spi_match, }, .probe = mt7621_spi_probe, - .remove = mt7621_spi_remove, }; module_platform_driver(mt7621_spi_driver); From patchwork Sat Aug 27 11:42:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12956997 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 10BCAC0502E for ; Sat, 27 Aug 2022 11:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pbxrRp1evwFc20WFeXZbEJKJb1zjP4hvMQ6Xd+syTH0=; b=ep00Kv1NFUVNMhyjtKO1pPFUCz TqHCa0B10vEzODng73NS72bcvfyTynRZCI3uTP43N1F1ClR4K1V1OC5H6sNDmcsBd2FqwM72wEk+B BwmztxobP42Y5f9Klnz+3pp70TbTJeT6mE9JCFMfydqXytsE9AjGCHoAImuWV+1pGBSNOwYy8sOtF KhpG9kYSLkqEJ9ywT6aMF3AKwdz3HA0iXSjG9tDmJcspxAMG83DyJATReY9UhVtdJs1PzGYo2xdUF rGw2E0vHaHI96p0qmKWtlruaVpkIIDAZMPXCzc85q4MXXgxXPPxsvn/lIRP1YILqV1oYCXtILACJb zoWbQHcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRuDX-0090VO-3X; Sat, 27 Aug 2022 11:43:11 +0000 Received: from smtp08.smtpout.orange.fr ([80.12.242.130] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRuD8-00906e-Ib for linux-mediatek@lists.infradead.org; Sat, 27 Aug 2022 11:42:48 +0000 Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id RuD2oYf3rUoLVRuD3oSO9F; Sat, 27 Aug 2022 13:42:42 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 27 Aug 2022 13:42:42 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: broonie@kernel.org, matthias.bgg@gmail.com, gregkh@linuxfoundation.org, neil@brown.name, blogic@openwrt.org Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 4/4] spi: mt7621: Remove 'clk' from 'struct mt7621_spi' Date: Sat, 27 Aug 2022 13:42:40 +0200 Message-Id: <76ed0ef91479498b9a2d5ef539f80851cffdb4ea.1661599671.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220827_044246_806324_70807698 X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The 'clk' field in 'struct mt7621_spi' is useless, remove it. Signed-off-by: Christophe JAILLET --- drivers/spi/spi-mt7621.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/spi/spi-mt7621.c b/drivers/spi/spi-mt7621.c index 114f98dcae5e..c4cc8e2f85e2 100644 --- a/drivers/spi/spi-mt7621.c +++ b/drivers/spi/spi-mt7621.c @@ -55,7 +55,6 @@ struct mt7621_spi { void __iomem *base; unsigned int sys_freq; unsigned int speed; - struct clk *clk; int pending_write; }; @@ -361,9 +360,8 @@ static int mt7621_spi_probe(struct platform_device *pdev) rs = spi_controller_get_devdata(master); rs->base = base; - rs->clk = clk; rs->master = master; - rs->sys_freq = clk_get_rate(rs->clk); + rs->sys_freq = clk_get_rate(clk); rs->pending_write = 0; dev_info(&pdev->dev, "sys_freq: %u\n", rs->sys_freq);