From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: mx28evk: remove flexcan_pdata __initconst attribute
Date: Fri, 11 Nov 2011 16:42:43 +0100 [thread overview]
Message-ID: <20111111154243.GE5011@pengutronix.de> (raw)
In-Reply-To: <65EE16ACC360FA4D99C96DC085B3F7722CECED@039-SN1MPN1-002.039d.mgd.msft.net>
On Fri, Nov 11, 2011 at 03:25:01PM +0000, Dong Aisheng-B29396 wrote:
> > -----Original Message-----
> > From: Uwe Kleine-K?nig [mailto:u.kleine-koenig at pengutronix.de]
> > Sent: Friday, November 11, 2011 11:06 PM
> > To: Dong Aisheng-B29396
> > Cc: linux-arm-kernel at lists.infradead.org; kernel at pengutronix.de;
> > s.hauer at pengutronix.de; w.sang at pengutronix.de; Guo Shawn-R65073
> > Subject: Re: [PATCH 1/2] ARM: mx28evk: remove flexcan_pdata __initconst
> > attribute
> >
> > On Fri, Nov 11, 2011 at 11:12:39PM +0800, Dong Aisheng wrote:
> > > The flexcan driver still uses it after init.
> > As "it" is a copy of flexcan_pdata it's completely OK for the driver to
> > use it.
> >
> > What is the exact problem you want to address?
> >
> Sorry, I just checked the code and found platform_device_add_data will
> Add a copy of platform specific data.
> Originally I thought the driver may access the freed pdata after init.
>
> So, does it mean that every pdata of pdevice added
> by mxs_add_platform_device_dmamask can be prefixed by __init*?
>
> And, below change seems correct?
> diff --git a/arch/arm/mach-mxs/module-tx28.c b/arch/arm/mach-mxs/module-tx28.c
> index 0fcff47..a096cca 100644
> --- a/arch/arm/mach-mxs/module-tx28.c
> +++ b/arch/arm/mach-mxs/module-tx28.c
> @@ -66,11 +66,11 @@ static const iomux_cfg_t tx28_fec1_pads[] __initconst = {
> MX28_PAD_ENET0_CRS__ENET1_RX_EN,
> };
>
> -static struct fec_platform_data tx28_fec0_data = {
> +static struct fec_platform_data __initconst tx28_fec0_data = {
> .phy = PHY_INTERFACE_MODE_RMII,
> };
>
> -static struct fec_platform_data tx28_fec1_data = {
> +static struct fec_platform_data __initconst tx28_fec1_data = {
> .phy = PHY_INTERFACE_MODE_RMII,
> };
Apart from Russell's objections, yes.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2011-11-11 15:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-11 15:12 [PATCH 1/2] ARM: mx28evk: remove flexcan_pdata __initconst attribute Dong Aisheng
2011-11-11 15:06 ` Uwe Kleine-König
2011-11-11 15:25 ` Dong Aisheng-B29396
2011-11-11 15:27 ` Russell King - ARM Linux
2011-11-11 15:30 ` Dong Aisheng-B29396
2011-11-11 15:33 ` Russell King - ARM Linux
2011-11-11 15:36 ` Dong Aisheng-B29396
2011-11-11 15:42 ` Uwe Kleine-König [this message]
2011-11-11 15:12 ` [PATCH 2/2] ARM: mxs: remove mmc_platform_data __initdata attribute Dong Aisheng
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=20111111154243.GE5011@pengutronix.de \
--to=u.kleine-koenig@pengutronix.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).