From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753637AbeBSSWe (ORCPT ); Mon, 19 Feb 2018 13:22:34 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:39997 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753609AbeBSSWb (ORCPT ); Mon, 19 Feb 2018 13:22:31 -0500 X-Google-Smtp-Source: AH8x227P7xwakrSWTaGXoLSNHb2/FxNSLnbSYr+kIb1JuuPyws6ibzbAWk7gWaI3K1hEjRpEb7TEdP0vjLkRfLXdW2c= MIME-Version: 1.0 In-Reply-To: <1519055046-2399-2-git-send-email-m.purski@samsung.com> References: <1519055046-2399-1-git-send-email-m.purski@samsung.com> <1519055046-2399-2-git-send-email-m.purski@samsung.com> From: Emil Velikov Date: Mon, 19 Feb 2018 18:22:29 +0000 Message-ID: Subject: Re: [PATCH 1/8] clk: Add clk_bulk_alloc functions To: Maciej Purski Cc: linux-media@vger.kernel.org, "moderated list:ARM/S5P EXYNOS AR..." , LAKML , ML dri-devel , "Linux-Kernel@Vger. Kernel. Org" , linux-clk@vger.kernel.org, David Airlie , Michael Turquette , Kamil Debski , Sylwester Nawrocki , Marek Szyprowski , Thibault Saunier , Russell King , Krzysztof Kozlowski , Javier Martinez Canillas , Kukjin Kim , Hoegeun Kwon , Bartlomiej Zolnierkiewicz , Jeongtae Park , Jacek Anaszewski , Andrzej Pietrasiewicz , Mauro Carvalho Chehab , Stephen Boyd , Seung-Woo Kim , Hans Verkuil , Kyungmin Park Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 > #include > #include > +#include > The extra header declaration should not be needed. One should be able to forward declare any undefined structs. HTH Emil