[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACvgo50-Cx_=yvbLD-osxHXnrdENHpwFBkrXT_jV4R9vJniTjw@mail.gmail.com>
Date: Mon, 19 Feb 2018 18:22:29 +0000
From: Emil Velikov <emil.l.velikov@...il.com>
To: Maciej Purski <m.purski@...sung.com>
Cc: linux-media@...r.kernel.org,
"moderated list:ARM/S5P EXYNOS AR..."
<linux-samsung-soc@...r.kernel.org>,
LAKML <linux-arm-kernel@...ts.infradead.org>,
ML dri-devel <dri-devel@...ts.freedesktop.org>,
"Linux-Kernel@...r. Kernel. Org" <linux-kernel@...r.kernel.org>,
linux-clk@...r.kernel.org, David Airlie <airlied@...ux.ie>,
Michael Turquette <mturquette@...libre.com>,
Kamil Debski <kamil@...as.org>,
Sylwester Nawrocki <s.nawrocki@...sung.com>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Thibault Saunier <thibault.saunier@....samsung.com>,
Russell King <linux@...linux.org.uk>,
Krzysztof Kozlowski <krzk@...nel.org>,
Javier Martinez Canillas <javier@....samsung.com>,
Kukjin Kim <kgene@...nel.org>,
Hoegeun Kwon <hoegeun.kwon@...sung.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
Jeongtae Park <jtp.park@...sung.com>,
Jacek Anaszewski <jacek.anaszewski@...il.com>,
Andrzej Pietrasiewicz <andrzej.p@...sung.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Stephen Boyd <sboyd@...nel.org>,
Seung-Woo Kim <sw0312.kim@...sung.com>,
Hans Verkuil <hansverk@...co.com>,
Kyungmin Park <kyungmin.park@...sung.com>
Subject: Re: [PATCH 1/8] clk: Add clk_bulk_alloc functions
HI Maciej,
Just sharing a couple of fly-by ideas - please don't read too much into them.
On 19 February 2018 at 15:43, Maciej Purski <m.purski@...sung.com> wrote:
> When a driver is going to use clk_bulk_get() function, it has to
> initialize an array of clk_bulk_data, by filling its id fields.
>
> Add a new function to the core, which dynamically allocates
> clk_bulk_data array and fills its id fields. Add clk_bulk_free()
> function, which frees the array allocated by clk_bulk_alloc() function.
> Add a managed version of clk_bulk_alloc().
>
Most places use a small fixed number of struct clk pointers.
Using devres + kalloc to allocate 1-4 pointers feels a bit strange.
Quick grep shows over 150 instances that could be updated to use the new API.
Adding a cocci script to simplify the transition would be a good idea.
> --- a/include/linux/clk.h
> +++ b/include/linux/clk.h
> @@ -15,6 +15,7 @@
> #include <linux/err.h>
> #include <linux/kernel.h>
> #include <linux/notifier.h>
> +#include <linux/slab.h>
>
The extra header declaration should not be needed. One should be able
to forward declare any undefined structs.
HTH
Emil
Powered by blists - more mailing lists