public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: Mark Brown <broonie@kernel.org>
Cc: Lee Jones <lee.jones@linaro.org>,
	Michal Simek <michal.simek@xilinx.com>,
	linux-kernel@vger.kernel.org, pankaj.dubey@samsung.com,
	Samuel Ortiz <sameo@linux.intel.com>,
	arnd@arndb.de
Subject: Re: [PATCH v3] mfd: syscon: Support early initialization
Date: Wed, 23 Apr 2014 15:04:28 +0200	[thread overview]
Message-ID: <5357BA5C.6000606@monstr.eu> (raw)
In-Reply-To: <20140423114217.GW12304@sirena.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1694 bytes --]

On 04/23/2014 01:42 PM, Mark Brown wrote:
> On Wed, Apr 23, 2014 at 11:05:30AM +0100, Lee Jones wrote:
> 
>>> +struct regmap *syscon_early_regmap_lookup_by_phandle(struct device_node *np,
>>> +						     const char *property)
>>> +{
>>> +	struct device_node *syscon_np;
>>> +	struct syscon *syscon;
>>> +
>>> +	syscon_np = of_parse_phandle(np, property, 0);
>>> +	if (!syscon_np)
>>> +		return ERR_PTR(-ENODEV);
>>> +
>>> +	syscon = syscon_np->data;
>>> +
>>> +	of_node_put(syscon_np);
>>> +
>>> +	return syscon->regmap;
>>> +}
>>> +EXPORT_SYMBOL_GPL(syscon_early_regmap_lookup_by_phandle);
> 
> I don't know what this is doing but it looks dodgy, we're returning
> something stored in the DT node after dropping our reference to the DT
> node.  For FDT systems this probably makes no difference since we don't
> actually free the node but someone might decide to do something like
> clear data that's associated with a node (however that happened) when
> the node goes unreferenced.

In early_syscon_probe np->data contains pointer to struct syscon which
stores base, regmap and res - driver private data for system controller.
(init in early_syscon_probe)
This is the way I am aware of how to share driver private data without pdev.
Maybe there is better way how to do it that's why please let me know
if you are aware about it.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2014-04-23 13:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 15:00 [PATCH v3] mfd: syscon: Support early initialization Michal Simek
2014-04-10  6:20 ` Pankaj Dubey
2014-04-10  6:17   ` Michal Simek
2014-04-23  7:27     ` Michal Simek
2014-04-23  8:22       ` Pankaj Dubey
2014-04-23  8:27         ` Michal Simek
2014-04-25 13:26           ` Pankaj Dubey
2014-04-23 10:01       ` Lee Jones
2014-04-23 10:05 ` Lee Jones
2014-04-23 11:42   ` Mark Brown
2014-04-23 13:04     ` Michal Simek [this message]
2014-04-23 15:19       ` Mark Brown
2014-04-25 21:33 ` Tomasz Figa

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=5357BA5C.6000606@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=pankaj.dubey@samsung.com \
    --cc=sameo@linux.intel.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