Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1489462pxj; Fri, 4 Jun 2021 16:22:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNcJm5b30bdF2t9G1skovjJKJOKZXBJqTc9YuOAtEdaptG2ELdZ6qGxU5Sf0X81Ghyj10b X-Received: by 2002:a17:906:36d4:: with SMTP id b20mr6578418ejc.44.1622848925337; Fri, 04 Jun 2021 16:22:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622848925; cv=none; d=google.com; s=arc-20160816; b=c3YbZyC+LkaVT1iW+2AqlhSX/VTE4v4EvEzKfr4MNWhtWoeiOMDoDy+j/09S9l048K DKYXSAny9Lmh8XT4iwHkaGEM0m3CGzz4+J99OkyjNnKxfihtE+KlW1qOuKwJRGUuOJGg aih2kH34HRdfqyuUa1iv0CzU5YKYjc+s12lSqpEHEsVZiYvThtv7HFivOhNN1bPLNZse 1tyxgREDjzaXu67GY6X90k+81/TKwMO89ksGl7A0NV6pG/ivrs0AsWlEE7flMR739BIP Vt/bULSr3TUHkUXNjmFqliTfazviFWTvNqm7eCL8WjDYIh0760cCKx95Vkj2L8pGNTdB B2uA== 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=qVV8qeSIgXZgYx6qo+sfC+ri7bZ6M6hZ5swJC0d7/1s=; b=KPo7GooiCXeHBWubbysuim09z24adEGp37VA+KiX4wFTWhxeDF6AlmiIME4zYOLC4i aw7oqKkJP9PqI6IQiqvmR172kuWMZMpf41zq1M/SzjGeHj5aOS7BTWNiE+hlDaTSUUHz pCqVyvhhh35TJwg8iqpF7jnOHI94jMZKjR6JsBG3XizydVM4KxS8sI2f9s8xzj9qvpq2 4882Ld8WvMlQQpFo/7k8mDgwJ9WOwInYIzCjWff3V64uSBqusHD25whcdHSY2qeaEnBf vm1W+uCDsl7ufbxNQERMZg7TzqsV0aIug/RmuPW8VslDyknPYVuFGhrVUReTAcJ5v9Do z9zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=jYz0XMOU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m27si5806438ejn.391.2021.06.04.16.21.42; Fri, 04 Jun 2021 16:22:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=jYz0XMOU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231805AbhFDXUu (ORCPT + 99 others); Fri, 4 Jun 2021 19:20:50 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:46370 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbhFDXUt (ORCPT ); Fri, 4 Jun 2021 19:20:49 -0400 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=qVV8qeSIgXZgYx6qo+sfC+ri7bZ6M6hZ5swJC0d7/1s=; b=jYz0XMOU+2IjXqq1h/OMvND2K2 YqhABUP1u9GjhGB8/ntVj8S1zTa2WcRzPyo8aj0blaEpltsJcJC12XKDWcUGmRdj6yccRlZ50f/LD UNPq7KNZO5oKz4F4q0fbNQirEjtCsuqWabmfB6vXKp7ZjdatTVdnJXABJntQ5OoZZRYQ=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1lpJ5d-007sJt-IP; Sat, 05 Jun 2021 01:18:57 +0200 Date: Sat, 5 Jun 2021 01:18:57 +0200 From: Andrew Lunn To: Oleksij Rempel Cc: "David S. Miller" , Jakub Kicinski , Heiner Kallweit , Russell King , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net-next v1 2/7] net: usb: asix: ax88772: add phylib support Message-ID: References: <20210604134244.2467-1-o.rempel@pengutronix.de> <20210604134244.2467-3-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210604134244.2467-3-o.rempel@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 04, 2021 at 03:42:39PM +0200, Oleksij Rempel wrote: > To be able to use ax88772 with external PHYs and use advantage of s/use/take/ > +/* MDIO read and write wrappers for phylib */ > +int asix_mdio_bus_read(struct mii_bus *bus, int phy_id, int regnum) > +{ > + return asix_mdio_read(((struct usbnet *)bus->priv)->net, phy_id, > + regnum); > +} Please avoid this cast. priv should be a void *, so you can do struct usbnet *priv = bus->priv; return asix_mdio_read(priv->net, phy_id, regnum); > +static int ax88772_init_phy(struct usbnet *dev) > +{ > + struct asix_common_private *priv = dev->driver_priv; > + int ret; > + > + priv->phy_addr = asix_get_phy_addr(dev); > + /* asix_read_phy_addr() is using ret < 2 as error value */ > + if (priv->phy_addr < 2) > + return -ENODEV; Really? ax88172a.c does not check. ax88172_bind() does not check. ax88772_bind() does not check. As far as i can see, nothing really cares. So please add another cleanup patch and make asix_read_phy_addr() return -ENODEV. Otherwise, this looks O.K.