From: Stephen Warren <swarren@wwwdotorg.org>
To: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Cc: balbi@ti.com, linux-tegra@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
gregkh@linuxfoundation.org
Subject: Re: [PATCH 5/9] usb: phy: tegra: Register as an USB PHY.
Date: Mon, 01 Jul 2013 15:53:16 -0600 [thread overview]
Message-ID: <51D1FA4C.8000507@wwwdotorg.org> (raw)
In-Reply-To: <1372455427-20898-6-git-send-email-ttynkkynen@nvidia.com>
On 06/28/2013 03:37 PM, Tuomas Tynkkynen wrote:
> Register the Tegra PHY device instances with the PHY subsystem so that
> the Tegra EHCI driver can locate a PHY via the standard APIs.
> diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
> + err = usb_add_phy_dev(&tegra_phy->u_phy);
> + if (err < 0) {
> + tegra_usb_phy_close(&tegra_phy->u_phy);
> + return err;
> + }
Don't you want to do that a bit later? In particular ...
> tegra_phy->u_phy.shutdown = tegra_usb_phy_close;
> tegra_phy->u_phy.set_suspend = tegra_usb_phy_suspend;
>
> dev_set_drvdata(&pdev->dev, tegra_phy);
... that all happens *after* the call to usb_add_phy_dev() call, yet I
think the USB core could legally call any of the PHY methods after the
call to usb_add_phy_dev(), and that probably requires all those methods
pointers and drvdata to be set up? I suggest moving the call to
usb_add_phy_dev() to the very end of the function.
> +static int tegra_usb_phy_remove(struct platform_device *pdev)
> +{
> + struct tegra_usb_phy *tegra_phy = platform_get_drvdata(pdev);
> +
> + usb_remove_phy(&tegra_phy->u_phy);
> + return 0;
> +}
Nit: I'd typically expect to see a blank line before the return statement.
next prev parent reply other threads:[~2013-07-01 21:53 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-28 21:36 [PATCH 0/9] Tegra USB cleanup series Tuomas Tynkkynen
2013-06-28 21:36 ` Tuomas Tynkkynen
[not found] ` <1372455427-20898-1-git-send-email-ttynkkynen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-06-28 21:36 ` [PATCH 1/9] usb: phy: tegra: Remove unnecessary 'dev' field Tuomas Tynkkynen
2013-06-28 21:36 ` Tuomas Tynkkynen
2013-06-28 21:37 ` [PATCH 5/9] usb: phy: tegra: Register as an USB PHY Tuomas Tynkkynen
2013-06-28 21:37 ` Tuomas Tynkkynen
2013-07-01 21:53 ` Stephen Warren [this message]
2013-06-28 21:37 ` [PATCH 8/9] usb: phy: tegra: Use DT helpers for phy_type Tuomas Tynkkynen
2013-06-28 21:37 ` Tuomas Tynkkynen
2013-06-28 21:37 ` [PATCH 9/9] usb: phy: tegra: Use DT helpers for dr_mode Tuomas Tynkkynen
2013-06-28 21:37 ` Tuomas Tynkkynen
[not found] ` <1372455427-20898-10-git-send-email-ttynkkynen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-07-01 22:02 ` Stephen Warren
2013-07-01 22:02 ` Stephen Warren
2013-06-28 21:37 ` [PATCH 2/9] usb: host: tegra: Remove leftover code Tuomas Tynkkynen
2013-06-28 21:37 ` Tuomas Tynkkynen
2013-06-28 21:37 ` [PATCH 3/9] usb: tegra: host: Remove references to plat data Tuomas Tynkkynen
2013-06-28 21:37 ` Tuomas Tynkkynen
2013-06-28 21:37 ` [PATCH 4/9] ARM: tegra: Remove USB platform data Tuomas Tynkkynen
2013-06-28 21:37 ` Tuomas Tynkkynen
2013-07-01 21:51 ` Stephen Warren
2013-06-28 21:37 ` [PATCH 6/9] usb: host: tegra: Locate a PHY via standard API Tuomas Tynkkynen
2013-06-28 21:37 ` Tuomas Tynkkynen
2013-06-28 21:37 ` [PATCH 7/9] usb: phy: tegra: Remove custom PHY locating APIs Tuomas Tynkkynen
2013-06-28 21:37 ` Tuomas Tynkkynen
2013-07-01 22:03 ` [PATCH 0/9] Tegra USB cleanup series Stephen Warren
2013-07-24 12:32 ` Felipe Balbi
2013-07-24 12:32 ` Felipe Balbi
2013-07-24 17:03 ` Stephen Warren
2013-07-24 17:03 ` Stephen Warren
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=51D1FA4C.8000507@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=ttynkkynen@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.