From: Mark Brown <broonie@kernel.org>
To: Lee Jones <lee.jones@linaro.org>
Cc: Michal Simek <michal.simek@xilinx.com>,
linux-kernel@vger.kernel.org, monstr@monstr.eu,
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 12:42:17 +0100 [thread overview]
Message-ID: <20140423114217.GW12304@sirena.org.uk> (raw)
In-Reply-To: <20140423100530.GG21613@lee--X1>
[-- Attachment #1: Type: text/plain, Size: 1091 bytes --]
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.
> > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > - if (!res)
> > - return -ENOENT;
> > + *syscon_p = (struct syscon *)&syscon;
What's this cast for?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-04-23 11:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-08 15:00 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 [this message]
2014-04-23 13:04 ` Michal Simek
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=20140423114217.GW12304@sirena.org.uk \
--to=broonie@kernel.org \
--cc=arnd@arndb.de \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=monstr@monstr.eu \
--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
all inboxes | Powered by JetHome®