Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1244302ybt; Thu, 2 Jul 2020 00:04:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTZIsz0MlgBms5EOLYWTkn65ihHwq1gvEJja16XxjhDCUNgSBwouolXY10zK3Q5nU/b3Lv X-Received: by 2002:a17:906:c285:: with SMTP id r5mr25618550ejz.153.1593673465674; Thu, 02 Jul 2020 00:04:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593673465; cv=none; d=google.com; s=arc-20160816; b=AgOtjF/NqhiconF/2KRUkpfL+Ck8fwwshlbxyBt0TYxa63q7UGLuepmhtNnOnIdDNv r4hiWlgvGdlHPgxrhtlZY9q5+s+bEelQb5vmv1/pybyOwQlxwhRU2Nnd3czWhA55EM+S SlMAlhG5b0+72dLvWuiaU1eAbOTObhu0f5yGcL3UR4ZZdevc9bn7sUKEPnxVUgBIjrX1 7GGqDB6J8BiUeB3n/KinCJ/u5fCII8U+fmtk3hQlbccu/OD9K0jfcl2NuRaBO23U1BMB lVJlZA92RvgYJb9VvNYPHrBYZYl5OeIq/QjKx/OzpJxByk2QRaeG64SoRIOwgyy3fkV9 esyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=lvIhhCTSef87x+aYVIjLikTTnhPBJvWYYGqn9Mx9ytw=; b=lcm49OsGFeyp96OjD2jDnT+94iJayI5N99mz8oAEeuGFlwE05whkhjmWep39NPFan5 21B4f1ruzLUuKmqvrcf7qO8XPbXzH9BjH+utMf6CMyDBXDXyIkQUB6RaS1YnqrbeMRdB z0vGBkX1TdfMZPWb9hevna+DlCp4nNKTf8hQqBPIDZ2E8qduvWVAFR12eI0KlHJyHCdU zauTjfFDu7xKqB4u2MWBfuuVTvNHhjBWr7b/BCk7Qc8UzUSgkSP7Lk0N+HbyN2qlGwnP 9TXCKy4xPeeqodxLQOYWjL/jzJ//UfwltSPj5Excop4ua8yUhxEjB5poHaDRVmzo5mdm OqLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n4si2840131ejg.426.2020.07.02.00.04.02; Thu, 02 Jul 2020 00:04:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726750AbgGBHDw (ORCPT + 99 others); Thu, 2 Jul 2020 03:03:52 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:53197 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726092AbgGBHDw (ORCPT ); Thu, 2 Jul 2020 03:03:52 -0400 Received: from mail-qk1-f172.google.com ([209.85.222.172]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPSA (Nemesis) id 1MLA2e-1jZuL90XNi-00IClm; Thu, 02 Jul 2020 09:03:49 +0200 Received: by mail-qk1-f172.google.com with SMTP id k18so24695955qke.4; Thu, 02 Jul 2020 00:03:48 -0700 (PDT) X-Gm-Message-State: AOAM533/8N3rpApox64MT2iAtrjVg7SBZz82+5U9I97yZ+M4W79k3cNO G7oBZJXkS1gYRTc8qMRlPUL0A633PrqGkDVhBV4= X-Received: by 2002:a37:a496:: with SMTP id n144mr28916015qke.286.1593673427914; Thu, 02 Jul 2020 00:03:47 -0700 (PDT) MIME-Version: 1.0 References: <1593656074-10092-1-git-send-email-Anson.Huang@nxp.com> <1593656074-10092-4-git-send-email-Anson.Huang@nxp.com> In-Reply-To: From: Arnd Bergmann Date: Thu, 2 Jul 2020 09:03:32 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH V4 3/5] clk: imx: Support building i.MX common clock driver as module To: Dong Aisheng Cc: Anson Huang , Michael Turquette , Stephen Boyd , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , Peng Fan , Abel Vesa , Aisheng Dong , Andy Duan , Daniel Baluta , YueHaibing , Stephen Rothwell , linux-clk , open list , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , dl-linux-imx Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:7bOCzNp5Raruey2KRYtDaaMrPtdeP5ZFJqLXmLWlnz6ojji+ouN VqBf/jEvWts7m85Y0Ryj4vLlxbg031p3GPIGz2eVjkcnQQdBcdL1x1WpBZSOvrgyChg5fZ8 F6j3lzaOO4y3w3Ccj1mtnsNQspIEF7XUBnaGsjgfaaZS5I46u/JIxakYxSAmlRvUNtD8HLQ 1aZlMq3b/pPMQC+sbfDTw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Tda3zbNPZV8=:D1Ic8xSUfHkfJ6v1TABpbJ hMHsTXk6CcBZXCT8JM7xq5zo+2aws/zyt3Kz6YSG/t1apmv++UqWJKzrgUiI8JtOgohxRyruF hNCdkQIKi1JXV82ovMs9uAMxGGmc/VrPdMKFDRFRzg6NYd2N3q2yICK9o5JvzTFs8/DuPdUfh bEJZ3XdgDtwcheIQ9OMKvezd/ZUAlrgxGJ4hNpOxVknnBFt9gI0y5HTJYgO6TamLzaQHaK5tv seZ2z8dwEuJUrN1efkV5yDWUyJBwhOXONUQcR1x/LK5H0QMJp+J47BGBJs9VM1g/JJ10Z8/YQ G6Dp9diFeJAEa+JVq5FIePo47bBBzRLY5wEyKuo2al+JOGclM5ubIIO754fdvG6ZLRT9pneOm 2o5tZVMVU+88tyAvAWHk9MKsJTknyqGFh6fwg9JqJClbSj6UHDXf1zpWQCfti+RkCE3tqqMjx btgbA7W+CvWA8UR3TFPz7vmGjOBLDvY5ycPiMf6Je9auSCpaQkCzzk70geJsi8/WW9A2Rd/V6 4eeC8W7k7zeiZj9uxBQxIu/KkM/V0n1o0/xbKGH4/hngMw1ngIvC6DCUZfKpx2hJcKrv+g+jo vesL1U0WNuXuJGedGj7S33aMRy9vq20RhsrWPoEN0WCANRQaCg5R2++1DpiDrGPtnDmnfWZuy nCX3PDsgC0UdBwASU/ER5bQ18XKkM/VNxYUFNJ6BAa4JSTVl16gUWK8FFg8wXg2krWo4vRGWV MNTuawCz/V95qAYPvdB0Q+x8CSdX29Oz1w4PK4+pFj/BuH1vGizi3n/Jar+jYlmN4jDu0hv7x 7NbekmRGhLn5wnD7eMJmw8cnOqbu9+H7M7UmzBaRIilrlvAhnU= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 2, 2020 at 8:40 AM Dong Aisheng wrote: > On Thu, Jul 2, 2020 at 2:11 PM Anson Huang wrote: > > > Subject: Re: [PATCH V4 3/5] clk: imx: Support building i.MX common clock > > > > I am fine of adding the '#ifndef MODULE' to imx_clk_disable_uart() and imx_keep_uart_clocks_param() > > as well in next patch series. Others like ' imx_keep_uart_clocks ' and imx_register_uart_clocks() need to > > be kept always built, since they are used by each clock driver no matter built-in or module build. > > > > So that means I have to add another 'ifndef MODULE' or I need to adjust some code sequence to make > > those code can be built-out in same block and just use single 'ifndef MODULE', I think adjust the code > > sequence should be better, will go with this way. > > What if we condionally compile it in clk.h? Will that be easiser? Yes, that's what I expected to see in v4 after the previous discussion. If imx_register_uart_clocks() is an empty inline function, then the arrays passed to it are unused and also get dropped by the compiler. The question is whether the #ifdef check in the header to test for MODULE (only calling it if this particular soc has a built-in clk driver, which is sufficient) or for IS_MODULE(CONFIG_MXC_CLK) (call it if _any_ clk driver is built-in and the function exists, which leaves extra code in the driver but is a more conventional check). Arnd