All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jon Hunter <jon-hunter@ti.com>
To: "Mohammed, Afzal" <afzal@ti.com>
Cc: "tony@atomide.com" <tony@atomide.com>,
	"paul@pwsan.com" <paul@pwsan.com>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v5 03/14] ARM: OMAP2+: gpmc: driver migration helper
Date: Tue, 12 Jun 2012 12:46:50 -0500	[thread overview]
Message-ID: <4FD7808A.1040806@ti.com> (raw)
In-Reply-To: <C8443D0743D26F4388EA172BF4E2A7A93E997E0F@DBDE01.ent.ti.com>


On 06/12/2012 02:09 AM, Mohammed, Afzal wrote:
> Hi Jon,
> 
> This change is required only till driver migration of all platforms
> are done, after it, this hackish patch has to be reverted. This has
> been done so that existing interface will work for each patch of
> this series as well as till all boards are migrated.
> 
> On Tue, Jun 12, 2012 at 02:00:21, Hunter, Jon wrote:
> 
>>>  __init int omap_gpmc_init(struct gpmc_pdata *pdata)
>>>  {
>>>  	struct omap_hwmod *oh;
>>> -	struct platform_device *pdev;
>>> +	static struct platform_device *pdev;
>>>  	char *name = "omap-gpmc";
>>>  	char *oh_name = "gpmc";
>>>  
>>> @@ -912,6 +912,12 @@ __init int omap_gpmc_init(struct gpmc_pdata *pdata)
>>>  		return -ENODEV;
>>>  	}
>>>  
>>> +	if (pdev != NULL) {
>>> +		clk_put(gpmc_l3_clk);
>>> +		omap_device_delete(pdev->archdata.od);
>>> +		platform_device_unregister(pdev);
>>> +	}
>>> +
>>
>> I am not sure if I am missing something, but it appears that pdev will
>> always be NULL here as it is a local uninitialised variable.
> 
> omap_gpmc_init will be called by board files once again, at that time,
> existing omap device will be destroyed (resulting in driver remove being
> executed, and inverse of omap_device_build is not available, hence
> doing circus as above). Again omap device will be created, this time
> with details about gpmc peripherals (first time, there were no
> peripheral details provided, and this was done for old interface to work
> with same driver), once this happens new interface will starting it's job.
> 
> This kind of change was required as old interface works at arch_init

Ok, make sense. Then please label with a FIXME.

>  > +static int __init gpmc_pre_init(void)
>>> +{
>>> +	static struct gpmc_device_pdata *gpmc_device_data[1];
>>> +	struct gpmc_pdata gpmc_data = {
>>> +		.device_pdata	= gpmc_device_data,
>>> +	};
>>> +
>>> +	return omap_gpmc_init(&gpmc_data);
>>> +}
>>> +postcore_initcall(gpmc_pre_init);
>>> +
>>
>> Not sure I see the point in the above function. Why not declare the
>> gpmc_device_data struct as static in the file and access it directly
>> instead of passing it in omap_gpmc_init(). The postcore_init can then
>> call omap_gpmc_init() directly.
> 
> Can be done, but it is not necessary to make it available outside the
> function

Ok, I see that this is necessary until all boards are migrated. However,
please label with a FIXME to make it clear that this is to be removed.

Jon

WARNING: multiple messages have this Message-ID (diff)
From: jon-hunter@ti.com (Jon Hunter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 03/14] ARM: OMAP2+: gpmc: driver migration helper
Date: Tue, 12 Jun 2012 12:46:50 -0500	[thread overview]
Message-ID: <4FD7808A.1040806@ti.com> (raw)
In-Reply-To: <C8443D0743D26F4388EA172BF4E2A7A93E997E0F@DBDE01.ent.ti.com>


