From patchwork Tue Mar 31 08:57:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 228699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8D68C2D0EF for ; Tue, 31 Mar 2020 09:02:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7EB09208E0 for ; Tue, 31 Mar 2020 09:02:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645349; bh=DgDqi8cEBElxJzK0lL7sf2xDwK9UfCXAY8lCEVZWOWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=zbdabAIeMBnR8MLCocMqh/lGv13Ppw0na/Q53Bf580a22fC9KbxdnA+6vc4OB8apr bdDZIePvZlg3232A5fE3wnubLDCMp2gvASjC4IthwmG3qdlPqtVlf02boSObtZnoQg XN2FaoCVbuRXt/2vS5n/oNdppa7C+WIMLpMaZLxA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730710AbgCaJC2 (ORCPT ); Tue, 31 Mar 2020 05:02:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:41944 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730704AbgCaJC0 (ORCPT ); Tue, 31 Mar 2020 05:02:26 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C8D9D208E0; Tue, 31 Mar 2020 09:02:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645346; bh=DgDqi8cEBElxJzK0lL7sf2xDwK9UfCXAY8lCEVZWOWI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rxo/OG2H6Xh1auII3j+RNQr7EtHZCoRIb+GgREMB9c/GVTLjfp5ZEbhYIirkcWnI7 hnv3r9X3gr8RAp33Yqzlo4hSLUTlAxTv+X3A/n90P6ykaFZVGKWeni0h7/enJd4Faj k6RRZkucsOozexG0B5i9USKKzRmfrfDgGhuyp1ao= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andre Przywara , Andrew Lunn , Florian Fainelli , "David S. Miller" Subject: [PATCH 5.5 025/170] net: phy: mdio-bcm-unimac: Fix clock handling Date: Tue, 31 Mar 2020 10:57:19 +0200 Message-Id: <20200331085426.752610605@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Andre Przywara [ Upstream commit c312c7818b86b663d32ec5d4b512abf06b23899a ] The DT binding for this PHY describes an *optional* clock property. Due to a bug in the error handling logic, we are actually ignoring this clock *all* of the time so far. Fix this by using devm_clk_get_optional() to handle this clock properly. Fixes: b78ac6ecd1b6b ("net: phy: mdio-bcm-unimac: Allow configuring MDIO clock divider") Signed-off-by: Andre Przywara Reviewed-by: Andrew Lunn Acked-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/mdio-bcm-unimac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/net/phy/mdio-bcm-unimac.c +++ b/drivers/net/phy/mdio-bcm-unimac.c @@ -242,11 +242,9 @@ static int unimac_mdio_probe(struct plat return -ENOMEM; } - priv->clk = devm_clk_get(&pdev->dev, NULL); - if (PTR_ERR(priv->clk) == -EPROBE_DEFER) + priv->clk = devm_clk_get_optional(&pdev->dev, NULL); + if (IS_ERR(priv->clk)) return PTR_ERR(priv->clk); - else - priv->clk = NULL; ret = clk_prepare_enable(priv->clk); if (ret)