From patchwork Sun Oct 1 11:02:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 9979667 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 56FD060365 for ; Sun, 1 Oct 2017 11:02:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 402E228A82 for ; Sun, 1 Oct 2017 11:02:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3396128AF9; Sun, 1 Oct 2017 11:02:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A663D28A82 for ; Sun, 1 Oct 2017 11:02:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=tBnUm/SkA6zUpFJ7RZNXAL6Q6eHRv5nXY+CAB4GHvgw=; b=sAgSNt7h+lUFiyi49LOiGPYCvp N0RXb/KzCOm48NUq5PpcAhSzVFA64qn26X9QUqGYqmyLgeWZ8lHH4M54I92tsO4oVO8f+FBvWfERC wZDI1DypD56LabQ8gFHv5iGnF0knDxoNolUIrhWFGye6cWsAKJO21GGIIa+DAiRBpeh2RETin2YdW BP0da8Aeu+pLomu+S94T11PlJTWN67MlIIUy0o1fqina0uLkG9dxgPRx4xcxUZAjZB5mvFGwQBnQq X0DMF7XOcoX6GLobmKlPqO1p7QPzUcWRkUUpEd+PUY/GSwJ+j7yjkpFAIdg2o0KnNExLNIXT44BJd bavH9dvw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dyc17-00051m-W7; Sun, 01 Oct 2017 11:02:38 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dyc13-0004vp-RR for linux-arm-kernel@lists.infradead.org; Sun, 01 Oct 2017 11:02:35 +0000 Received: by mail-wm0-x243.google.com with SMTP id f4so1870337wmh.4 for ; Sun, 01 Oct 2017 04:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LHSwu0kDoG8CQPwwMaYVEWdpnTLkP9tgb/I9i9hFEgQ=; b=lWxRMWQiOu9idTooLp447+ZhH72RFHwye+3eGFWcCKzmxq/wm/n7SH7Pp8hy+Yzv9W vsfz5pejNJiaCfJ4MbRVS6YsvmThFkBs5g4wzVKQOwBhTZHMye/zhJIzuzv1BDmgvRlc 2PFOOc2LxyoyctQk9rStfVuw6rRIipMZ1btoyvb5aF2eQNjk3u0+VogMKin2MVfN0JR3 doxlIs4rKBvSZMmC1fPr2jCnQPZHcvmUsx3cfcXPU8bK8wDbfIjHrg2q1KnI/IBAloNn AlHmg63vX+XBYF9lsBYY0I6HOCyverTc3tgk6EeatSccXWtmuIZWyqxXxwWHtdGRdzRf ahhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LHSwu0kDoG8CQPwwMaYVEWdpnTLkP9tgb/I9i9hFEgQ=; b=T+lCDuw8/D8Fgjsb615KAfj5SQBqip0sDcI/v9nG5V9A6d1SsddkBVpKxukUON8WFx Ubj0eGJ/5wttfcLMPAagohFz3bGL1f6nfCTkmkyQgdYINOJOb9u0I3jptNCu9xN0Rxpj GGQvkWkhMuoLdMa4ExczXYiYnLniS77dwsDu3hQLSY7aRJKJon4OG8iKOWatfo/cblIZ 5x9uVlsj5aNt4G23EByKDzU+cwvEVV+eDw29Pr+DV1pGLhTodM4VOySdQ4RwNMdozqbG q75/dHXQ7i0P/9pUMBGmualjT0ny1T7R591XxpaKwBATcgtQMdHCSDLSOstIzDt3+21e k6Iw== X-Gm-Message-State: AHPjjUgDR9aRzanss9XF5jYQ7O3wMTKeQFvzwQMQjMi9Nf4Hhi14TnRw sX1d3LExlm7dyEC9cGIsl7M= X-Google-Smtp-Source: AOwi7QDTlHlT4RFAwxj249WTl40CQD1gm2zdewJTaJKSa9LB/hwgNDdf9/8P49nZgaz+SFvyNAc7EQ== X-Received: by 10.80.216.200 with SMTP id y8mr16622060edj.24.1506855736647; Sun, 01 Oct 2017 04:02:16 -0700 (PDT) Received: from localhost.localdomain ([2001:470:9e39::48e]) by smtp.gmail.com with ESMTPSA id 26sm7404270eds.5.2017.10.01.04.02.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Oct 2017 04:02:16 -0700 (PDT) From: Jonas Gorski To: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.or Subject: [PATCH 5/6] bcm63xx_enet: drop unneeded NULL phy_clk check Date: Sun, 1 Oct 2017 13:02:19 +0200 Message-Id: <20171001110220.27668-6-jonas.gorski@gmail.com> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20171001110220.27668-1-jonas.gorski@gmail.com> References: <20171001110220.27668-1-jonas.gorski@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171001_040234_045656_5709A7E9 X-CRM114-Status: UNSURE ( 9.90 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, "David S. Miller" MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP clk_disable and clk_unprepare are NULL-safe, so need to duplicate the NULL check of the functions. Signed-off-by: Jonas Gorski --- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index 059ef4f1d137..f6bc13fe8a99 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -1903,8 +1903,7 @@ static int bcm_enet_probe(struct platform_device *pdev) out_uninit_hw: /* turn off mdc clock */ enet_writel(priv, 0, ENET_MIISC_REG); - if (priv->phy_clk) - clk_disable_unprepare(priv->phy_clk); + clk_disable_unprepare(priv->phy_clk); out_disable_clk_mac: clk_disable_unprepare(priv->mac_clk); @@ -1943,9 +1942,7 @@ static int bcm_enet_remove(struct platform_device *pdev) } /* disable hw block clocks */ - if (priv->phy_clk) - clk_disable_unprepare(priv->phy_clk); - + clk_disable_unprepare(priv->phy_clk); clk_disable_unprepare(priv->mac_clk); free_netdev(dev);