Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1537929pxb; Fri, 1 Apr 2022 17:01:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwm6yC1CmVeWQhWrH5HEy5kOHy6im89VoFC6OnApspBAztDI+aTfOXg0tyYiHwC8wOOEVMJ X-Received: by 2002:a05:6402:2342:b0:419:e86:c7d5 with SMTP id r2-20020a056402234200b004190e86c7d5mr23276354eda.92.1648857691495; Fri, 01 Apr 2022 17:01:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648857691; cv=none; d=google.com; s=arc-20160816; b=gldL7QluLCbA+ox8OU25bWK5ILIPjAuHZM0nMvvN1GtA3EJhJJIkOB8NK9H4hTbVt2 e9L0BepTzHKbUp75HlF5FvS6dstcFzG3I/f5qSCuS1qp7UOXQ1B15DfY5G3wFeaK1J+X bMrf1P00IEy/qEFjrkVhStsdPhze487WZPOHz3w+uJ2eYJblhGh7GYNDcrX5LZXr4cVu w7gx72VbCi8nuQnxMBtaAbZh+hof7ujS9Ex2PFAfSj8jOaGVyOfxoaGlP5d7z0H7afwV HCeX6o+Biwzo+fuFbOk6Esx1B47noooi5cAEYmJceoRANeCfOxPcvFLqnns5yp3/99JV jk9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :dkim-signature; bh=O97j9GQOAINPJ4PUtw5YlWh6uos4yu/dAJzWaEkyLNU=; b=U858gat6mI9PV68iYLeEmn37JunppicjylzvXkVlrDNLqAsERGDAsVbQgH2Qt7HRn/ w89ck6MNSV1mqmIUxfw3MN9jtOzzCj4q0N8XIXfn/kkSX7JQUcqE5q7NO3SKSaMRfAXl FnlCbzRoUSoB8Y0xsyp/T+QvPRvSHyQUXS+U9ozi+1XIyUWH2ZQbeOA/RPwfQl9VDZh8 Mu3x3F9zFT6v90II6K8Lq64cdHmgoS+lx5n61kFzaJNRgjrGxM/T4YkL+Ri2omKpJ5Q4 5AcZKf9GFR+KI8IJkP4B/2b72N8l016yZF9muH/FPeb1pqq82KmXxPZ5iLBGr2Oeo7IR bqDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=dNaRR+sT; 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 w11-20020a056402268b00b00418c2b5bd9csi2613948edd.126.2022.04.01.17.00.56; Fri, 01 Apr 2022 17:01:31 -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=@walle.cc header.s=mail2016061301 header.b=dNaRR+sT; 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 S240210AbiCaQqc (ORCPT + 99 others); Thu, 31 Mar 2022 12:46:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239201AbiCaQqb (ORCPT ); Thu, 31 Mar 2022 12:46:31 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F00F021547E; Thu, 31 Mar 2022 09:44:43 -0700 (PDT) Received: from ssl.serverraum.org (web.serverraum.org [172.16.0.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id E5E2F22239; Thu, 31 Mar 2022 18:44:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1648745082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O97j9GQOAINPJ4PUtw5YlWh6uos4yu/dAJzWaEkyLNU=; b=dNaRR+sTs8mzmKT44ZWXrgiQVfYxYRo4btdARxKvF0TcAuBr1n5JvDQPnVAwvLM4lfJfu1 9EgxakJZf+ztWgmBK9KJmRBvwzZxiVP2SPbVIjtEqyTRf3pZoZScfB/vU59HAn9z+pqHzm HGYb/fbDkVXGyNeLP7RQeLrGP4nKADk= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 31 Mar 2022 18:44:41 +0200 From: Michael Walle To: Andrew Lunn 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 In-Reply-To: References: <20220331151440.3643482-1-michael@walle.cc> <20220331151440.3643482-3-michael@walle.cc> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <6f67f53e262bf6eb93a3db572b966f9e@walle.cc> X-Sender: michael@walle.cc X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, 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 Am 2022-03-31 18:28, schrieb Andrew Lunn: >> @@ -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. Oh yes, agreed. -michael