Message ID | 12f2142991690d2b1d6890821f6e7779a4d4bdc0.1666706435.git.geert+renesas@glider.be |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1029587wru; Tue, 25 Oct 2022 07:09:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Kai1RcLuoDY1gUlnNb0mKe5Z6dBZZbMGI7o91qQxNvXpx1oOTvxu2kkjYPmRSy0MixM8D X-Received: by 2002:a17:902:ec86:b0:185:483e:e4ec with SMTP id x6-20020a170902ec8600b00185483ee4ecmr39216797plg.164.1666706997555; Tue, 25 Oct 2022 07:09:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666706997; cv=none; d=google.com; s=arc-20160816; b=UzGKLU+BhxbYkeWJ4TSwynqPKHaWRAdJsdDo6AfWIdo92/kGYjxBQ0/if5QHe4E5aO z39u6CvuejJRZqpb2Suei9zL056sZhUZBRUhpQ/Zt540fXP8MIvqbZMqfMzgNNUOEubn kBjGWSBljDveSQQxzyFOn2MYFnrHE+vLQsZcpZNTyRj1xU4SgSZM8l5kQNarM1nicUOU o7BewrdOLFlU/z6rx2NjpO6UB7+rXGt4omIX8P8cVMPHfZPbJq9dAnklC7q0TzCV7J74 4OYQZ1Wbz3VXNfBvwST3axgOwFFubF3JpNkxa2fHUP8+CRLMX4Bnc42tmxuUZ/ZNQf5Y s9DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Vevq2XZppOuZdLEidBLZJre7pnMfKYi92FqUkVQjTR0=; b=Nt/vYrjwkgXTQYxFuBOBasKRrCuvfRvi58zU7MicXm5Myfy4LX7XvPCyNOFGj8aLnG djcMCkEYQaQ3Xy8HP2Z2nnOHnKKmduiDxndyo3jQojhHmCwAbQRWlPSemqZq/cA9phT4 8W5SJoC9XEetSGhC1vGAI1aEMxZLGPmupE0ASACVQC1BVnCeP+SNcc+yOxPMUoyQtHDX vSGO+i2BtyFkrT5IWb0pT+jI7jzaPl1TLZr5Iy9bl1ZpLLXxBj7Ai8Mi9g/mxLddu/Tu y5tpT/0f74Z8nPWpGOdFnqaAegLYJc3AdbDaM30CA5FQXFGocCNDJdNLQh/XthrXyOCo t03g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d195-20020a6336cc000000b0046ec396db31si3042724pga.857.2022.10.25.07.09.27; Tue, 25 Oct 2022 07:09:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231795AbiJYOIL (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Tue, 25 Oct 2022 10:08:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232625AbiJYOH2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 25 Oct 2022 10:07:28 -0400 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA57017A03A for <linux-kernel@vger.kernel.org>; Tue, 25 Oct 2022 07:03:49 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed10:9dd:efb4:9ae5:d7b4]) by andre.telenet-ops.be with bizsmtp id cE3m2800S1HY1Pb01E3mMj; Tue, 25 Oct 2022 16:03:47 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from <geert@linux-m68k.org>) id 1onKWw-001R1Q-Cp; Tue, 25 Oct 2022 16:03:46 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from <geert@linux-m68k.org>) id 1onKWv-00ERYC-NG; Tue, 25 Oct 2022 16:03:45 +0200 From: Geert Uytterhoeven <geert+renesas@glider.be> To: Thierry Reding <thierry.reding@gmail.com>, =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= <u.kleine-koenig@pengutronix.de> Cc: Biju Das <biju.das.jz@bp.renesas.com>, linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven <geert+renesas@glider.be> Subject: [PATCH] pwm: Add missing dummy for devm_pwmchip_add() Date: Tue, 25 Oct 2022 16:03:42 +0200 Message-Id: <12f2142991690d2b1d6890821f6e7779a4d4bdc0.1666706435.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747668956700043972?= X-GMAIL-MSGID: =?utf-8?q?1747668956700043972?= |
Series |
pwm: Add missing dummy for devm_pwmchip_add()
|
|
Commit Message
Geert Uytterhoeven
Oct. 25, 2022, 2:03 p.m. UTC
The PWM subsystem supports compile-testing if CONFIG_PWM is disabled.
However, no dummy is provided for devm_pwmchip_add(), which may lead to
build failures.
Fixes: bcda91bf86c1ff76 ("pwm: Add a device-managed function to add PWM chips")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
include/linux/pwm.h | 5 +++++
1 file changed, 5 insertions(+)
Comments
Hello Geert, On Tue, Oct 25, 2022 at 04:03:42PM +0200, Geert Uytterhoeven wrote: > The PWM subsystem supports compile-testing if CONFIG_PWM is disabled. > However, no dummy is provided for devm_pwmchip_add(), which may lead to > build failures. > > Fixes: bcda91bf86c1ff76 ("pwm: Add a device-managed function to add PWM chips") > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Is this a problem that today yields a failure to compile? As of v6.1-rc1 and also in next all callers are below drivers/pwm/ which isn't included in the build without PWM=y. Am I missing something or is this just preparing that one of the drivers that doesn't live in drivers/pwm might call devm_pwmchip_add in the future? In that case I wouldn't add that Fixes: line (and also oppose to backporting that commit to stable). Best regards Uwe
Hi Uwe, On Wed, Oct 26, 2022 at 2:17 AM Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote: > On Tue, Oct 25, 2022 at 04:03:42PM +0200, Geert Uytterhoeven wrote: > > The PWM subsystem supports compile-testing if CONFIG_PWM is disabled. > > However, no dummy is provided for devm_pwmchip_add(), which may lead to > > build failures. > > > > Fixes: bcda91bf86c1ff76 ("pwm: Add a device-managed function to add PWM chips") > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > > Is this a problem that today yields a failure to compile? As of v6.1-rc1 > and also in next all callers are below drivers/pwm/ which isn't included > in the build without PWM=y. So none of these support compile-testing with CONFIG_PWM=n... > Am I missing something or is this just preparing that one of the drivers > that doesn't live in drivers/pwm might call devm_pwmchip_add in the > future? I saw it with the RZ/G2L MTU3 PWM driver[1], which is not yet applied. After noticing its sibling counter driver lacked a dependency on CONFIG_COUNTER, I tried disabling CONFIG_PWM... > In that case I wouldn't add that Fixes: line (and also oppose to > backporting that commit to stable). I tend to disagree: more drivers may be converted to devm_pwmchip_add() in the future, possibly as part of a fix, causing troubles for the stable team when backporting such fixes. Thanks! [1] https://lore.kernel.org/all/CAMuHMdWE+H=aXkt61hZK6mbQairwdk1F522mZRemC0T5LxQtMg@mail.gmail.com Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Hello, On Wed, Oct 26, 2022 at 09:05:42AM +0200, Geert Uytterhoeven wrote: > On Wed, Oct 26, 2022 at 2:17 AM Uwe Kleine-König > <u.kleine-koenig@pengutronix.de> wrote: > > On Tue, Oct 25, 2022 at 04:03:42PM +0200, Geert Uytterhoeven wrote: > > > The PWM subsystem supports compile-testing if CONFIG_PWM is disabled. > > > However, no dummy is provided for devm_pwmchip_add(), which may lead to > > > build failures. > > > > > > Fixes: bcda91bf86c1ff76 ("pwm: Add a device-managed function to add PWM chips") > > > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> > > > > Is this a problem that today yields a failure to compile? As of v6.1-rc1 > > and also in next all callers are below drivers/pwm/ which isn't included > > in the build without PWM=y. > > So none of these support compile-testing with CONFIG_PWM=n... There are not many pwm providers outside of drivers/pwm: - drivers/gpio/gpio-mvebu.c - drivers/gpu/drm/bridge/ti-sn65dsi86.c - drivers/leds/rgb/leds-qcom-lpg.c - drivers/staging/greybus/pwm.c These all call pwmchip_add() which has a dummy. gpio-mvebu only uses it in an if (IS_ENABLED(CONFIG_PWM)) block. ti-sn65dsi86 has it in a big #ifdef CONFIG_PWM block (and in a dedicated driver such that the returned error doesn't hurt). leds-qcom-lpg.c depends on PWM as does the greybus stuff. So the dummy isn't even needed. (Unless for the corner case GPIO_MVEBU=y + PWM=m which is probably a bug worth fixing. Maybe a similar issue exists for ti-sn65dsi86.) > > Am I missing something or is this just preparing that one of the drivers > > that doesn't live in drivers/pwm might call devm_pwmchip_add in the > > future? > > I saw it with the RZ/G2L MTU3 PWM driver[1], which is not yet applied. > After noticing its sibling counter driver lacked a dependency on > CONFIG_COUNTER, I tried disabling CONFIG_PWM... > > > In that case I wouldn't add that Fixes: line (and also oppose to > > backporting that commit to stable). > > I tend to disagree: more drivers may be converted to devm_pwmchip_add() > in the future, possibly as part of a fix, causing troubles for the > stable team when backporting such fixes. Please don't backport as a precaution not to miss to backport it in case there is another patch that depends on it. In my experience the stable maintainers are good at identifying such dependencies. Best regards Uwe
Hello, On Thu, Nov 17, 2022 at 12:27:58PM +0100, Uwe Kleine-König wrote: > So the dummy isn't even needed. (Unless for the corner case GPIO_MVEBU=y > + PWM=m which is probably a bug worth fixing. Maybe a similar issue > exists for ti-sn65dsi86.) FTR: That is not a problem, PWM is bool and so cannot be =m. Best regards Uwe
diff --git a/include/linux/pwm.h b/include/linux/pwm.h index d70c6e5a839d6902..bba492eea96c5552 100644 --- a/include/linux/pwm.h +++ b/include/linux/pwm.h @@ -478,6 +478,11 @@ static inline int pwmchip_remove(struct pwm_chip *chip) return -EINVAL; } +static inline int devm_pwmchip_add(struct device *dev, struct pwm_chip *chip) +{ + return -EINVAL; +} + static inline struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip, unsigned int index, const char *label)