linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tobias Waldekranz <tobias@waldekranz.com>
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
Date: Sun, 22 Mar 2020 08:40:06 +0100	[thread overview]
Message-ID: <20200322074006.GB64528@kroah.com> (raw)
In-Reply-To: <20200321202443.15352-2-tobias@waldekranz.com>

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 <tobias@waldekranz.com>
> ---
> 
> 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

  reply	other threads:[~2020-03-22  7:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-21 20:24 [PATCH v3 1/2] dt-bindings: net: add marvell usb to mdio bindings Tobias Waldekranz
2020-03-21 20:24 ` [PATCH v3 2/2] net: phy: add marvell usb to mdio controller Tobias Waldekranz
2020-03-22  7:40   ` Greg KH [this message]
2020-03-22  9:09     ` Tobias Waldekranz
2020-03-22 11:10       ` Greg KH
2020-03-22 13:32   ` Andrew Lunn
2020-03-22 21:10   ` Florian Fainelli
2020-03-22 13:33 ` [PATCH v3 1/2] dt-bindings: net: add marvell usb to mdio bindings Andrew Lunn
2020-03-22 13:35 ` Andrew Lunn
2020-03-22 14:38   ` Tobias Waldekranz
2020-03-22 21:03 ` Florian Fainelli
2020-03-30 15:11 ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200322074006.GB64528@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tobias@waldekranz.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).