From nobody Mon Dec 29 16:49:30 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFF92C61DF4 for ; Fri, 24 Nov 2023 20:03:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346101AbjKXUDI (ORCPT ); Fri, 24 Nov 2023 15:03:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbjKXUDB (ORCPT ); Fri, 24 Nov 2023 15:03:01 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D5741707 for ; Fri, 24 Nov 2023 12:03:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700856186; x=1732392186; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=G09mUvl/RQNAtAzlY9grLZnLKlc0fBxbF/IUfivypek=; b=dyb/UG6Js2b10cWn8vw+J/07KoGvstf/iuXiC+vp1uXNe2HhTBEs2Bdn UmBEROvzYzn0X+ASokZuy8ZT7xV7PEqH2+T2DuvFCUrF8ChhFFZd9E21t rhE/TgkBHYGUiMCs/mWirTydfs43E35j7U0Z5HBbXiKr1+AfH8yj2stSd Ek2bIvAFxxQ0sqBJr2k/X5q1mDMJt/1nXfga4tlRexBW2AL6iM8W73uZ6 /Y9Bg2E6XNrD6WVnQlZNmKFnq+DdeV2/x2meeks+sUwoNeaY1qfAwMeXk Rap/dfImmnxD0ZP6e6GjbU7DD/0KALP0JfClbSELdipGudXI3E/t0Gwb8 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10904"; a="396366606" X-IronPort-AV: E=Sophos;i="6.04,224,1695711600"; d="scan'208";a="396366606" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2023 12:03:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10904"; a="833763308" X-IronPort-AV: E=Sophos;i="6.04,224,1695711600"; d="scan'208";a="833763308" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 24 Nov 2023 12:03:04 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 944791A7; Fri, 24 Nov 2023 22:03:03 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Lee Jones Subject: [PATCH v1 1/5] mfd: intel-lpss: Revert "Add missing check for platform_get_resource" Date: Fri, 24 Nov 2023 21:31:24 +0200 Message-ID: <20231124200258.3682979-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231124200258.3682979-1-andriy.shevchenko@linux.intel.com> References: <20231124200258.3682979-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This reverts commit d918e0d5824495a75d00b879118b098fcab36fdb. The commit in question does not fix anything and only introduces a duplication in the code. The main intel_lpss_probe() performs all necessary checks. While at it and in order of avoiding similar patches to come, add a comment. Signed-off-by: Andy Shevchenko --- drivers/mfd/intel-lpss-acpi.c | 4 +--- drivers/mfd/intel-lpss-pci.c | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c index 5184fd1a5df1..52ffc0d9c23f 100644 --- a/drivers/mfd/intel-lpss-acpi.c +++ b/drivers/mfd/intel-lpss-acpi.c @@ -182,10 +182,8 @@ static int intel_lpss_acpi_probe(struct platform_devic= e *pdev) if (!info) return -ENOMEM; =20 + /* No need to check mem and irq here as intel_lpss_probe() does it for us= */ info->mem =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!info->mem) - return -ENODEV; - info->irq =3D platform_get_irq(pdev, 0); =20 ret =3D intel_lpss_probe(&pdev->dev, info); diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index cf56cd3a40ee..709b0fb4419d 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -46,6 +46,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev, if (!info) return -ENOMEM; =20 + /* No need to check mem and irq here as intel_lpss_probe() does it for us= */ info->mem =3D pci_resource_n(pdev, 0); info->irq =3D pci_irq_vector(pdev, 0); =20 --=20 2.43.0.rc1.1.gbec44491f096 From nobody Mon Dec 29 16:49:30 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF975C61D97 for ; Fri, 24 Nov 2023 20:03:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346025AbjKXUDB (ORCPT ); Fri, 24 Nov 2023 15:03:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231671AbjKXUC7 (ORCPT ); Fri, 24 Nov 2023 15:02:59 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15A3310F0 for ; Fri, 24 Nov 2023 12:03:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700856186; x=1732392186; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3tmtC5KUuDw5A1U1orOmx8i0hwlt4bNoEEqmp3Gufpw=; b=A8gd5ORybv2hYsuQyLWV1m9ptuvMFfZ2Od+qvDvGpFhuwHO9jPyksSMh nDjBqCXo+vZdK0Pekiz/R12Ykxqg4W4Th0MiEmJNQeoHA3jeRXP0t9bv4 1krOTnRkDl/7YrvUivF9+UL60kGMm7UOlzFR6K+9TkEUffDC6tnUNrO57 N5eUCf4u7K1aBvVCRyyafzQ3swl2LKpXOjAvQxZ3UR01n/X2EuKoApIyv 58v3HdLH40gXBBPgDoJ9SF+emGADVIsOYNO1KKqv3Bk6yEJRLAzaORzhK jDBxhVDqLFKfhXMYZVwhqrbt6sNVjss7RDIGawaQq138oa3ixcuu8q24H A==; X-IronPort-AV: E=McAfee;i="6600,9927,10904"; a="391338130" X-IronPort-AV: E=Sophos;i="6.04,224,1695711600"; d="scan'208";a="391338130" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2023 12:03:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10904"; a="1014983738" X-IronPort-AV: E=Sophos;i="6.04,224,1695711600"; d="scan'208";a="1014983738" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 24 Nov 2023 12:03:04 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id A271E26D; Fri, 24 Nov 2023 22:03:03 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Lee Jones Subject: [PATCH v1 2/5] mfd: intel-lpss: Use device_get_match_data() Date: Fri, 24 Nov 2023 21:31:25 +0200 Message-ID: <20231124200258.3682979-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231124200258.3682979-1-andriy.shevchenko@linux.intel.com> References: <20231124200258.3682979-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use preferred device_get_match_data() instead of acpi_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Introduce a temporary variable in PCI glue driver to be consistent with ACPI one on the same matter. Signed-off-by: Andy Shevchenko --- drivers/mfd/intel-lpss-acpi.c | 11 +++++------ drivers/mfd/intel-lpss-pci.c | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c index 52ffc0d9c23f..bba208235754 100644 --- a/drivers/mfd/intel-lpss-acpi.c +++ b/drivers/mfd/intel-lpss-acpi.c @@ -8,9 +8,9 @@ * Mika Westerberg */ =20 -#include #include #include +#include #include #include #include @@ -169,16 +169,15 @@ MODULE_DEVICE_TABLE(acpi, intel_lpss_acpi_ids); =20 static int intel_lpss_acpi_probe(struct platform_device *pdev) { + const struct intel_lpss_platform_info *data; struct intel_lpss_platform_info *info; - const struct acpi_device_id *id; int ret; =20 - id =3D acpi_match_device(intel_lpss_acpi_ids, &pdev->dev); - if (!id) + data =3D device_get_match_data(&pdev->dev); + if (!data) return -ENODEV; =20 - info =3D devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info), - GFP_KERNEL); + info =3D devm_kmemdup(&pdev->dev, data, sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM; =20 diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index 709b0fb4419d..94042bfe7dbf 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -30,6 +30,7 @@ static const struct pci_device_id ignore_resource_conflic= ts_ids[] =3D { static int intel_lpss_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { + const struct intel_lpss_platform_info *data =3D (void *)id->driver_data; struct intel_lpss_platform_info *info; int ret; =20 @@ -41,8 +42,7 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev, if (ret) return ret; =20 - info =3D devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info), - GFP_KERNEL); + info =3D devm_kmemdup(&pdev->dev, data, sizeof(*info), GFP_KERNEL); if (!info) return -ENOMEM; =20 --=20 2.43.0.rc1.1.gbec44491f096 From nobody Mon Dec 29 16:49:30 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F6ADC61D97 for ; Fri, 24 Nov 2023 20:03:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346131AbjKXUDL (ORCPT ); Fri, 24 Nov 2023 15:03:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346009AbjKXUDB (ORCPT ); Fri, 24 Nov 2023 15:03:01 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1314910F0 for ; Fri, 24 Nov 2023 12:03: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=1700856188; x=1732392188; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aWAES+X/gzWAf5tameCWgEEuMqs70/3z8X4l0rA0DAY=; b=A6P2SMjIsyRusVozu3sTtKwbw4QgMTdu8ZivmCg6s6+tWf/IvjseAP50 v+fkygbd8pOarvowIHZV1OLcPWpSVlPz98YrgrguwxEYOx2tIUdxJss8C mvpHqnNZ8KDUOLAuw/341oYZUNxgbY5QQ4oQBgisK32lNryrrA9OiOg3Q r9mbBHBtm7bHXjorWJ31f8F15kH2B8Vgzi77P9sh9uxFQ6Q5i2qr7XtqJ W5xYb15h3k0ukc4+Fyit6QDtY5kCpqlGFgk/dUj0/hN9+uYmC5+jBvTW3 zXvsA7WFPRmM93eaSMd+zqs5gFjwcfSzijCoiQrZRz/n98e0PoOsy8By0 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10904"; a="391338134" X-IronPort-AV: E=Sophos;i="6.04,224,1695711600"; d="scan'208";a="391338134" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2023 12:03:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10904"; a="1014983741" X-IronPort-AV: E=Sophos;i="6.04,224,1695711600"; d="scan'208";a="1014983741" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 24 Nov 2023 12:03:04 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id B2674387; Fri, 24 Nov 2023 22:03:03 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Lee Jones Subject: [PATCH v1 3/5] mfd: intel-lpss: Adjust header inclusions Date: Fri, 24 Nov 2023 21:31:26 +0200 Message-ID: <20231124200258.3682979-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231124200258.3682979-1-andriy.shevchenko@linux.intel.com> References: <20231124200258.3682979-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Adjust header inclusions to avoid "proxy" headers and explicitly include what we are using. Signed-off-by: Andy Shevchenko --- drivers/mfd/intel-lpss-acpi.c | 6 +++++- drivers/mfd/intel-lpss-pci.c | 8 ++++++-- drivers/mfd/intel-lpss.c | 17 ++++++++++++----- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c index bba208235754..e4a62cc02cfc 100644 --- a/drivers/mfd/intel-lpss-acpi.c +++ b/drivers/mfd/intel-lpss-acpi.c @@ -8,15 +8,19 @@ * Mika Westerberg */ =20 +#include +#include #include -#include #include #include #include #include #include + #include =20 +#include + #include "intel-lpss.h" =20 static const struct property_entry spt_spi_properties[] =3D { diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index 94042bfe7dbf..bc15379afe3b 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -8,14 +8,18 @@ * Mika Westerberg */ =20 -#include -#include +#include +#include +#include #include #include #include #include + #include =20 +#include + #include "intel-lpss.h" =20 /* Some DSDTs have an unused GEXP ACPI device conflicting with I2C4 resour= ces */ diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index bbd65da46db6..79ea5e2ad0a6 100644 --- a/drivers/mfd/intel-lpss.c +++ b/drivers/mfd/intel-lpss.c @@ -10,26 +10,33 @@ * Jarkko Nikula */ =20 -#include +#include +#include #include +#include #include #include +#include +#include +#include #include #include #include -#include -#include #include +#include #include #include -#include -#include +#include +#include + #include =20 #include =20 #include "intel-lpss.h" =20 +struct dentry; + #define LPSS_DEV_OFFSET 0x000 #define LPSS_DEV_SIZE 0x200 #define LPSS_PRIV_OFFSET 0x200 --=20 2.43.0.rc1.1.gbec44491f096 From nobody Mon Dec 29 16:49:30 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18930C61DF4 for ; Fri, 24 Nov 2023 20:03:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346109AbjKXUDG (ORCPT ); Fri, 24 Nov 2023 15:03:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232516AbjKXUDB (ORCPT ); Fri, 24 Nov 2023 15:03:01 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A73F170B for ; Fri, 24 Nov 2023 12:03:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700856187; x=1732392187; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wjIuz3y60umWAMMG08jdscB6p7782TQh9CFOLAOBo9c=; b=i3A6gwIEG2nND+KvFE1ZCpH22Gw2ThnHgYEHcFx6Y6n9Jn5m0qHz6JYq kaAF1Ici8mRqiBf5e6DKX0dqt3gVihE6xItWVSBndpDK5Cl/NrsV08pq2 8B235rfTCSaMZnv+1eoqtG+x9QDhn8HZweAP+2ZRd4ZnNYNzFhOXv41so XxUUtmUEunmXmPTjaOKK9JXZm3UNCc2FH38C1p+6txlBGQdziH4okcnKd aj1q+sMuTOyNQvdmpTrX6CSh57EbORz/0bgU3wIpTmEJrABiG+CTWzPDb xuYUWW2j9hpPfaA3ZCfM5yUoV6kMZJzN9z+krZpFnswLbcv0zjWTKTxl8 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10904"; a="391338128" X-IronPort-AV: E=Sophos;i="6.04,224,1695711600"; d="scan'208";a="391338128" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2023 12:03:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10904"; a="1014983739" X-IronPort-AV: E=Sophos;i="6.04,224,1695711600"; d="scan'208";a="1014983739" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga006.fm.intel.com with ESMTP; 24 Nov 2023 12:03:04 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id B8079305; Fri, 24 Nov 2023 22:03:03 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Lee Jones Subject: [PATCH v1 4/5] mfd: intel-lpss: Move exported symbols to INTEL_LPSS namespace Date: Fri, 24 Nov 2023 21:31:27 +0200 Message-ID: <20231124200258.3682979-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231124200258.3682979-1-andriy.shevchenko@linux.intel.com> References: <20231124200258.3682979-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Avoid unnecessary pollution of the global symbol namespace by moving library functions in to a specific namespace and import that into the drivers that make use of the functions. For more info: https://lwn.net/Articles/760045/ Signed-off-by: Andy Shevchenko --- drivers/mfd/intel-lpss-acpi.c | 1 + drivers/mfd/intel-lpss-pci.c | 1 + drivers/mfd/intel-lpss.c | 10 +++++----- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c index e4a62cc02cfc..a9e2d9308a01 100644 --- a/drivers/mfd/intel-lpss-acpi.c +++ b/drivers/mfd/intel-lpss-acpi.c @@ -223,3 +223,4 @@ MODULE_AUTHOR("Andy Shevchenko "); MODULE_AUTHOR("Mika Westerberg "); MODULE_DESCRIPTION("Intel LPSS ACPI driver"); MODULE_LICENSE("GPL v2"); +MODULE_IMPORT_NS(INTEL_LPSS); diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index bc15379afe3b..e1d89423daa6 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -603,3 +603,4 @@ MODULE_AUTHOR("Andy Shevchenko "); MODULE_AUTHOR("Mika Westerberg "); MODULE_DESCRIPTION("Intel LPSS PCI driver"); MODULE_LICENSE("GPL v2"); +MODULE_IMPORT_NS(INTEL_LPSS); diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index 79ea5e2ad0a6..4a63703b6da5 100644 --- a/drivers/mfd/intel-lpss.c +++ b/drivers/mfd/intel-lpss.c @@ -456,7 +456,7 @@ int intel_lpss_probe(struct device *dev, =20 return ret; } -EXPORT_SYMBOL_GPL(intel_lpss_probe); +EXPORT_SYMBOL_NS_GPL(intel_lpss_probe, INTEL_LPSS); =20 void intel_lpss_remove(struct device *dev) { @@ -468,7 +468,7 @@ void intel_lpss_remove(struct device *dev) intel_lpss_unregister_clock(lpss); ida_free(&intel_lpss_devid_ida, lpss->devid); } -EXPORT_SYMBOL_GPL(intel_lpss_remove); +EXPORT_SYMBOL_NS_GPL(intel_lpss_remove, INTEL_LPSS); =20 #ifdef CONFIG_PM static int resume_lpss_device(struct device *dev, void *data) @@ -488,7 +488,7 @@ int intel_lpss_prepare(struct device *dev) device_for_each_child_reverse(dev, NULL, resume_lpss_device); return 0; } -EXPORT_SYMBOL_GPL(intel_lpss_prepare); +EXPORT_SYMBOL_NS_GPL(intel_lpss_prepare, INTEL_LPSS); =20 int intel_lpss_suspend(struct device *dev) { @@ -509,7 +509,7 @@ int intel_lpss_suspend(struct device *dev) =20 return 0; } -EXPORT_SYMBOL_GPL(intel_lpss_suspend); +EXPORT_SYMBOL_NS_GPL(intel_lpss_suspend, INTEL_LPSS); =20 int intel_lpss_resume(struct device *dev) { @@ -524,7 +524,7 @@ int intel_lpss_resume(struct device *dev) =20 return 0; } -EXPORT_SYMBOL_GPL(intel_lpss_resume); +EXPORT_SYMBOL_NS_GPL(intel_lpss_resume, INTEL_LPSS); #endif =20 static int __init intel_lpss_init(void) --=20 2.43.0.rc1.1.gbec44491f096 From nobody Mon Dec 29 16:49:30 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3617CC61DF4 for ; Fri, 24 Nov 2023 20:03:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346156AbjKXUDN (ORCPT ); Fri, 24 Nov 2023 15:03:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231671AbjKXUDC (ORCPT ); Fri, 24 Nov 2023 15:03:02 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6833C10F6 for ; Fri, 24 Nov 2023 12:03: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=1700856188; x=1732392188; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JOd7EwyxD3DRBP7ebSXKK+WZgK+reW2wbBEUTcLsQC8=; b=Ctz+HQQM1eLOo62sJg29LBuDRYkoyNRxrv/7EJoBIU8ns1+RjH2g4Qrw 7lL347lYiUMT7CcHywNAb08Vl2zj/qKQmr1OdIU5R+6hmBR03ds9NoIc2 4oAy0+fSxOXv3KvvHZ+kvJxt8B8OBrPkVg0lzPsEguhs9AiScheqMnZa7 4MDHUlLVEwKD+KvN6V0TvyjCzVO3dUApKgmXN0P6zHhQ8I12vQwAr7ojJ JdnKztrw8yl9NiqOg4efj97YEHJe9vazVZY61q2qfNKsvUfgLzoQKn3Fn bAFgc3GHn1UjWi8NqYuw5/pKwiVWjWKAHHGL/ANUcRy9a+/xvbwrWNqhZ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10904"; a="396366609" X-IronPort-AV: E=Sophos;i="6.04,224,1695711600"; d="scan'208";a="396366609" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2023 12:03:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10904"; a="833763318" X-IronPort-AV: E=Sophos;i="6.04,224,1695711600"; d="scan'208";a="833763318" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 24 Nov 2023 12:03:06 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id CD4B641A; Fri, 24 Nov 2023 22:03:03 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Lee Jones Subject: [PATCH v1 5/5] mfd: intel-lpss: Provide Intel LPSS PM ops structure Date: Fri, 24 Nov 2023 21:31:28 +0200 Message-ID: <20231124200258.3682979-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231124200258.3682979-1-andriy.shevchenko@linux.intel.com> References: <20231124200258.3682979-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" With the help of EXPORT_NS_GPL_DEV_PM_OPS() and other *_PM_OPS() macros we may convert PM ops functions to become static. This also takes into account the PM configuration options such as CONFIG_PM and CONFIG_PM_SLEEP. This all removes a lot of ugly macros and ifdeffery in the driver. Signed-off-by: Andy Shevchenko --- drivers/mfd/intel-lpss-acpi.c | 5 ++--- drivers/mfd/intel-lpss-pci.c | 5 ++--- drivers/mfd/intel-lpss.c | 18 ++++++++++-------- drivers/mfd/intel-lpss.h | 28 +--------------------------- 4 files changed, 15 insertions(+), 41 deletions(-) diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c index a9e2d9308a01..2a83f8678f1d 100644 --- a/drivers/mfd/intel-lpss-acpi.c +++ b/drivers/mfd/intel-lpss-acpi.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -205,15 +206,13 @@ static void intel_lpss_acpi_remove(struct platform_de= vice *pdev) pm_runtime_disable(&pdev->dev); } =20 -static INTEL_LPSS_PM_OPS(intel_lpss_acpi_pm_ops); - static struct platform_driver intel_lpss_acpi_driver =3D { .probe =3D intel_lpss_acpi_probe, .remove_new =3D intel_lpss_acpi_remove, .driver =3D { .name =3D "intel-lpss", .acpi_match_table =3D intel_lpss_acpi_ids, - .pm =3D &intel_lpss_acpi_pm_ops, + .pm =3D pm_ptr(&intel_lpss_pm_ops), }, }; =20 diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index e1d89423daa6..8f5e10817a9c 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include =20 @@ -81,8 +82,6 @@ static void intel_lpss_pci_remove(struct pci_dev *pdev) intel_lpss_remove(&pdev->dev); } =20 -static INTEL_LPSS_PM_OPS(intel_lpss_pci_pm_ops); - static const struct property_entry spt_spi_properties[] =3D { PROPERTY_ENTRY_U32("intel,spi-pxa2xx-type", LPSS_SPT_SSP), { } @@ -593,7 +592,7 @@ static struct pci_driver intel_lpss_pci_driver =3D { .probe =3D intel_lpss_pci_probe, .remove =3D intel_lpss_pci_remove, .driver =3D { - .pm =3D &intel_lpss_pci_pm_ops, + .pm =3D pm_ptr(&intel_lpss_pm_ops), }, }; =20 diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index 4a63703b6da5..177915845ba2 100644 --- a/drivers/mfd/intel-lpss.c +++ b/drivers/mfd/intel-lpss.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -470,7 +471,6 @@ void intel_lpss_remove(struct device *dev) } EXPORT_SYMBOL_NS_GPL(intel_lpss_remove, INTEL_LPSS); =20 -#ifdef CONFIG_PM static int resume_lpss_device(struct device *dev, void *data) { if (!dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_SUSPEND)) @@ -479,7 +479,7 @@ static int resume_lpss_device(struct device *dev, void = *data) return 0; } =20 -int intel_lpss_prepare(struct device *dev) +static int intel_lpss_prepare(struct device *dev) { /* * Resume both child devices before entering system sleep. This @@ -488,9 +488,8 @@ int intel_lpss_prepare(struct device *dev) device_for_each_child_reverse(dev, NULL, resume_lpss_device); return 0; } -EXPORT_SYMBOL_NS_GPL(intel_lpss_prepare, INTEL_LPSS); =20 -int intel_lpss_suspend(struct device *dev) +static int intel_lpss_suspend(struct device *dev) { struct intel_lpss *lpss =3D dev_get_drvdata(dev); unsigned int i; @@ -509,9 +508,8 @@ int intel_lpss_suspend(struct device *dev) =20 return 0; } -EXPORT_SYMBOL_NS_GPL(intel_lpss_suspend, INTEL_LPSS); =20 -int intel_lpss_resume(struct device *dev) +static int intel_lpss_resume(struct device *dev) { struct intel_lpss *lpss =3D dev_get_drvdata(dev); unsigned int i; @@ -524,8 +522,12 @@ int intel_lpss_resume(struct device *dev) =20 return 0; } -EXPORT_SYMBOL_NS_GPL(intel_lpss_resume, INTEL_LPSS); -#endif + +EXPORT_NS_GPL_DEV_PM_OPS(intel_lpss_pm_ops, INTEL_LPSS) =3D { + .prepare =3D pm_sleep_ptr(&intel_lpss_prepare), + LATE_SYSTEM_SLEEP_PM_OPS(intel_lpss_suspend, intel_lpss_resume) + RUNTIME_PM_OPS(intel_lpss_suspend, intel_lpss_resume, NULL) +}; =20 static int __init intel_lpss_init(void) { diff --git a/drivers/mfd/intel-lpss.h b/drivers/mfd/intel-lpss.h index 062ce95b68b9..c1d72b117ed5 100644 --- a/drivers/mfd/intel-lpss.h +++ b/drivers/mfd/intel-lpss.h @@ -30,32 +30,6 @@ int intel_lpss_probe(struct device *dev, const struct intel_lpss_platform_info *info); void intel_lpss_remove(struct device *dev); =20 -#ifdef CONFIG_PM -int intel_lpss_prepare(struct device *dev); -int intel_lpss_suspend(struct device *dev); -int intel_lpss_resume(struct device *dev); - -#ifdef CONFIG_PM_SLEEP -#define INTEL_LPSS_SLEEP_PM_OPS \ - .prepare =3D intel_lpss_prepare, \ - SET_LATE_SYSTEM_SLEEP_PM_OPS(intel_lpss_suspend, intel_lpss_resume) -#else -#define INTEL_LPSS_SLEEP_PM_OPS -#endif - -#define INTEL_LPSS_RUNTIME_PM_OPS \ - .runtime_suspend =3D intel_lpss_suspend, \ - .runtime_resume =3D intel_lpss_resume, - -#else /* !CONFIG_PM */ -#define INTEL_LPSS_SLEEP_PM_OPS -#define INTEL_LPSS_RUNTIME_PM_OPS -#endif /* CONFIG_PM */ - -#define INTEL_LPSS_PM_OPS(name) \ -const struct dev_pm_ops name =3D { \ - INTEL_LPSS_SLEEP_PM_OPS \ - INTEL_LPSS_RUNTIME_PM_OPS \ -} +extern const struct dev_pm_ops intel_lpss_pm_ops; =20 #endif /* __MFD_INTEL_LPSS_H */ --=20 2.43.0.rc1.1.gbec44491f096