On 06/12/2012 02:09 AM, Mohammed, Afzal wrote:
> Hi Jon,
> 
> This change is required only till driver migration of all platforms
> are done, after it, this hackish patch has to be reverted. This has
> been done so that existing interface will work for each patch of
> this series as well as till all boards are migrated.
> 
> On Tue, Jun 12, 2012 at 02:00:21, Hunter, Jon wrote:
> 
>>>  __init int omap_gpmc_init(struct gpmc_pdata *pdata)
>>>  {
>>>  	struct omap_hwmod *oh;
>>> -	struct platform_device *pdev;
>>> +	static struct platform_device *pdev;
>>>  	char *name = "omap-gpmc";
>>>  	char *oh_name = "gpmc";
>>>  
>>> @@ -912,6 +912,12 @@ __init int omap_gpmc_init(struct gpmc_pdata *pdata)
>>>  		return -ENODEV;
>>>  	}
>>>  
>>> +	if (pdev != NULL) {
>>> +		clk_put(gpmc_l3_clk);
>>> +		omap_device_delete(pdev->archdata.od);
>>> +		platform_device_unregister(pdev);
>>> +	}
>>> +
>>
>> I am not sure if I am missing something, but it appears that pdev will
>> always be NULL here as it is a local uninitialised variable.
> 
> omap_gpmc_init will be called by board files once again, at that time,
> existing omap device will be destroyed (resulting in driver remove being
> executed, and inverse of omap_device_build is not available, hence
> doing circus as above). Again omap device will be created, this time
> with details about gpmc peripherals (first time, there were no
> peripheral details provided, and this was done for old interface to work
> with same driver), once this happens new interface will starting it's job.
> 
> This kind of change was required as old interface works at arch_init

Ok, make sense. Then please label with a FIXME.

>  > +static int __init gpmc_pre_init(void)
>>> +{
>>> +	static struct gpmc_device_pdata *gpmc_device_data[1];
>>> +	struct gpmc_pdata gpmc_data = {
>>> +		.device_pdata	= gpmc_device_data,
>>> +	};
>>> +
>>> +	return omap_gpmc_init(&gpmc_data);
>>> +}
>>> +postcore_initcall(gpmc_pre_init);
>>> +
>>
>> Not sure I see the point in the above function. Why not declare the
>> gpmc_device_data struct as static in the file and access it directly
>> instead of passing it in omap_gpmc_init(). The postcore_init can then
>> call omap_gpmc_init() directly.
> 
> Can be done, but it is not necessary to make it available outside the
> function

Ok, I see that this is necessary until all boards are migrated. However,
please label with a FIXME to make it clear that this is to be removed.

Jon

  reply	other threads:[~2012-06-12 17:46 UTC|newest]

