All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emil Goode <emilgoode@gmail.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] ARM: imx: convert camera init to use platform_device_register_full()
Date: Tue, 20 May 2014 11:43:15 +0000	[thread overview]
Message-ID: <20140520114315.GA4438@lianli> (raw)
In-Reply-To: <20140519062722.GE16662@pengutronix.de>

Hello Uwe,

Thank you for the review and sorry for the late response.

On Mon, May 19, 2014 at 08:27:22AM +0200, Uwe Kleine-König wrote:
> Hello Emil,
> 
> thanks for your effort.
> 
> On Sun, May 18, 2014 at 10:51:00PM +0200, Emil Goode wrote:
> > This converts the imx camera allocation and initialization functions
> > to use platform_device_register_full() thus simplifying the code.
> > 
> > Signed-off-by: Emil Goode <emilgoode@gmail.com>
> > ---
> > Only build tested, unfortunately I currently don't have the hardware.
> > 
> >  arch/arm/mach-imx/devices/platform-ipu-core.c |   43 +++++++++----------------
> >  arch/arm/mach-imx/mach-mx31_3ds.c             |    5 ++-
> >  arch/arm/mach-imx/mach-mx31moboard.c          |    6 ++--
> >  arch/arm/mach-imx/mach-mx35_3ds.c             |    5 ++-
> >  arch/arm/mach-imx/mach-pcm037.c               |    5 ++-
> >  5 files changed, 23 insertions(+), 41 deletions(-)
> > 
> > diff --git a/arch/arm/mach-imx/devices/platform-ipu-core.c b/arch/arm/mach-imx/devices/platform-ipu-core.c
> > index 6bd7c3f..13ea542 100644
> > --- a/arch/arm/mach-imx/devices/platform-ipu-core.c
> > +++ b/arch/arm/mach-imx/devices/platform-ipu-core.c
> > @@ -69,42 +69,29 @@ struct platform_device *__init imx_alloc_mx3_camera(
> IMHO you should better rename the function because now it doesn't only
> allocate the device, but also registers it.

Agreed.

> 
> Also I doubt that it's OK to call dma_declare_coherent_memory after the
> device is added. In this case maybe extend
> platform_device_register_full? And also add a warning to
> dma_declare_coherent_memory if it is called for an already added device?
> (Added a few people to Cc: that might be able to comment this. I don't
> even know if there is a reliable way to check if a device is already
> added.)

Yes I also had doubts about that. However, apart from this patch there are
three other places in arch/arm/mach-imx/ where dma_declare_coherent_memory()
is called after calling platform_device_register_full().

Perhaps this is enough reason to extend platform_device_register_full().

It would be great to get some more feedback on this and also if there is a
reliable way to check if a device is already added.

Best regards,

Emil Goode
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: emilgoode@gmail.com (Emil Goode)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: imx: convert camera init to use platform_device_register_full()
Date: Tue, 20 May 2014 13:43:15 +0200	[thread overview]
Message-ID: <20140520114315.GA4438@lianli> (raw)
In-Reply-To: <20140519062722.GE16662@pengutronix.de>

Hello Uwe,

Thank you for the review and sorry for the late response.

On Mon, May 19, 2014 at 08:27:22AM +0200, Uwe Kleine-K?nig wrote:
> Hello Emil,
> 
> thanks for your effort.
> 
> On Sun, May 18, 2014 at 10:51:00PM +0200, Emil Goode wrote:
> > This converts the imx camera allocation and initialization functions
> > to use platform_device_register_full() thus simplifying the code.
> > 
> > Signed-off-by: Emil Goode <emilgoode@gmail.com>
> > ---
> > Only build tested, unfortunately I currently don't have the hardware.
> > 
> >  arch/arm/mach-imx/devices/platform-ipu-core.c |   43 +++++++++----------------
> >  arch/arm/mach-imx/mach-mx31_3ds.c             |    5 ++-
> >  arch/arm/mach-imx/mach-mx31moboard.c          |    6 ++--
> >  arch/arm/mach-imx/mach-mx35_3ds.c             |    5 ++-
> >  arch/arm/mach-imx/mach-pcm037.c               |    5 ++-
> >  5 files changed, 23 insertions(+), 41 deletions(-)
> > 
> > diff --git a/arch/arm/mach-imx/devices/platform-ipu-core.c b/arch/arm/mach-imx/devices/platform-ipu-core.c
> > index 6bd7c3f..13ea542 100644
> > --- a/arch/arm/mach-imx/devices/platform-ipu-core.c
> > +++ b/arch/arm/mach-imx/devices/platform-ipu-core.c
> > @@ -69,42 +69,29 @@ struct platform_device *__init imx_alloc_mx3_camera(
> IMHO you should better rename the function because now it doesn't only
> allocate the device, but also registers it.

Agreed.

> 
> Also I doubt that it's OK to call dma_declare_coherent_memory after the
> device is added. In this case maybe extend
> platform_device_register_full? And also add a warning to
> dma_declare_coherent_memory if it is called for an already added device?
> (Added a few people to Cc: that might be able to comment this. I don't
> even know if there is a reliable way to check if a device is already
> added.)

Yes I also had doubts about that. However, apart from this patch there are
three other places in arch/arm/mach-imx/ where dma_declare_coherent_memory()
is called after calling platform_device_register_full().

Perhaps this is enough reason to extend platform_device_register_full().

It would be great to get some more feedback on this and also if there is a
reliable way to check if a device is already added.

Best regards,

Emil Goode

WARNING: multiple messages have this Message-ID (diff)
From: Emil Goode <emilgoode@gmail.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Shawn Guo <shawn.guo@freescale.com>,
	kernel@pengutronix.de, Russell King <linux@arm.linux.org.uk>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Vinod Koul <vinod.koul@intel.com>,
	Dan Williams <dan.j.williams@intel.com>
Subject: Re: [PATCH 2/2] ARM: imx: convert camera init to use platform_device_register_full()
Date: Tue, 20 May 2014 13:43:15 +0200	[thread overview]
Message-ID: <20140520114315.GA4438@lianli> (raw)
In-Reply-To: <20140519062722.GE16662@pengutronix.de>

Hello Uwe,

Thank you for the review and sorry for the late response.

On Mon, May 19, 2014 at 08:27:22AM +0200, Uwe Kleine-König wrote:
> Hello Emil,
> 
> thanks for your effort.
> 
> On Sun, May 18, 2014 at 10:51:00PM +0200, Emil Goode wrote:
> > This converts the imx camera allocation and initialization functions
> > to use platform_device_register_full() thus simplifying the code.
> > 
> > Signed-off-by: Emil Goode <emilgoode@gmail.com>
> > ---
> > Only build tested, unfortunately I currently don't have the hardware.
> > 
> >  arch/arm/mach-imx/devices/platform-ipu-core.c |   43 +++++++++----------------
> >  arch/arm/mach-imx/mach-mx31_3ds.c             |    5 ++-
> >  arch/arm/mach-imx/mach-mx31moboard.c          |    6 ++--
> >  arch/arm/mach-imx/mach-mx35_3ds.c             |    5 ++-
> >  arch/arm/mach-imx/mach-pcm037.c               |    5 ++-
> >  5 files changed, 23 insertions(+), 41 deletions(-)
> > 
> > diff --git a/arch/arm/mach-imx/devices/platform-ipu-core.c b/arch/arm/mach-imx/devices/platform-ipu-core.c
> > index 6bd7c3f..13ea542 100644
> > --- a/arch/arm/mach-imx/devices/platform-ipu-core.c
> > +++ b/arch/arm/mach-imx/devices/platform-ipu-core.c
> > @@ -69,42 +69,29 @@ struct platform_device *__init imx_alloc_mx3_camera(
> IMHO you should better rename the function because now it doesn't only
> allocate the device, but also registers it.

Agreed.

> 
> Also I doubt that it's OK to call dma_declare_coherent_memory after the
> device is added. In this case maybe extend
> platform_device_register_full? And also add a warning to
> dma_declare_coherent_memory if it is called for an already added device?
> (Added a few people to Cc: that might be able to comment this. I don't
> even know if there is a reliable way to check if a device is already
> added.)

Yes I also had doubts about that. However, apart from this patch there are
three other places in arch/arm/mach-imx/ where dma_declare_coherent_memory()
is called after calling platform_device_register_full().

Perhaps this is enough reason to extend platform_device_register_full().

It would be great to get some more feedback on this and also if there is a
reliable way to check if a device is already added.

Best regards,

Emil Goode

  reply	other threads:[~2014-05-20 11:43 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-18 20:50 [PATCH 0/2] ARM: imx: bug fix and convertion to platform_device_register_full() Emil Goode
2014-05-18 20:50 ` Emil Goode
2014-05-18 20:50 ` Emil Goode
2014-05-18 20:50 ` [PATCH 1/2 v4] ARM: imx: fix error handling in ipu device registration Emil Goode
2014-05-18 20:50   ` Emil Goode
2014-05-18 20:50   ` Emil Goode
2014-05-19  6:31   ` Uwe Kleine-König
2014-05-19  6:31     ` Uwe Kleine-König
2014-05-19  6:31     ` Uwe Kleine-König
2014-05-19  6:47     ` Shawn Guo
2014-05-19  6:47       ` Shawn Guo
2014-05-19  6:47       ` Shawn Guo
2014-05-18 20:51 ` [PATCH 2/2] ARM: imx: convert camera init to use platform_device_register_full() Emil Goode
2014-05-18 20:51   ` Emil Goode
2014-05-18 20:51   ` Emil Goode
2014-05-19  6:27   ` Uwe Kleine-König
2014-05-19  6:27     ` Uwe Kleine-König
2014-05-19  6:27     ` Uwe Kleine-König
2014-05-20 11:43     ` Emil Goode [this message]
2014-05-20 11:43       ` Emil Goode
2014-05-20 11:43       ` Emil Goode
2014-05-22 10:32     ` Emil Goode
2014-05-22 10:32       ` Emil Goode
2014-05-22 10:32       ` Emil Goode

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=20140520114315.GA4438@lianli \
    --to=emilgoode@gmail.com \
    --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 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.