linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: balbi@ti.com (Felipe Balbi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] I2C: OMAP: remove dev->idle, use usage counting provided by runtime PM
Date: Thu, 4 Aug 2011 18:09:51 +0300	[thread overview]
Message-ID: <20110804150951.GU17540@legolas.emea.dhcp.ti.com> (raw)
In-Reply-To: <87ipqd449a.fsf@ti.com>

Hi,

On Thu, Aug 04, 2011 at 07:53:37AM -0700, Kevin Hilman wrote:
> >> @@ -1140,6 +1128,36 @@ omap_i2c_remove(struct platform_device *pdev)
> >>  	return 0;
> >>  }
> >>  
> >> +#ifdef CONFIG_PM_RUNTIME
> >> +static int omap_i2c_runtime_suspend(struct device *dev)
> >> +{
> >> +	struct platform_device *pdev = to_platform_device(dev);
> >> +	struct omap_i2c_dev *_dev = platform_get_drvdata(pdev);
> >
> > what happened to dev_get_drvdata(dev) ??
> >
> 
> Yes, that would work too since:
> 
> static inline void *platform_get_drvdata(const struct platform_device *pdev)
> {
> 	return dev_get_drvdata(&pdev->dev);
> }
> 
> but IMO, readability is better if the driver does platform_set_drvdata()
> and then the corresponding platform_get_drvdata()

fair enough, but if you already have the dev pointer, what's the gain in
doing a container_of() just to go back to the dev pointer again ?

IMHO, there's really no need for that and just calling dev_get_drvdata()
straight is enough. All in all, platform_get_[sg]et_drvdata() are just
wrappers for dev_[sg]et_drvdata(). The whole point, was to avoid
dev_[sg]et_drvdata(&pdev->dev). It's the same with <drivername>_writel()
calls we see on all drivers. Just a wrapper, but you can use
__raw_writel() directly if you wish.

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110804/91a06100/attachment.sig>

  reply	other threads:[~2011-08-04 15:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-03 18:09 [PATCH 0/2] I2C: OMAP: misc. PM-related cleanups Kevin Hilman
2011-08-03 18:09 ` [PATCH 1/2] I2C: OMAP: remove unneccesary use of pdev Kevin Hilman
2011-08-03 22:32   ` Felipe Balbi
2011-08-03 18:09 ` [PATCH 2/2] I2C: OMAP: remove dev->idle, use usage counting provided by runtime PM Kevin Hilman
2011-08-03 22:36   ` Felipe Balbi
2011-08-04 14:53     ` Kevin Hilman
2011-08-04 15:09       ` Felipe Balbi [this message]
2011-08-04 21:50         ` Kevin Hilman
  -- strict thread matches above, loose matches on Subject: below --
2011-05-17 14:31 [PATCH 0/2] I2C: OMAP: clean up runtime PM usage Kevin Hilman
2011-05-17 14:31 ` [PATCH 2/2] I2C: OMAP: remove dev->idle, use usage counting provided by runtime PM 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=20110804150951.GU17540@legolas.emea.dhcp.ti.com \
    --to=balbi@ti.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 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).