Thread overview: 232+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-11 14:25 [PATCH v5 00/14] GPMC driver conversion Afzal Mohammed
2012-06-11 14:25 ` Afzal Mohammed
2012-06-11 14:26 ` [PATCH v5 01/14] ARM: OMAP2+: gpmc: platform definitions Afzal Mohammed
2012-06-11 14:26   ` Afzal Mohammed
2012-06-12 18:58   ` Jon Hunter
2012-06-12 18:58     ` Jon Hunter
2012-06-13  6:25     ` Mohammed, Afzal
2012-06-13  6:25       ` Mohammed, Afzal
2012-06-11 14:26 ` [PATCH v5 02/14] ARM: OMAP2+: gpmc: Adapt to HWMOD Afzal Mohammed
2012-06-11 14:26   ` Afzal Mohammed
2012-06-11 19:56   ` Jon Hunter
2012-06-11 19:56     ` Jon Hunter
2012-06-12  6:53     ` Mohammed, Afzal
2012-06-12  6:53       ` Mohammed, Afzal
2012-06-12 17:40       ` Jon Hunter
2012-06-12 17:40         ` Jon Hunter
2012-06-13  5:20         ` Mohammed, Afzal
2012-06-13  5:20           ` Mohammed, Afzal
2012-06-13 12:02           ` Tony Lindgren
2012-06-13 12:02             ` Tony Lindgren
2012-06-13 13:05             ` Mohammed, Afzal
2012-06-13 13:05               ` Mohammed, Afzal
2012-06-13 13:39               ` Tony Lindgren
2012-06-13 13:39                 ` Tony Lindgren
2012-06-13 13:59                 ` Mohammed, Afzal
2012-06-13 13:59                   ` Mohammed, Afzal
2012-06-13 15:08               ` Jon Hunter
2012-06-13 15:08                 ` Jon Hunter
2012-06-14  7:07                 ` Mohammed, Afzal
2012-06-14  7:07                   ` Mohammed, Afzal
2012-06-13 14:51           ` Jon Hunter
2012-06-13 14:51             ` Jon Hunter
2012-06-14  6:17             ` Mohammed, Afzal
2012-06-14  6:17               ` Mohammed, Afzal
2012-06-14  6:20               ` Mohammed, Afzal
2012-06-14  6:20                 ` Mohammed, Afzal
2012-06-14 20:51               ` Jon Hunter
2012-06-14 20:51                 ` Jon Hunter
2012-06-15  0:20                 ` Paul Walmsley
2012-06-15  0:20                   ` Paul Walmsley
2012-06-15 15:33                   ` Jon Hunter
2012-06-15 15:33                     ` Jon Hunter
2012-06-15 10:40                 ` Mohammed, Afzal
2012-06-15 10:40                   ` Mohammed, Afzal
2012-06-14  7:03             ` Mohammed, Afzal
2012-06-14  7:03               ` Mohammed, Afzal
2012-06-14 13:22               ` Jon Hunter
2012-06-14 13:22                 ` Jon Hunter
2012-06-14 13:32                 ` Mohammed, Afzal
2012-06-14 13:32                   ` Mohammed, Afzal
2012-06-14 18:58                   ` Jon Hunter
2012-06-14 18:58                     ` Jon Hunter
2012-06-15 10:22                     ` Mohammed, Afzal
2012-06-15 10:22                       ` Mohammed, Afzal
2012-06-15 12:45                       ` Tony Lindgren
2012-06-15 12:45                         ` Tony Lindgren
2012-06-16  9:15                         ` Mohammed, Afzal
2012-06-16  9:15                           ` Mohammed, Afzal
2012-06-20 13:28                           ` Tony Lindgren
2012-06-20 13:28                             ` Tony Lindgren
2012-06-20 14:52                             ` Mohammed, Afzal
2012-06-20 14:52                               ` Mohammed, Afzal
2012-06-20 15:12                               ` Tony Lindgren
2012-06-20 15:12                                 ` Tony Lindgren
2012-06-20 23:35                                 ` Jon Hunter
2012-06-20 23:35                                   ` Jon Hunter
2012-06-22 13:29                                   ` Mohammed, Afzal
2012-06-22 13:29                                     ` Mohammed, Afzal
2012-06-11 14:26 ` [PATCH v5 03/14] ARM: OMAP2+: gpmc: driver migration helper Afzal Mohammed
2012-06-11 14:26   ` Afzal Mohammed
2012-06-11 20:30   ` Jon Hunter
2012-06-11 20:30     ` Jon Hunter
2012-06-12  7:09     ` Mohammed, Afzal
2012-06-12  7:09       ` Mohammed, Afzal
2012-06-12 17:46       ` Jon Hunter [this message]
2012-06-12 17:46         ` Jon Hunter
2012-06-13  5:25         ` Mohammed, Afzal
2012-06-13  5:25           ` Mohammed, Afzal
2012-06-13 12:04     ` Tony Lindgren
2012-06-13 12:04       ` Tony Lindgren
2012-06-13 12:18       ` Mohammed, Afzal
2012-06-13 12:18         ` Mohammed, Afzal
2012-06-13 13:46         ` Mohammed, Afzal
2012-06-13 13:46           ` Mohammed, Afzal
2012-06-14  6:34           ` Tony Lindgren
2012-06-14  6:34             ` Tony Lindgren
2012-06-11 14:26 ` [PATCH v5 04/14] ARM: OMAP2+: gpmc: minimal driver support Afzal Mohammed
2012-06-11 14:26   ` Afzal Mohammed
2012-06-11 20:43   ` Jon Hunter
2012-06-11 20:43     ` Jon Hunter
2012-06-12  7:16     ` Mohammed, Afzal
2012-06-12  7:16       ` Mohammed, Afzal
2012-06-12 17:57       ` Jon Hunter
2012-06-12 17:57         ` Jon Hunter
2012-06-13 12:07         ` Tony Lindgren
2012-06-13 12:07           ` Tony Lindgren
2012-06-13 13:12           ` Mohammed, Afzal
2012-06-13 13:12             ` Mohammed, Afzal
2012-06-13 13:40             ` Tony Lindgren
2012-06-13 13:40               ` Tony Lindgren
2012-06-13 13:44               ` Tony Lindgren
2012-06-13 13:44                 ` Tony Lindgren
2012-06-13 13:50                 ` Mohammed, Afzal
2012-06-13 13:50                   ` Mohammed, Afzal
2012-06-13 13:52                 ` Mohammed, Afzal
2012-06-13 13:52                   ` Mohammed, Afzal
2012-06-14  6:35                   ` Tony Lindgren
2012-06-14  6:35                     ` Tony Lindgren
2012-06-14  6:40                     ` Mohammed, Afzal
2012-06-14  6:40                       ` Mohammed, Afzal
2012-06-14  8:39                       ` Tony Lindgren
2012-06-14  8:39                         ` Tony Lindgren
2012-06-14  8:42                         ` Mohammed, Afzal
2012-06-14  8:42                           ` Mohammed, Afzal
2012-06-13 17:05               ` Jon Hunter
2012-06-13 17:05                 ` Jon Hunter
2012-06-12 19:19   ` Jon Hunter
2012-06-12 19:19     ` Jon Hunter
2012-06-13  6:29     ` Mohammed, Afzal
2012-06-13  6:29       ` Mohammed, Afzal
2012-06-11 14:26 ` [PATCH v5 05/14] ARM: OMAP2+: gpmc: resource creation helpers Afzal Mohammed
2012-06-11 14:26   ` Afzal Mohammed
2012-06-11 20:57   ` Jon Hunter
2012-06-11 20:57     ` Jon Hunter
2012-06-12  8:30     ` Mohammed, Afzal
2012-06-12  8:30       ` Mohammed, Afzal
2012-06-12 18:02       ` Jon Hunter
2012-06-12 18:02         ` Jon Hunter
2012-06-13  5:29         ` Mohammed, Afzal
2012-06-13  5:29           ` Mohammed, Afzal
2012-06-13 15:33           ` Jon Hunter
2012-06-13 15:33             ` Jon Hunter
2012-06-14  8:44             ` Mohammed, Afzal
2012-06-14  8:44               ` Mohammed, Afzal
2012-06-11 14:26 ` [PATCH v5 06/14] ARM: OMAP2+: gpmc: CS configuration helper Afzal Mohammed
2012-06-11 14:26   ` Afzal Mohammed
2012-06-11 21:43   ` Jon Hunter
2012-06-11 21:43     ` Jon Hunter
2012-06-12  8:40     ` Mohammed, Afzal
2012-06-12  8:40       ` Mohammed, Afzal
2012-06-12 12:58       ` Mohammed, Afzal
2012-06-12 12:58         ` Mohammed, Afzal
2012-06-12 18:09         ` Jon Hunter
2012-06-12 18:09           ` Jon Hunter
2012-06-13  5:50           ` Mohammed, Afzal
2012-06-13  5:50             ` Mohammed, Afzal
2012-06-13 15:39             ` Jon Hunter
2012-06-13 15:39               ` Jon Hunter
2012-06-14  8:45               ` Mohammed, Afzal
2012-06-14  8:45                 ` Mohammed, Afzal
2012-06-12 18:06       ` Jon Hunter
2012-06-12 18:06         ` Jon Hunter
2012-06-13  5:35         ` Mohammed, Afzal
2012-06-13  5:35           ` Mohammed, Afzal
2012-06-11 14:27 ` [PATCH v5 07/14] ARM: OMAP2+: gpmc: time setting (register#) helper Afzal Mohammed
2012-06-11 14:27   ` Afzal Mohammed
2012-06-12 18:55   ` Jon Hunter
2012-06-12 18:55     ` Jon Hunter
2012-06-13  6:15     ` Mohammed, Afzal
2012-06-13  6:15       ` Mohammed, Afzal
2012-06-11 14:27 ` [PATCH v5 08/14] ARM: OMAP2+: gpmc: bool type timing helper Afzal Mohammed
2012-06-11 14:27   ` Afzal Mohammed
2012-06-11 22:27   ` Jon Hunter
2012-06-11 22:27     ` Jon Hunter
2012-06-12  8:41     ` Mohammed, Afzal
2012-06-12  8:41       ` Mohammed, Afzal
2012-06-11 14:27 ` [PATCH v5 09/14] ARM: OMAP2+: gpmc: holler if no configuration Afzal Mohammed
2012-06-11 14:27   ` Afzal Mohammed
2012-06-11 22:30   ` Jon Hunter
2012-06-11 22:30     ` Jon Hunter
2012-06-12  8:44     ` Mohammed, Afzal
2012-06-12  8:44       ` Mohammed, Afzal
2012-06-12 18:11       ` Jon Hunter
2012-06-12 18:11         ` Jon Hunter
2012-06-11 14:27 ` [PATCH v5 10/14] ARM: OMAP2+: gpmc: waitpin helper Afzal Mohammed
2012-06-11 14:27   ` Afzal Mohammed
2012-06-11 22:59   ` Jon Hunter
2012-06-11 22:59     ` Jon Hunter
2012-06-12  9:00     ` Mohammed, Afzal
2012-06-12  9:00       ` Mohammed, Afzal
2012-06-12 18:15       ` Jon Hunter
2012-06-12 18:15         ` Jon Hunter
2012-06-13  7:37         ` Mohammed, Afzal
2012-06-13  7:37           ` Mohammed, Afzal
2012-06-13 15:44           ` Jon Hunter
2012-06-13 15:44             ` Jon Hunter
2012-06-14  8:48             ` Mohammed, Afzal
2012-06-14  8:48               ` Mohammed, Afzal
2012-06-14 21:06               ` Jon Hunter
2012-06-14 21:06                 ` Jon Hunter
2012-06-15 10:50                 ` Mohammed, Afzal
2012-06-15 10:50                   ` Mohammed, Afzal
2012-06-12 18:37   ` Jon Hunter
2012-06-12 18:37     ` Jon Hunter
2012-06-13  7:47     ` Mohammed, Afzal
2012-06-13  7:47       ` Mohammed, Afzal
2012-06-11 14:27 ` [PATCH v5 11/14] ARM: OMAP2+: gpmc: handle connected peripherals Afzal Mohammed
2012-06-11 14:27   ` Afzal Mohammed
2012-06-13 15:31   ` Jon Hunter
2012-06-13 15:31     ` Jon Hunter
2012-06-14  8:40     ` Mohammed, Afzal
2012-06-14  8:40       ` Mohammed, Afzal
2012-06-11 14:27 ` [PATCH v5 12/14] ARM: OMAP2+: gpmc: cs reconfigure helper Afzal Mohammed
2012-06-11 14:27   ` Afzal Mohammed
2012-06-11 23:04   ` Jon Hunter
2012-06-11 23:04     ` Jon Hunter
2012-06-12  9:01     ` Mohammed, Afzal
2012-06-12  9:01       ` Mohammed, Afzal
2012-06-11 14:27 ` [PATCH v5 13/14] ARM: OMAP2+: gpmc: update nand register info Afzal Mohammed
2012-06-11 14:27   ` Afzal Mohammed
2012-06-11 14:27 ` [PATCH v5 14/14] ARM: OMAP2+: gpmc: writeprotect helper Afzal Mohammed
2012-06-11 14:27   ` Afzal Mohammed
2012-06-12 18:42   ` Jon Hunter
2012-06-12 18:42     ` Jon Hunter
2012-06-13  6:10     ` Mohammed, Afzal
2012-06-13  6:10       ` Mohammed, Afzal
2012-06-13 16:28       ` Jon Hunter
2012-06-13 16:28         ` Jon Hunter
2012-06-14  8:54         ` Mohammed, Afzal
2012-06-14  8:54           ` Mohammed, Afzal
2012-06-14  9:36           ` Tony Lindgren
2012-06-14  9:36             ` Tony Lindgren
2012-06-14 10:21             ` Mohammed, Afzal
2012-06-14 10:21               ` Mohammed, Afzal
2012-06-12 10:39 ` [PATCH v5 00/14] GPMC driver conversion Mohammed, Afzal
2012-06-12 10:39   ` Mohammed, Afzal
2012-06-13 12:33   ` Tony Lindgren
2012-06-13 12:33     ` Tony Lindgren
2012-06-15 10:56     ` Mohammed, Afzal
2012-06-15 10:56       ` Mohammed, Afzal
2012-06-15 12:51       ` Tony Lindgren
2012-06-15 12:51         ` Tony Lindgren

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=4FD7808A.1040806@ti.com \
    --to=jon-hunter@ti.com \
    --cc=afzal@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.