linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: Benoit Cousson <b-cousson@ti.com>
Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	paul@pwsan.com, Nishanth Menon <nm@ti.com>
Subject: Re: [PATCH 2/7] OMAP: PM: omap_device: add few quick access functions
Date: Wed, 31 Aug 2011 15:23:24 -0700	[thread overview]
Message-ID: <87r5418bkz.fsf@ti.com> (raw)
In-Reply-To: <1314026347-21623-3-git-send-email-b-cousson@ti.com> (Benoit Cousson's message of "Mon, 22 Aug 2011 17:19:02 +0200")

Benoit Cousson <b-cousson@ti.com> writes:

> From: Nishanth Menon <nm@ti.com>
>
> Provide a quick set of access functions:
> a) Convert omap_device to platform_device - This is the flip of
>    to_omap_device for equivalent usage
> b) Convert omap_device to device pointer - This is useful for
>    most devices that need to go through standard linux functions that
>    take device pointer.
> c) Convert hwmod to device pointer - This wrapper provides ability for
>    drivers to convert directly from hwmod name back to device pointer
>    without having to handle this on a driver by driver basis
>
> Signed-off-by: Nishanth Menon <nm@ti.com>
> [b-cousson@ti.com: Adapt it to the new pdev pointer inside od]
> Signed-off-by: Benoit Cousson <b-cousson@ti.com>
> ---
>  arch/arm/plat-omap/include/plat/omap_device.h |   15 +++++++++++++++
>  1 files changed, 15 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-omap/include/plat/omap_device.h b/arch/arm/plat-omap/include/plat/omap_device.h
> index bdc2804..903f329 100644
> --- a/arch/arm/plat-omap/include/plat/omap_device.h
> +++ b/arch/arm/plat-omap/include/plat/omap_device.h
> @@ -152,6 +152,21 @@ static inline struct omap_device *to_omap_device(struct platform_device *pdev)
>  	return pdev ? pdev->archdata.od : NULL;
>  }
>  
> +/* Convert omap_device to platform device pointer */
> +#define omap_device_get_pdev(x) ((x)->pdev)
> +/* Convert omap_device to device pointer */
> +#define omap_device_get_dev(x) (&omap_device_get_pdev(x)->dev)

I don't see these used elsewhere, and I don't think they're needed...

> +/* Convert omap_hwmod name to device pointer */
> +static inline struct device *omap_hwmod_name_get_dev(const char *oh_name)
> +{
> +	struct omap_device *od;
> +	od = omap_hwmod_name_get_odev(oh_name);
> +	if (IS_ERR_OR_NULL(od))
> +		return ERR_PTR(od ? PTR_ERR(od) : -ENODEV);
> +	return omap_device_get_dev(od);
> +}
> +

After comments on patch 1 are addressed, the 

      pdev = omap_hwmod_name_get_pdev(oh_name)
      return &pdev->dev;

Kevin

>  static inline
>  void omap_device_disable_idle_on_suspend(struct platform_device *pdev)
>  {

  reply	other threads:[~2011-08-31 22:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-22 15:19 [PATCH 0/7] OMAP: omap_device cleanup before device-tree integration Benoit Cousson
2011-08-22 15:19 ` [PATCH 1/7] OMAP: PM: omap_device: add omap_hwmod_name_get_odev Benoit Cousson
2011-08-31 22:20   ` Kevin Hilman
2011-09-01 11:48     ` Cousson, Benoit
2011-09-01 20:44       ` Menon, Nishanth
2011-09-26 18:18   ` Kevin Hilman
2011-08-22 15:19 ` [PATCH 2/7] OMAP: PM: omap_device: add few quick access functions Benoit Cousson
2011-08-31 22:23   ` Kevin Hilman [this message]
2011-09-01 11:55     ` Cousson, Benoit
2011-09-01 14:55       ` Kevin Hilman
2011-09-02 12:39     ` Cousson, Benoit
2011-08-22 15:19 ` [PATCH 3/7] OMAP3: beagle-board: Use the omap_hwmod_name_get_dev API Benoit Cousson
2011-08-31 22:24   ` Kevin Hilman
2011-08-22 15:19 ` [PATCH 4/7] OMAP2+: pm: Use hwmod name instead of dev pointer Benoit Cousson
2011-08-31 22:24   ` Kevin Hilman
2011-08-22 15:19 ` [PATCH 5/7] OMAP2+: pm: Remove static devices variable for mpu, dsp, iva and l3 PM Benoit Cousson
2011-08-31 22:25   ` Kevin Hilman
2011-08-22 15:19 ` [PATCH 6/7] OMAP: omap_device: Create a default omap_device_pm_latency Benoit Cousson
2011-08-31 22:30   ` Kevin Hilman
2011-08-22 15:19 ` [PATCH 7/7] OMAP2+: devices: Remove all omap_device_pm_latency structures Benoit Cousson
2011-08-31 22:31   ` Kevin Hilman
2011-09-01 11:59     ` Cousson, Benoit
2011-09-01 16:28 ` [PATCH 0/7] OMAP: omap_device cleanup before device-tree integration Kevin Hilman

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=87r5418bkz.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=b-cousson@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=paul@pwsan.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;
as well as URLs for NNTP newsgroup(s).