Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1123689pxb; Fri, 1 Apr 2022 05:21:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBsbm8slBM5RWZMm1ayxGhF+DpypVXhdOz88G+9iwWPK90bFamdtopQNqBG79UHFGMjLS1 X-Received: by 2002:a05:6a00:3387:b0:4fa:9063:dfed with SMTP id cm7-20020a056a00338700b004fa9063dfedmr44284822pfb.15.1648815665985; Fri, 01 Apr 2022 05:21:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648815665; cv=none; d=google.com; s=arc-20160816; b=W3sxA0HqUTUS6go5rcSM24dhtlg5EjERgmx1BwmSMNhmy7kXw9TnXplL0AMhuksK70 DKy4kEpbrJUXHyzIe7gwEef9PK2VIavPTAPBhB8h6OjwiCm6D11KfCOspnjMZWlTs9ER Rrj8ZUDMZBQYm7VFqEvd/7WJKoiRt9Calue3fo2UdR4LbiJ/kmBQ4ubfmMp+YLWXX5ZO DYXNwlKkKB5qTgr5kg5d5w9vsI8ZABYThyc7k3381nU624pK19BN/Pr349ImL9D3p2cE nLYTFc55xQttdEEn9UsaRVcc4k1g/4biUI7IZbxMTsNhG5S8t/0KjhjEG3IK8eDoneP6 p5/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=f1Ud/0ViaYH+MGCkH++baXNjD1EX24kMqzHI2gaaGxs=; b=CXBXMYrub+SoxVoIzCtIALVcWdQcb7Qakyt1zt4x9zr8BiWRUwVWG7Jz2S1YO1NLSk Dy/QrcCCNal7tM1q0UKSl5y/fYNEDxpn3JkAnb5jR3yMvRK/n+JoJyVrQNKKKQHfsN1x 8fkROcpBs/ZkibUNeDeA/FoRSXy0ZGKqSwaREKRpD5otuAoDxb5tN3Pr4eaYk0jJPQiO wve0weWq1qJ0QyBUX6oXb+Kpa1G5NgDu8BDeCl4sSfPRLyriFBTpq+1gthtOPRypKs2K ewcCNzLVPyRowJ9xRtzcEkO+k9x3iKSbjit2pOyoXeP4Hdre69agXdXSgIFUgM41hEB/ g++Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=4lrScKXg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p18-20020a170902b09200b00153b2d16435si1965051plr.61.2022.04.01.05.20.53; Fri, 01 Apr 2022 05:21:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=4lrScKXg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239943AbiCaQaK (ORCPT + 99 others); Thu, 31 Mar 2022 12:30:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233616AbiCaQaJ (ORCPT ); Thu, 31 Mar 2022 12:30:09 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 132262BE8; Thu, 31 Mar 2022 09:28:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=f1Ud/0ViaYH+MGCkH++baXNjD1EX24kMqzHI2gaaGxs=; b=4lrScKXgukeKAmWs+GkIxg97+1 RHfXVnt0Y21w75FyV8jYpfj33s4RDYd83N/aDGv2lJJkoHqVK2gMYngzvSOXtxVwauOxw/NECZQ3O PHzD60K+KvU03fhchiCe7MXrM+N276i2uG4+ZiIUeTsPaCxjKvUDn83ls0ngzpUvx5pM=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nZxeT-00DUoA-L2; Thu, 31 Mar 2022 18:28:01 +0200 Date: Thu, 31 Mar 2022 18:28:01 +0200 From: Andrew Lunn To: Michael Walle Cc: "David S . Miller" , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Heiner Kallweit , Russell King , Alexandre Belloni , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC net-next 3/3] net: phy: mscc-miim: add support to set MDIO bus frequency Message-ID: References: <20220331151440.3643482-1-michael@walle.cc> <20220331151440.3643482-3-michael@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220331151440.3643482-3-michael@walle.cc> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -295,21 +323,41 @@ static int mscc_miim_probe(struct platform_device *pdev) > if (!miim->info) > return -EINVAL; > > - ret = of_mdiobus_register(bus, pdev->dev.of_node); > + miim->clk = devm_clk_get_optional(&pdev->dev, NULL); > + if (IS_ERR(miim->clk)) > + return PTR_ERR(miim->clk); > + > + ret = clk_prepare_enable(miim->clk); > + if (ret) > + return ret; > + > + of_property_read_u32(np, "clock-frequency", &miim->clk_freq); The clock is optional if there is no "clock-frequency" property. If the property does exist, the clock should be mandatory. I don't think it should silently fail setting the bus frequency because the clock is missing. Andrew