linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Simon Horman <horms@verge.net.au>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	linux-kernel@vger.kernel.org, Paul Mundt <lethal@linux-sh.org>,
	Magnus Damm <magnus.damm@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Phil Edworthy <phil.edworthy@renesas.com>,
	Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Subject: Re: [PATCH 11/42] ARM: shmobile: Register PFC platform device
Date: Wed, 21 Nov 2012 13:43:15 +0100	[thread overview]
Message-ID: <1633136.U5nCbqepA4@avalon> (raw)
In-Reply-To: <20121121051633.GF6570@verge.net.au>

Hi Simon,

On Wednesday 21 November 2012 14:16:33 Simon Horman wrote:
> On Wed, Nov 21, 2012 at 03:27:12AM +0100, Laurent Pinchart wrote:
> > Add arch code to register the PFC platform device instead of calling the
> > driver directly. Platform device registration in the sh-pfc driver will
> > be removed.
> 
> I'm not really sure that I understand the motivation for
> moving platform device registration from the driver into
> mach-shmobile. Could you explain this a little?

Sure.

The traditional device model associates a driver with a device. For historical 
reasons mach-shmobile doesn't define and register a platform device for PFC 
hardware but calls an initialization function directly in the PFC driver, 
passing it what is essentially platform data, including resources.

The PFC driver needs a struct device to pass to the pinctrl subsystem. As no 
struct device corresponding to the hardware is created by mach-shmobile, the 
driver creates one, registers it and registers itself as a platform driver. 
The probe function is thus called synchronously, with a valid struct 
platform_device.

This is a hack that can't support device tree based instantiation, as the 
platform device will be created when the platform is populated from the DT in 
that case. To support DT (and to remove the hack), I've moved platform device 
registration to mach-shmobile as it should be, like already done for all (or 
most, I haven't checked if there's no similar hacks in other drivers) the 
platform devices. This allows converting a board to DT by just adding the PFC 
device node in the DT and removing the platform device registration call in 
board code.

I hope this made the intend of this part of the patch series clear. If not, 
just tell me and I'll try to provide more explanations.

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2012-11-21 12:42 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21  2:27 [PATCH 00/42] SH pin control and GPIO rework Laurent Pinchart
2012-11-21  2:27 ` [PATCH 01/42] sh-pfc: Split platform data from the sh_pfc structure Laurent Pinchart
2012-11-21  2:27 ` [PATCH 02/42] sh-pfc: Move private definitions and declarations to private header Laurent Pinchart
2012-11-21  2:27 ` [PATCH 03/42] sh-pfc: Merge PFC core and pinctrl Laurent Pinchart
2012-11-21  2:27 ` [PATCH 04/42] sh-pfc: Merge PFC core and gpio Laurent Pinchart
2012-11-21  2:27 ` [PATCH 05/42] sh-pfc: Move platform device and driver to the core Laurent Pinchart
2012-11-21  2:27 ` [PATCH 06/42] sh-pfc: Let the compiler decide whether to inline functions Laurent Pinchart
2012-11-21  2:27 ` [PATCH 07/42] sh-pfc: Remove check for impossible error condition Laurent Pinchart
2012-11-21  2:27 ` [PATCH 08/42] sh-pfc: Sort headers alphabetically Laurent Pinchart
2012-11-21  2:27 ` [PATCH 09/42] sh-pfc: Split platform device and platform driver registration Laurent Pinchart
2012-11-21  2:27 ` [PATCH 10/42] sh-pfc: Support passing resources through platform device Laurent Pinchart
2012-11-21  2:27 ` [PATCH 11/42] ARM: shmobile: Register PFC " Laurent Pinchart
2012-11-21  5:16   ` Simon Horman
2012-11-21 12:43     ` Laurent Pinchart [this message]
2012-11-26  1:02       ` Simon Horman
2012-11-26 10:34         ` Laurent Pinchart
2012-11-27  2:26           ` Simon Horman
2012-11-27 11:19             ` Laurent Pinchart
2012-11-28  0:58               ` Simon Horman
2012-11-21  2:27 ` [PATCH 12/42] SH: " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 13/42] sh-pfc: Remove platform device registration Laurent Pinchart
2012-11-21  2:27 ` [PATCH 14/42] sh-pfc: Remove unused resource and num_resources platform data fields Laurent Pinchart
2012-11-21  2:27 ` [PATCH 15/42] ARM: shmobile: Select PINCTRL Laurent Pinchart
2012-11-21  2:27 ` [PATCH 16/42] sh: Select PINCTRL for CPU subtypes that require it Laurent Pinchart
2012-11-21  2:27 ` [PATCH 17/42] sh-pfc: Move driver from drivers/sh/ to drivers/pinctrl/ Laurent Pinchart
2012-11-21  3:28   ` viresh kumar
2012-11-21 13:17     ` Laurent Pinchart
2012-11-21  2:27 ` [PATCH 18/42] sh-pfc: Support pinmux info in driver data instead of platform data Laurent Pinchart
2012-11-21  2:27 ` [PATCH 19/42] sh-pfc: Add r8a7740 pinmux support Laurent Pinchart
2012-11-21  2:27 ` [PATCH 20/42] sh-pfc: Add r8a7779 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 21/42] sh-pfc: Add sh7367 " Laurent Pinchart
2012-11-22  4:56   ` Nobuhiro Iwamatsu
2012-11-21  2:27 ` [PATCH 22/42] sh-pfc: Add sh7372 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 23/42] sh-pfc: Add sh7377 " Laurent Pinchart
2012-11-22  4:55   ` Nobuhiro Iwamatsu
2012-11-22 11:12     ` Laurent Pinchart
2012-11-21  2:27 ` [PATCH 24/42] sh-pfc: Add sh73a0 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 25/42] ARM: shmobile: pfc: Use driver-provided pinmux info Laurent Pinchart
2012-11-21  2:27 ` [PATCH 26/42] sh-pfc: Add sh7203 pinmux support Laurent Pinchart
2012-11-21  2:27 ` [PATCH 27/42] sh-pfc: Add sh7264 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 28/42] sh-pfc: Add sh7269 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 29/42] sh-pfc: Add sh7720 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 30/42] sh-pfc: Add sh7722 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 31/42] sh-pfc: Add sh7723 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 32/42] sh-pfc: Add sh7724 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 33/42] sh-pfc: Add sh7734 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 34/42] sh-pfc: Add sh7757 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 35/42] sh-pfc: Add sh7785 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 36/42] sh-pfc: Add sh7786 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 37/42] sh-pfc: Add shx3 " Laurent Pinchart
2012-11-21  2:27 ` [PATCH 39/42] sh-pfc: Remove pinmux_info definition Laurent Pinchart
2012-11-21  2:27 ` [PATCH 40/42] sh-pfc: Move sh_pfc.h from include/linux/ to driver directory Laurent Pinchart
2012-11-21  2:27 ` [PATCH 41/42] ARM: shmobile: r8a7740: Add pin control resources Laurent Pinchart
2012-11-21  2:27 ` [PATCH 42/42] ARM: shmobile: sh7372: " Laurent Pinchart
2012-11-21  4:23 ` [PATCH 00/42] SH pin control and GPIO rework Paul Mundt
2012-11-21 14:51 ` Linus Walleij

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=1633136.U5nCbqepA4@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=lethal@linux-sh.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=nobuhiro.iwamatsu.yj@renesas.com \
    --cc=phil.edworthy@renesas.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).