Message ID | 20221114165545.56088-4-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 l7csp2250756wru; Mon, 14 Nov 2022 08:59:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf5R24SfuPdy9eipwA3O3CuiOeiqaYnXCRXTz1wcdNt8W6v8lxCzt5Ox8Kbl0fsaGugH8eJz X-Received: by 2002:a17:90b:d86:b0:213:5dd:f523 with SMTP id bg6-20020a17090b0d8600b0021305ddf523mr14430147pjb.63.1668445169970; Mon, 14 Nov 2022 08:59:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668445169; cv=none; d=google.com; s=arc-20160816; b=y902bTiu62rrVdcTVJvjfNI9RqQ9/vFEkAMHPPq5qfgSKOlRPOcD2/449OVSmFSDHa ba19Ua8XIUp0bNPAV4bwliY/g6uRjd6kRWE6LxJrO6kEeQO6u47HiKfONvRtNqZlhczb QriDIIdDRHqRD2v/T+IzpSRv6vJ/5xKUNDul2+F7igJHH7aYmPoOrx+R/b1IhRHnH+I3 glkj5C9nmiIVoDHVMC5UF51fVgYsubyk7H7BE/8M/qfivRZX/zLwvlKNvfmD9nzx0wLi f+ntUNhw5oSF6vG7Qb6Fem7xlbh02/2HQYoxehKc3yYTnTyKfzy47l9O/H3kD4gnNDwS jvtQ== 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=zONIO1g8Xxv1MsOcaYzMayrnroUYZ6yw0Nvc8kpI5iU=; b=bYe0LC3nHGvaMW3LsB9aIdF5a3Gj97cNBiiocmL1n4V0jIzN4TS+sCT0ZT6LpCrK3+ 45fdB3/YHN91vQL22BXVSRt95TuA2ljBij3P0Tw4OoDi16MDDJZvkkK22pqYxnrMKQB5 l9sqTxsc6FQKfajkRZpEwC+qYAdFhkOamGEkGXsLuoTeQCk0lKNwjM1xS4q94QKxSIdb tY9sxnN73rssCJXnU55iVezxec9xyqQEVhlUxL354oUPdch59optER41EGY8i6Dwe+kT rgkMtUEA4loOOCkoq7Hx4L6zezeKPYb1T4xGsU9NEG8o9Z+rdFCUy+BPRe1TGeBZZBWl mCKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Fy1XPPea; 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 m21-20020a170902d19500b00186971db5fbsi8907350plb.220.2022.11.14.08.59.15; Mon, 14 Nov 2022 08:59:29 -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=Fy1XPPea; 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 S238024AbiKNQzo (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Mon, 14 Nov 2022 11:55:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237434AbiKNQz1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Nov 2022 11:55:27 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4A37F5B3; Mon, 14 Nov 2022 08:55:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668444926; x=1699980926; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hBRMuBSSbtGLeszkWGLvZmNwu94+mL8SqSvJtb11lV8=; b=Fy1XPPeavFvP2CdGL3Z2yUglJkDmjs9JnmIaAf205oiovXRmC4d0kS1G 9kCErMm4TvhgjNVLb8J3C0MBwYPwfpum8dbOsGcMXDT6K5H6p6t3p2C36 dBs2s/VMdgGzoom0kKoIHmei3XwEvyOfCrLm+/MXfPB8fE6qapUMWrOt3 d2XiShnFr/hzcckuhbD9nciD76DHDb9COngD2WJgUGPT7j0FRKlrkiP99 02C+q9VHGcaKEspAzw343W30ZzKlvox4HOpBR4vnzq+xw3DKzpO7uWpTP NGqGN3iMf8cbv1xxUnvXjXDUXrG9Nt7/z7K0GudD72ewBbM8sGzLv+AdX Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="295382826" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="295382826" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2022 08:55:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="727593540" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="727593540" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 14 Nov 2022 08:55:22 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0633B32E; Mon, 14 Nov 2022 18:55:47 +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>, =?utf-8?q?Uwe_Kleine-K?= =?utf-8?q?=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Thierry Reding <thierry.reding@gmail.com>, Hans de Goede <hdegoede@redhat.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 v4 3/7] pwm: lpss: Include headers we are the direct user of Date: Mon, 14 Nov 2022 18:55:41 +0200 Message-Id: <20221114165545.56088-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221114165545.56088-1-andriy.shevchenko@linux.intel.com> References: <20221114165545.56088-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,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?1749491562419190176?= X-GMAIL-MSGID: =?utf-8?q?1749491562419190176?= |
Series |
pinctrl: intel: Enable PWM optional feature
|
|
Commit Message
Andy Shevchenko
Nov. 14, 2022, 4:55 p.m. UTC
For the sake of integrity, include headers we are the direct user of. Replace the inclusion of device.h by a forward declaration of struct device plus a (cheaper) of types.h as device.h is an expensive include (measured in compiler effort). While at it, move the struct pwm_lpss_chip to be after the struct pwm_lpss_boardinfo as the former uses pointer to the latter. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Thierry Reding <thierry.reding@gmail.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> --- drivers/pwm/pwm-lpss.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
Comments
On Mon, Nov 14, 2022 at 06:55:41PM +0200, Andy Shevchenko wrote: > For the sake of integrity, include headers we are the direct > user of. > > Replace the inclusion of device.h by a forward declaration > of struct device plus a (cheaper) of types.h as device.h is > an expensive include (measured in compiler effort). > > While at it, move the struct pwm_lpss_chip to be after > the struct pwm_lpss_boardinfo as the former uses pointer > to the latter. I stand by my feedback that this change is irrelevant in the end. If you drop it here, the patch gets a bit nicer and in the end the difference is just: diff --git a/drivers/pwm/pwm-lpss.h b/drivers/pwm/pwm-lpss.h index b721532c6c3c..bf841250385f 100644 --- a/drivers/pwm/pwm-lpss.h +++ b/drivers/pwm/pwm-lpss.h @@ -17,15 +17,15 @@ #define LPSS_MAX_PWMS 4 -extern const struct pwm_lpss_boardinfo pwm_lpss_byt_info; -extern const struct pwm_lpss_boardinfo pwm_lpss_bsw_info; -extern const struct pwm_lpss_boardinfo pwm_lpss_bxt_info; -extern const struct pwm_lpss_boardinfo pwm_lpss_tng_info; - struct pwm_lpss_chip { struct pwm_chip chip; void __iomem *regs; const struct pwm_lpss_boardinfo *info; }; +extern const struct pwm_lpss_boardinfo pwm_lpss_byt_info; +extern const struct pwm_lpss_boardinfo pwm_lpss_bsw_info; +extern const struct pwm_lpss_boardinfo pwm_lpss_bxt_info; +extern const struct pwm_lpss_boardinfo pwm_lpss_tng_info; + #endif /* __PWM_LPSS_H */ which is quite ok to leave as is. Best regards Uwe
On Thu, Nov 17, 2022 at 09:50:27AM +0100, Uwe Kleine-König wrote: > On Mon, Nov 14, 2022 at 06:55:41PM +0200, Andy Shevchenko wrote: > > For the sake of integrity, include headers we are the direct > > user of. > > > > Replace the inclusion of device.h by a forward declaration > > of struct device plus a (cheaper) of types.h as device.h is > > an expensive include (measured in compiler effort). > > > > While at it, move the struct pwm_lpss_chip to be after > > the struct pwm_lpss_boardinfo as the former uses pointer > > to the latter. > > I stand by my feedback that this change is irrelevant in the end. If you > drop it here, the patch gets a bit nicer. OK, since you are insisting, I will modify this in v5.
diff --git a/drivers/pwm/pwm-lpss.h b/drivers/pwm/pwm-lpss.h index 2c746c51b883..4561d229b27d 100644 --- a/drivers/pwm/pwm-lpss.h +++ b/drivers/pwm/pwm-lpss.h @@ -10,16 +10,12 @@ #ifndef __PWM_LPSS_H #define __PWM_LPSS_H -#include <linux/device.h> #include <linux/pwm.h> +#include <linux/types.h> -#define LPSS_MAX_PWMS 4 +struct device; -struct pwm_lpss_chip { - struct pwm_chip chip; - void __iomem *regs; - const struct pwm_lpss_boardinfo *info; -}; +#define LPSS_MAX_PWMS 4 struct pwm_lpss_boardinfo { unsigned long clk_rate; @@ -43,6 +39,12 @@ extern const struct pwm_lpss_boardinfo pwm_lpss_bsw_info; extern const struct pwm_lpss_boardinfo pwm_lpss_bxt_info; extern const struct pwm_lpss_boardinfo pwm_lpss_tng_info; +struct pwm_lpss_chip { + struct pwm_chip chip; + void __iomem *regs; + const struct pwm_lpss_boardinfo *info; +}; + struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, void __iomem *base, const struct pwm_lpss_boardinfo *info);