All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-media@vger.kernel.org,
	Mike Turquette <mturquette@linaro.org>,
	Mauro Carvalho Chehab <mchehab@redhat.com>
Subject: Re: [PATCH 1/2] omap3isp: Use the common clock framework
Date: Thu, 04 Apr 2013 13:27:32 +0200	[thread overview]
Message-ID: <515D63A4.2060108@samsung.com> (raw)
In-Reply-To: <20130404112004.GG10541@valkosipuli.retiisi.org.uk>

Hi Sakari,

On 04/04/2013 01:20 PM, Sakari Ailus wrote:
> Hi Laurent,
> 
> I don't remember when did I see equally nice patch to the omap3isp driver!
> :-) Thanks!
> 
> A few comments below.
> 
> On Thu, Apr 04, 2013 at 01:08:38PM +0200, Laurent Pinchart wrote:
> ...

>> +		xclk->lookup = kzalloc(sizeof(*xclk->lookup), GFP_KERNEL);
> 
> How about devm_kzalloc()? You'd save a bit of error handling (which is btw.
> missing now, as well as kfree in cleanup).

clkdev_drop() will free memory allocated here. So using devm_kzalloc()
wouldn't be correct.

>> +		if (xclk->lookup == NULL)
>> +			return -ENOMEM;
>> +
>> +		xclk->lookup->con_id = pdata->xclks[i].con_id;
>> +		xclk->lookup->dev_id = pdata->xclks[i].dev_id;
>> +		xclk->lookup->clk = clk;
>> +
>> +		clkdev_add(xclk->lookup);
>> +	}
>> +
>> +	return 0;
>> +}
>> +
>> +static void isp_xclk_cleanup(struct isp_device *isp)
>> +{
>> +	unsigned int i;
>> +
>> +	for (i = 0; i < ARRAY_SIZE(isp->xclks); ++i) {
>> +		struct isp_xclk *xclk = &isp->xclks[i];
>> +
>> +		if (xclk->lookup)
>> +			clkdev_drop(xclk->lookup);
>> +	}
>> +}

Regards,
Sylwester


  reply	other threads:[~2013-04-04 11:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-04 11:08 [PATCH 0/2] OMAP3 ISP common clock framework support Laurent Pinchart
2013-04-04 11:08 ` [PATCH 1/2] omap3isp: Use the common clock framework Laurent Pinchart
2013-04-04 11:20   ` Sakari Ailus
2013-04-04 11:27     ` Sylwester Nawrocki [this message]
2013-04-04 13:07       ` Sakari Ailus
2013-04-04 11:34     ` Laurent Pinchart
2013-04-04 11:08 ` [PATCH 2/2] mt9p031: " Laurent Pinchart
2013-04-04 21:25 ` [PATCH 0/2] OMAP3 ISP common clock framework support Mauro Carvalho Chehab

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=515D63A4.2060108@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=mturquette@linaro.org \
    --cc=sakari.ailus@iki.fi \
    /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.