All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Sakari Ailus <sakari.ailus@iki.fi>,
	linux-media@vger.kernel.org, kyungmin.park@samsung.com,
	sw0312.kim@samsung.com, a.hajda@samsung.com,
	hj210.choi@samsung.com, shaik.ameer@samsung.com,
	arun.kk@samsung.com
Subject: Re: [REVIEW PATCH v3 1/2] media: Change media device link_notify behaviour
Date: Mon, 10 Jun 2013 12:59:43 +0200	[thread overview]
Message-ID: <51B5B19F.6000200@samsung.com> (raw)
In-Reply-To: <17805842.6Cz4b94dag@avalon>

On 06/10/2013 12:49 PM, Laurent Pinchart wrote:
>>>> -static int isp_pipeline_link_notify(struct media_pad *source,
>>>> > >> -				    struct media_pad *sink, u32 flags)
>>>> > >> +static int isp_pipeline_link_notify(struct media_link *link, u32 flags,
>>>> > >> +				    unsigned int notification)
>>>> > >> 
>>>> > >>   {
>>>> > >> 
>>>> > >> -	int source_use = isp_pipeline_pm_use_count(source->entity);
>>>> > >> -	int sink_use = isp_pipeline_pm_use_count(sink->entity);
>>>> > >> +	struct media_entity *source = link->source->entity;
>>>> > >> +	struct media_entity *sink = link->sink->entity;
>>>> > >> +	int source_use = isp_pipeline_pm_use_count(source);
>>>> > >> +	int sink_use = isp_pipeline_pm_use_count(sink);
>>>> > >> 
>>>> > >>   	int ret;
>>>> > >> 
>>>> > >> -	if (!(flags & MEDIA_LNK_FL_ENABLED)) {
>>>> > >> +	if (notification == MEDIA_DEV_NOTIFY_POST_LINK_CH &&
>>>> > >> +	    !(link->flags & MEDIA_LNK_FL_ENABLED)) {
>>>> > >> 
>>>> > >>   		/* Powering off entities is assumed to never fail. */
>>>> > >> 
>>>> > >> -		isp_pipeline_pm_power(source->entity, -sink_use);
>>>> > >> -		isp_pipeline_pm_power(sink->entity, -source_use);
>>>> > >> +		isp_pipeline_pm_power(source, -sink_use);
>>>> > >> +		isp_pipeline_pm_power(sink, -source_use);
>>>> > >> 
>>>> > >>   		return 0;
>>>> > >>   	
>>>> > >>   	}
>>>> > >> 
>>>> > >> -	ret = isp_pipeline_pm_power(source->entity, sink_use);
>>>> > >> -	if (ret < 0)
>>>> > >> -		return ret;
>>>> > >> +	if (notification == MEDIA_DEV_NOTIFY_PRE_LINK_CH &&
>>>> > >> +		(flags & MEDIA_LNK_FL_ENABLED)) {
>>> > > 
>>> > > You could return zero here if the opposite was true, and unindent the
>>> > > rest. Up to you --- the patch is fine.
>
> I would personally keep the code as-is, to keep the symmetry, but I'm fine 
> with both :-)

I had also an impression that it looks more symmetric as-is. I would leave it
unchanged then. ;)

Regards,
Sylwester

  reply	other threads:[~2013-06-10 10:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-09 20:14 [REVIEW PATCH v3 0/2] Media link_notify behaviour change and exynos4-is updates Sylwester Nawrocki
2013-06-09 20:14 ` [REVIEW PATCH v3 1/2] media: Change media device link_notify behaviour Sylwester Nawrocki
2013-06-09 20:33   ` Laurent Pinchart
2013-06-09 22:10   ` Sakari Ailus
2013-06-10  9:46     ` Laurent Pinchart
2013-06-10 10:20       ` Sylwester Nawrocki
2013-06-10 10:21         ` Laurent Pinchart
2013-06-10 10:47     ` Sylwester Nawrocki
2013-06-10 10:49       ` Laurent Pinchart
2013-06-10 10:59         ` Sylwester Nawrocki [this message]
2013-06-09 20:14 ` [REVIEW PATCH v3 2/2] exynos4-is: Extend link_notify handler to support fimc-is/lite pipelines Sylwester Nawrocki

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=51B5B19F.6000200@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=arun.kk@samsung.com \
    --cc=hj210.choi@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@iki.fi \
    --cc=shaik.ameer@samsung.com \
    --cc=sw0312.kim@samsung.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.