All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damian Hobson-Garcia <dhobsong@igel.co.jp>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 1/5 v3] fbdev: sh_mobile_meram: Add enable/disble hooks
Date: Wed, 29 Jun 2011 05:26:57 +0000	[thread overview]
Message-ID: <4E0AB7A1.5050009@igel.co.jp> (raw)
In-Reply-To: <1308728992-9660-2-git-send-email-dhobsong@igel.co.jp>

Hi Paul,

On 2011/06/24 14:34, Paul Mundt wrote:
> On Wed, Jun 22, 2011 at 04:49:48PM +0900, Damian Hobson-Garcia wrote:
>> +static int sh_mobile_meram_pm_get_sync(struct sh_mobile_meram_info *pdata)
>> +{
>> +	if (!pdata || !pdata->pdev)
>> +		return -EINVAL;
>> +
>> +	dev_dbg(&pdata->pdev->dev, "Enabling sh_mobile_meram clock.");
>> +	pm_runtime_get_sync(&pdata->pdev->dev);
>> +	return 0;
>> +}
>> +
> 
> On Wed, Jun 22, 2011 at 04:49:49PM +0900, Damian Hobson-Garcia wrote:
>> @@ -259,6 +259,11 @@ static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
>>  		pm_runtime_get_sync(priv->dev);
>>  		if (priv->dot_clk)
>>  			clk_enable(priv->dot_clk);
>> +		if (priv->meram_dev && priv->meram_dev->ops) {
>> +			struct sh_mobile_meram_info *mdev;
>> +			mdev = priv->meram_dev;
>> +			mdev->ops->meram_pm_get_sync(mdev);
>> +		}
>>  	}
>>  }
>>  
> I'm not sure that I really see the point in the callbacks. The callbacks
> would make sense in the case where you're dealing with opaque types that
> you don't wish to have knowledge of in the other drivers, but when all
> you're doing is fetching the pointer and wrapping verbatim in to the
> runtime pm calls, it just seems like a pointless layer of indirection.
> 
> You could easily just do this as:
> 
> 	if (priv->meram_dev)
> 		pm_runtime_get_sync(&priv->meram_dev->pdev->dev);
> 
> and be done with it.
> 
> This will also save you from having to add additional callbacks should
> you decide that you suddenly require async behaviour or so in other
> cases, too.
Thanks for your comment.

You raise a good point here.  I'll get rid of the useless call.

Damian

      parent reply	other threads:[~2011-06-29  5:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22  7:49 [PATCH 1/5 v3] fbdev: sh_mobile_meram: Add enable/disble hooks for LCDC Damian Hobson-Garcia
2011-06-24  5:34 ` Paul Mundt
2011-06-29  5:26 ` Damian Hobson-Garcia [this message]

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=4E0AB7A1.5050009@igel.co.jp \
    --to=dhobsong@igel.co.jp \
    --cc=linux-fbdev@vger.kernel.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.