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 83493C678DB for ; Tue, 7 Mar 2023 18:19:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232647AbjCGSTo (ORCPT ); Tue, 7 Mar 2023 13:19:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232642AbjCGSTR (ORCPT ); Tue, 7 Mar 2023 13:19:17 -0500 Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B2519CBF3 for ; Tue, 7 Mar 2023 10:13:39 -0800 (PST) Received: by mail-yb1-xb2b.google.com with SMTP id k199so12319548ybf.4 for ; Tue, 07 Mar 2023 10:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1678212818; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=sH8Wy2Ph761evbKn3y8LG62Tu+KFGePC7gyj4o8USOA=; b=UP+9D9GXzLCgcmXQGGP3q3C7u1PkefkqLS6Z1ClEa+/CqKo0BvvfXz/JK/Q5wudRSn 1yp2x3C8D6SoTMFYgu48Iiw0jbJTYQ+FdXJI5zrU2mZouLp25QtUpORoSQxRMiLFiS3W oqykigITON7KiL+ujyvz4/10HWi1gjPYtlHzM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678212818; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sH8Wy2Ph761evbKn3y8LG62Tu+KFGePC7gyj4o8USOA=; b=GWPlP2VXxWOgH2hHUdu+nu7cxJItat8kjAZHyPmw44WFmItikoZECrgyiB8rKLYIEH d9cqyUrEgrrB/bFarK0xAOwuugTIWZ9E1uMqmi1Wt/FItk53y3aqnPrTCaUGPXDycRnR GFGbTlI7ZmXGvZkREf7U37g2aJSxDXJbrinPOcNk5bSENmlUMH4slwPM3fqT+DcaJhbn pIliraTT718OAVPgCmD2dSZa1xlpQob/fy5sVE7Wk1D7cErLy625fITti+rILCFa6W+v mv2w42LZRSPv6TXn5OXOpMXxFta/Jy0P5cJlSt5NmB07s6ra9lPaccnSHD0e+QcfnH7c uWgw== X-Gm-Message-State: AO0yUKU6qak+uYwS59eAKQOG+3+b3lkuPhpul0DJt3V6eYz+yaI0f2d9 ysGrwoZycVZVxfldSWnoNE1BEpeiKC5PyDqOmDpHsg== X-Google-Smtp-Source: AK7set+Aj6jA4kMXw9p7vsPELm43cnWFvS3/a2HCzpZ8bHXDixnTNPk0vbZEYb6n4LPrlpMnjWEsZHLzSPRMqZ5bTx8= X-Received: by 2002:a25:fe04:0:b0:b1a:64ba:9c9b with SMTP id k4-20020a25fe04000000b00b1a64ba9c9bmr1170204ybe.1.1678212818267; Tue, 07 Mar 2023 10:13:38 -0800 (PST) MIME-Version: 1.0 References: <20230307005028.2065800-1-grundler@chromium.org> <84094771-7f98-0d8d-fe79-7c22e15a602d@gmail.com> <20230307102931.GA25631@wunner.de> In-Reply-To: <20230307102931.GA25631@wunner.de> From: Grant Grundler Date: Tue, 7 Mar 2023 10:13:26 -0800 Message-ID: Subject: Re: [PATCH] net: asix: fix modprobe "sysfs: cannot create duplicate filename" To: Lukas Wunner Cc: Grant Grundler , Florian Fainelli , Oleksij Rempel , Pavel Skripkin , Anton Lundin , Eizan Miyamoto , Jakub Kicinski , netdev , "David S . Miller" , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 7, 2023 at 2:29=E2=80=AFAM Lukas Wunner wrote= : > > On Mon, Mar 06, 2023 at 10:10:09PM -0800, Grant Grundler wrote: > > On Mon, Mar 6, 2023 at 7:46???PM Florian Fainelli wrote: > > > On 3/6/2023 4:50 PM, Grant Grundler wrote: > > > > + priv->phydev =3D mdiobus_get_phy(priv->mdio, priv->phy_addr); > > > > + if (priv->phydev) > > > > + return 0; > > > > > > This was in ax88772_init_phy() before, why is this being moved here n= ow? > > > > Because other drivers I looked at (e.g. tg3 and r8169) do all the mdiob= us_* > > calls in one function and I wanted to have some "symmetry" > > with ax88772_release_mdio() function I added below. > > I'd suggest moving this cleanup to a separate commit so that you keep > the fix itself as small as possible and thus minimize the potential of > introducing regressions in stable kernels that will receive the fix. Ok - will do. > Also, per convention please use the if-clause to catch the error case, > not the success case. It doesn't matter if you need two or three more > lines, readability is more important IMO. Sure. No problem. The code I wrote seemed easier to read but I'm familiar with the convention and have no objection to that. I'll add the Fixes: tag as well (thanks for confirming Oleksij!) cheers, grant > > Thanks, > > Lukas