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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77B4AC43332 for ; Sun, 22 Mar 2020 07:40:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F06120774 for ; Sun, 22 Mar 2020 07:40:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584862811; bh=6OTETLA2Lkag+u/aimImFI5ux+gfx2ImiFuEDDe3dk0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=o3MTFI1YWzRfjkZisHkjAjwXdwZ9/FhsjGTfYa/Krr12fMfXBsrvKww1gw+H9M+Qi eTKKjbxV90AKOUKc04hGDd/18oUDqSIdZxuMZu495gFpcFYY9zzhdG26yGxoKt2ShH OKVeVc9HxiOv7OXm5qkgTLNH9RjlNLG0UiJER3Y4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726583AbgCVHkK (ORCPT ); Sun, 22 Mar 2020 03:40:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:60488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725769AbgCVHkK (ORCPT ); Sun, 22 Mar 2020 03:40:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D93C620753; Sun, 22 Mar 2020 07:40:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584862809; bh=6OTETLA2Lkag+u/aimImFI5ux+gfx2ImiFuEDDe3dk0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=e19y4T+ODpyqOzHH4FP8h8Ti2ztK3Ecj9Rk9WmTUNiSRMOc8sG7Ybn5g5Yibp2YxL tRUwMvufRiX0wSvfzGLI6GSJWvIupCFwJTREHuq7inZBAaTNk3h+HnsqM5fpZFZsXg 1L93YSRZv4Iq897VWMOisEDBIfXwpnbg3KWlEo4Q= Date: Sun, 22 Mar 2020 08:40:06 +0100 From: Greg KH To: Tobias Waldekranz Cc: davem@davemloft.net, netdev@vger.kernel.org, andrew@lunn.ch, f.fainelli@gmail.com, hkallweit1@gmail.com, linux-usb@vger.kernel.org Subject: Re: [PATCH v3 2/2] net: phy: add marvell usb to mdio controller Message-ID: <20200322074006.GB64528@kroah.com> References: <20200321202443.15352-1-tobias@waldekranz.com> <20200321202443.15352-2-tobias@waldekranz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200321202443.15352-2-tobias@waldekranz.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sat, Mar 21, 2020 at 09:24:43PM +0100, Tobias Waldekranz wrote: > An MDIO controller present on development boards for Marvell switches > from the Link Street (88E6xxx) family. > > Using this module, you can use the following setup as a development > platform for switchdev and DSA related work. > > .-------. .-----------------. > | USB----USB | > | SoC | | 88E6390X-DB ETH1-10 > | ETH----ETH0 | > '-------' '-----------------' > > Signed-off-by: Tobias Waldekranz > --- > > Hi linux-usb, > > This is my first ever USB driver, therefore I would really appreciate > it if someone could have a look at it from a USB perspective before it > is (hopefully) pulled into net-next. >From a USB point of view, it looks sane, only one question: > +static int mvusb_mdio_probe(struct usb_interface *interface, > + const struct usb_device_id *id) > +{ > + struct device *dev = &interface->dev; > + struct mvusb_mdio *mvusb; > + struct mii_bus *mdio; > + > + mdio = devm_mdiobus_alloc_size(dev, sizeof(*mvusb)); You allocate a bigger buffer here than the original pointer thinks it is pointing to? > + if (!mdio) > + return -ENOMEM; > + > + mvusb = mdio->priv; And then you set this pointer here? If that's the way this is supposed to work, that's fine, just feels like the math is wrong somewhere... thanks, greg k-h