From patchwork Fri Nov 11 15:25:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dong Aisheng X-Patchwork-Id: 125190 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 255DD1007D8 for ; Sat, 12 Nov 2011 02:27:48 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1ROsye-0003jo-79; Fri, 11 Nov 2011 15:25:12 +0000 Received: from tx2ehsobe004.messaging.microsoft.com ([65.55.88.14] helo=TX2EHSOBE007.bigfish.com) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1ROsya-0003j7-V0 for linux-arm-kernel@lists.infradead.org; Fri, 11 Nov 2011 15:25:09 +0000 Received: from mail19-tx2-R.bigfish.com (10.9.14.240) by TX2EHSOBE007.bigfish.com (10.9.40.27) with Microsoft SMTP Server id 14.1.225.22; Fri, 11 Nov 2011 15:24:40 +0000 Received: from mail19-tx2 (localhost.localdomain [127.0.0.1]) by mail19-tx2-R.bigfish.com (Postfix) with ESMTP id BE76E4E0454; Fri, 11 Nov 2011 15:24:54 +0000 (UTC) X-SpamScore: -17 X-BigFish: VS-17(zz9371Kc89bh542M1432N98dKzz1202hzzz2dh2a8h668h839h8e2h8e3h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail19-tx2 (localhost.localdomain [127.0.0.1]) by mail19-tx2 (MessageSwitch) id 1321025094629193_15176; Fri, 11 Nov 2011 15:24:54 +0000 (UTC) Received: from TX2EHSMHS025.bigfish.com (unknown [10.9.14.242]) by mail19-tx2.bigfish.com (Postfix) with ESMTP id 81EDF1700056; Fri, 11 Nov 2011 15:24:54 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS025.bigfish.com (10.9.99.125) with Microsoft SMTP Server (TLS) id 14.1.225.22; Fri, 11 Nov 2011 15:24:36 +0000 Received: from 039-SN1MPN1-002.039d.mgd.msft.net ([169.254.2.83]) by 039-SN1MMR1-001.039d.mgd.msft.net ([10.84.1.13]) with mapi id 14.01.0339.002; Fri, 11 Nov 2011 09:25:02 -0600 From: Dong Aisheng-B29396 To: =?iso-8859-1?Q?Uwe_Kleine-K=F6nig?= Subject: RE: [PATCH 1/2] ARM: mx28evk: remove flexcan_pdata __initconst attribute Thread-Topic: [PATCH 1/2] ARM: mx28evk: remove flexcan_pdata __initconst attribute Thread-Index: AQHMoINaA4ZQVibXRUy1MtvfjW81Y5WoKnGA//+eX2A= Date: Fri, 11 Nov 2011 15:25:01 +0000 Message-ID: <65EE16ACC360FA4D99C96DC085B3F7722CECED@039-SN1MPN1-002.039d.mgd.msft.net> References: <1321024360-5249-1-git-send-email-b29396@freescale.com> <20111111150609.GD5011@pengutronix.de> In-Reply-To: <20111111150609.GD5011@pengutronix.de> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.192.242.89] MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [65.55.88.14 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Guo Shawn-R65073 , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "linux-arm-kernel@lists.infradead.org" , "w.sang@pengutronix.de" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org > -----Original Message----- > From: Uwe Kleine-König [mailto:u.kleine-koenig@pengutronix.de] > Sent: Friday, November 11, 2011 11:06 PM > To: Dong Aisheng-B29396 > Cc: linux-arm-kernel@lists.infradead.org; kernel@pengutronix.de; > s.hauer@pengutronix.de; w.sang@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? Regards Dong Aisheng 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, };