Re: [PATCH 1/2] omap3isp: Use the common clock framework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux