From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C61ADC433EF for ; Sun, 13 Mar 2022 14:44:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234647AbiCMOpT (ORCPT ); Sun, 13 Mar 2022 10:45:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233811AbiCMOpT (ORCPT ); Sun, 13 Mar 2022 10:45:19 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B04853ED0F; Sun, 13 Mar 2022 07:44:10 -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=IE4hwCJ4VUC9IKmRcRVWFekq0CQCWakqfk3Q5RvuQ8s=; b=fZVPK8NrD6HPhKeo+T2dQ3hlef c4kR+fMh1EJDEMi0MnCezl3NamqVIXFHhv/FGtw+ZbIr91HpV/sXTDblDlhwisrn8lBqzcF28oSDP c71NvmrZ59TtUMFM9ZXJ7895W3ojVZG126pgXnl56MTlj0FI9JpW77AeRk/+1KrfAUVA=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1nTPRw-00Ad7Q-AR; Sun, 13 Mar 2022 15:44:00 +0100 Date: Sun, 13 Mar 2022 15:44:00 +0100 From: Andrew Lunn To: Michael Walle Cc: "David S . Miller" , Jakub Kicinski , Rob Herring , Krzysztof Kozlowski , Heiner Kallweit , Russell King , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 3/3] et: mdio: mscc-miim: add lan966x internal phy reset support Message-ID: References: <20220313002153.11280-1-michael@walle.cc> <20220313002153.11280-4-michael@walle.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220313002153.11280-4-michael@walle.cc> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > /* When high resolution timers aren't built-in: we can't use usleep_range() as > @@ -157,27 +166,29 @@ static int mscc_miim_write(struct mii_bus *bus, int mii_id, > static int mscc_miim_reset(struct mii_bus *bus) > { > struct mscc_miim_dev *miim = bus->priv; > - int offset = miim->phy_reset_offset; > - int mask = PHY_CFG_PHY_ENA | PHY_CFG_PHY_COMMON_RESET | > - PHY_CFG_PHY_RESET; > + unsigned int offset, mask; > int ret; > > - if (miim->phy_regs) { > - ret = regmap_write(miim->phy_regs, offset, 0); > - if (ret < 0) { > - WARN_ONCE(1, "mscc reset set error %d\n", ret); > - return ret; > - } > + if (!miim->phy_regs || !miim->info) > + return 0; I would put the check for miim->info in the probe. Not checking the return value from *_get_match_data() is one of the things the bots reports and we receive patches for. You have the check, but it is hidden away, and i doubt the bot nor the bot handlers are clever enough to find it. Andrew