Message ID | 20221108142226.63161-2-andriy.shevchenko@linux.intel.com |
---|---|
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 l7csp2740979wru; Tue, 8 Nov 2022 06:28:20 -0800 (PST) X-Google-Smtp-Source: AMsMyM57jn2y/tt17OcSjCGDpzFAm1Q3c004y0FylXrZPoavGd3OHwu4svjy+gWnwk/MltG2N8b/ X-Received: by 2002:a17:90b:33c7:b0:214:1ddc:c6bd with SMTP id lk7-20020a17090b33c700b002141ddcc6bdmr39112222pjb.151.1667917700659; Tue, 08 Nov 2022 06:28:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667917700; cv=none; d=google.com; s=arc-20160816; b=XIUcu7y/icVOBGFBS3w8hPS5o2uir2sJDSeCXZ0cA2LEK6q5Jnr+2PLYjliYo8UiFY UvNAKt6rocUpbI1FjaQ8Jzxl6FVkIAnoxwD2GRycSbx6OAKsy301FGnSvv8L3WR5To8x tNNEqPeL83v/2W0u/Nfw0Jt7UUckpdHupcZm5XAW1OZCNdcEMImfXc/Y7DghroROzg0i p4VWEmeHrMf+F6OxvWvEg1C1T1wANp3OLu3FRT7C0BsRctyQwWikb3PGN9eS1n1VAz/a hXMfADzrWtuT2I1decUdc8LRYXx8DXPiFARETs3Hz6ZSjYxLWam/4aLXCzEvJSh/h18l IS4A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ja10i/+FGGcIospyEbaZwmx5exM6xSLPnTcgO6I2Dfg=; b=B2xS0Aku9CSPAVK8ll3Uupbist/KJIZliJ38iM7+8s/44WV9Ww8ZoTHgvPZYqLSf/J uE4s7IJ340ALl24SYPr9ZnQv2vXvNRr7jQglMEyOlIm1b7GHluVFiqP0UbWxm+cDaV2z emvQ/uUA2/TLVqg87FFet3+2yk1TSd1XONZ0lYP9vqAaj5urgLzAKPHiYTqmYQ+WMAD0 qQeBLwJeRQZDQ1iMcPyqgIHs1TR690l5EJLFwJ4jJtIJyII4T6yTa1cNyo7nN1J7r1Yk CyeBQGmXkXSypw6CHGnuygc1+kA9Ehf+6Xt7gx9QrPuJd2ry+CiUjEvdExu+mqzaiqzq AMyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HWwT3AIg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k16-20020a056a00169000b005637366edb8si14925133pfc.9.2022.11.08.06.28.06; Tue, 08 Nov 2022 06:28:20 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=HWwT3AIg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234398AbiKHOWl (ORCPT <rfc822;tony84727@gmail.com> + 99 others); Tue, 8 Nov 2022 09:22:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234589AbiKHOWI (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 8 Nov 2022 09:22:08 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E51C54B13; Tue, 8 Nov 2022 06:22:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667917328; x=1699453328; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jmvq9J3vKVtopSojPs7YdH4K99jNadewdc2yE8CsvjU=; b=HWwT3AIgrd+7IjtOHLu8rOxuFRIE+nHxD9Y/YFfDpslBBK6uMbmIXPKj fGOH2Jz4/rwjPweGLDf/DfKDzv5HjE1XyGrNZAZAC91zAw/KP41I6j3mz VCmZzK6+ByKmsUinDLrD0wFUDOVfCu3wrcpKuvTpPvgPB3X/kTVPBAuHk K98NUMTfceJ+SNapnoW2BoPudAueCDegVcd+6BnTgrDtFRp5JVxj4ZgBa mw9PrcBE21vKuFNBoy+psZMjfskc+NxKUgAhp5JQRoPAgrV48bScBDd3n /laBS19PBW6tOa6Ou6iJ0K/2JObZ4B+XB/DJPDnazwTnbUBDzdVpZtXjj A==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="298219282" X-IronPort-AV: E=Sophos;i="5.96,148,1665471600"; d="scan'208";a="298219282" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Nov 2022 06:22:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="699938291" X-IronPort-AV: E=Sophos;i="5.96,148,1665471600"; d="scan'208";a="699938291" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 08 Nov 2022 06:22:03 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6B189155; Tue, 8 Nov 2022 16:22:27 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Mika Westerberg <mika.westerberg@linux.intel.com>, Hans de Goede <hdegoede@redhat.com>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Thierry Reding <thierry.reding@gmail.com>, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org Cc: Andy Shevchenko <andy@kernel.org>, Linus Walleij <linus.walleij@linaro.org> Subject: [PATCH v2 1/6] pwm: Add a stub for devm_pwmchip_add() Date: Tue, 8 Nov 2022 16:22:21 +0200 Message-Id: <20221108142226.63161-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221108142226.63161-1-andriy.shevchenko@linux.intel.com> References: <20221108142226.63161-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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?1748938471125593005?= X-GMAIL-MSGID: =?utf-8?q?1748938471125593005?= |
Series |
pinctrl: intel: Enable PWM optional feature
|
|
Commit Message
Andy Shevchenko
Nov. 8, 2022, 2:22 p.m. UTC
devm_pwmchip_add() can be called by a module that optionally instantiates PWM chip. In case of CONFIG_PWM=n, the compilation can't be performed. Hence, add a necessary stub. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> --- include/linux/pwm.h | 5 +++++ 1 file changed, 5 insertions(+)
Comments
Hello On Tue, Nov 08, 2022 at 04:22:21PM +0200, Andy Shevchenko wrote: > devm_pwmchip_add() can be called by a module that optionally > instantiates PWM chip. In case of CONFIG_PWM=n, the compilation > can't be performed. Hence, add a necessary stub. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> > --- > include/linux/pwm.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/pwm.h b/include/linux/pwm.h > index d70c6e5a839d..bba492eea96c 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; > +} > + I'm a bit surprised to see this returning -EINVAL and not -ENOSYS. But that's in line with the other stubs, so: Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Best regards Uwe
On Thu, Nov 10, 2022 at 9:07 AM Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote: > On Tue, Nov 08, 2022 at 04:22:21PM +0200, Andy Shevchenko wrote: ... > > +static inline int devm_pwmchip_add(struct device *dev, struct pwm_chip *chip) > > +{ > > + return -EINVAL; > > +} > > + > > I'm a bit surprised to see this returning -EINVAL and not -ENOSYS. But > that's in line with the other stubs, so: Exactly my thoughts when I created such a change. > Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Thank you!
diff --git a/include/linux/pwm.h b/include/linux/pwm.h index d70c6e5a839d..bba492eea96c 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)