From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 06/10] usb: xhci: Add Tegra XHCI host-controller driver
Date: Thu, 15 May 2014 15:30:06 +0200 [thread overview]
Message-ID: <11038777.juA2AddEko@wuerfel> (raw)
In-Reply-To: <20140515091938.GD6434@ulmo>
On Thursday 15 May 2014 11:19:40 Thierry Reding wrote:
> > > +
> > > + xhci = platform_device_alloc("xhci-hcd", PLATFORM_DEVID_AUTO);
> > > + if (!xhci) {
> > > + dev_err(dev, "Failed to allocate XHCI host\n");
> > > + ret = -ENOMEM;
> > > + goto out;
> > > + }
> >
> > This does not feel appropriate at all: Rather than creating a child device,
> > you should have a specific driver that hooks into functions exported
> > by the xhci core. See Documentation/driver-model/design-patterns.txt
>
> I don't think Documentation/driver-model/design-patterns.txt documents
> this. Perhaps this is what you had in mind?
>
> http://lwn.net/Articles/336262/
No, I did mean Documentation/driver-model/design-patterns.txt.
The pattern used in the proposed driver is to create the generic platform_device
as the child of the more specific platform_device.
The normal pattern is to have only one device and embed the generic structure
inside of the more specific structure and use container_of to cast between
the two as needed.
Arnd
next prev parent reply other threads:[~2014-05-15 13:30 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-15 0:32 [RFC PATCH 00/10] Tegra XHCI support Andrew Bresticker
2014-05-15 0:32 ` [RFC PATCH 01/10] clk: tegra: Enable hardware control of PLLE Andrew Bresticker
2014-05-15 0:32 ` [RFC PATCH 02/10] clk: tegra: Fix xusb_fs_src mux Andrew Bresticker
2014-05-15 0:32 ` [RFC PATCH 03/10] clk: tegra: Fix xusb_hs_src clock hierarchy Andrew Bresticker
2014-05-15 0:33 ` [RFC PATCH 04/10] clk: tegra: Initialize xusb clocks Andrew Bresticker
2014-05-15 19:22 ` Stephen Warren
2014-05-20 15:41 ` Peter De Schrijver
2014-05-15 0:33 ` [RFC PATCH 05/10] ARM: tegra: Export function to read USB calibration data Andrew Bresticker
2014-05-15 20:39 ` Stephen Warren
2014-05-15 0:33 ` [RFC PATCH 06/10] usb: xhci: Add Tegra XHCI host-controller driver Andrew Bresticker
2014-05-15 8:17 ` Arnd Bergmann
2014-05-15 9:19 ` Thierry Reding
2014-05-15 13:30 ` Arnd Bergmann [this message]
2014-05-15 20:18 ` Andrew Bresticker
2014-05-15 21:16 ` Alan Stern
2014-05-15 21:18 ` Thierry Reding
2014-05-16 16:52 ` Andrew Bresticker
2014-05-15 0:33 ` [RFC PATCH 07/10] phy: Add Tegra XUSB PHY driver Andrew Bresticker
2014-05-15 0:33 ` [RFC PATCH 08/10] ARM: tegra124: Bind CAR to syscon device Andrew Bresticker
2014-05-15 19:25 ` Stephen Warren
2014-05-15 20:22 ` Andrew Bresticker
2014-05-15 0:33 ` [RFC PATCH 09/10] ARM: tegra124: Add XHCI controller and PHY Andrew Bresticker
2014-05-15 0:33 ` [RFC PATCH 10/10] ARM: tegra124: Enable XHCI on Venice2 Andrew Bresticker
2014-05-15 19:33 ` [RFC PATCH 00/10] Tegra XHCI support Stephen Warren
2014-05-15 20:44 ` Andrew Bresticker
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=11038777.juA2AddEko@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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).