From nobody Tue Dec 16 00:22:05 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B3321F8930 for ; Tue, 17 Dec 2024 18:11:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734459120; cv=none; b=cfXDD8EVl6jxUsbTxhp0WwX9QM0pUVSds8HpLWPAPv2eMmuZHtXbaQYfEfVMP1rWastk/5J7gTPRI88fCoi9MswjWM81x25LI93P7oxO8ig/+2Mojw9atOAwqB7ByCrphgzWrPv5Fxhlto+lw0d6qL1ajh0SEjj8y3dnezO3T6k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734459120; c=relaxed/simple; bh=kpOrvxsnyhKACVQ2qsRTR3Nb4KrhnGtNpRfRPuIsYjg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oT1W4d7qDIq+cVqqD4zyP37A4BxtkljoklfUGmcaEHJFtioSFiUQtTepVI7DEV5/T49agD6zHDjEv4+n7q8dvRygEYYUOYIkar4/9TBOHVQESFg+nBHgiycbLvYEFunNpeM9e9rSrr98ywYBLJamt9g1MsKhCCN/O4fNYpQIsYg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E0ltokNF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="E0ltokNF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CC21C4CED7; Tue, 17 Dec 2024 18:11:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734459119; bh=kpOrvxsnyhKACVQ2qsRTR3Nb4KrhnGtNpRfRPuIsYjg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=E0ltokNFg7sPjq2BCTSCoR6FLN9OUNYcz44OAduYWcIEGL2xsONP3goHw5eFh05fP hVjFTZQdqoyCS1kvwnMjMU9VxHCUlFDiNcD/TDRfEvEVTT07ZsDm4+vFkiQo4Ggn9z mHm2FQI8Lci6zYulzLJiuhngBn0U7+wD7aTLn/nXabFeTTJ0Zzi5Voe8/0rhbVbMS+ GoaiDEOPrHAy6frh+DJc5H2E9Bx3aO2c/G8xXRb26T+WRRohVkbq8xO1sPjQPqJgmC A62rpgjIBPDtG5H4HmnE/b/yftZdliDvdyRc3e2NjbgBo9s8VVWaxgWFqApIWRva+M OByw7KNGq9Yfw== From: "Rob Herring (Arm)" Date: Tue, 17 Dec 2024 12:11:41 -0600 Subject: [PATCH v2 2/3] mfd: syscon: Remove the platform driver support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241217-syscon-fixes-v2-2-4f56d750541d@kernel.org> References: <20241217-syscon-fixes-v2-0-4f56d750541d@kernel.org> In-Reply-To: <20241217-syscon-fixes-v2-0-4f56d750541d@kernel.org> To: Lee Jones , Arnd Bergmann , Pankaj Dubey , Heiko Stuebner , Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi Cc: Peter Griffin , Will McVicker , John Madieu , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-Mailer: b4 0.15-dev The platform driver is dead code. It is not used by DT platforms since commit bdb0066df96e ("mfd: syscon: Decouple syscon interface from platform devices") which said: For non-DT based platforms, this patch keeps syscon platform driver structure so that syscon can be probed and such non-DT based drivers can use syscon_regmap_lookup_by_pdev API and access regmap handles. Once all users of "syscon_regmap_lookup_by_pdev" migrated to DT based, we can completely remove platform driver of syscon, and keep only helper functions to get regmap handles. The last user of syscon_regmap_lookup_by_pdevname() was removed in 2018. syscon_regmap_lookup_by_pdevname() was then removed in 2019, but that commit failed to remove the rest of the platform driver. Tested-by: Krzysztof Kozlowski Signed-off-by: Rob Herring (Arm) Acked-by: Liviu Dudau Reviewed-by: Krzysztof Kozlowski Reviewed-by: Pankaj Dubey Tested-by: Pankaj Dubey Tested-by: Will McVicker --- drivers/mfd/syscon.c | 66 --------------------------------= ---- drivers/mfd/vexpress-sysreg.c | 1 - include/linux/platform_data/syscon.h | 9 ----- 3 files changed, 76 deletions(-) diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c index 72f20de9652da2d7bad12e4bc2c43ac0c9a97f76..bfb1f69fcff1d3cd35cf04ccd4c= 449e7d0395c79 100644 --- a/drivers/mfd/syscon.c +++ b/drivers/mfd/syscon.c @@ -12,22 +12,15 @@ #include #include #include -#include -#include #include #include #include #include -#include -#include -#include #include #include #include #include =20 -static struct platform_driver syscon_driver; - static DEFINE_MUTEX(syscon_list_lock); static LIST_HEAD(syscon_list); =20 @@ -337,62 +330,3 @@ struct regmap *syscon_regmap_lookup_by_phandle_optiona= l(struct device_node *np, return regmap; } EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_phandle_optional); - -static int syscon_probe(struct platform_device *pdev) -{ - struct device *dev =3D &pdev->dev; - struct syscon_platform_data *pdata =3D dev_get_platdata(dev); - struct syscon *syscon; - struct regmap_config syscon_config =3D syscon_regmap_config; - struct resource *res; - void __iomem *base; - - syscon =3D devm_kzalloc(dev, sizeof(*syscon), GFP_KERNEL); - if (!syscon) - return -ENOMEM; - - res =3D platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENOENT; - - base =3D devm_ioremap(dev, res->start, resource_size(res)); - if (!base) - return -ENOMEM; - - syscon_config.max_register =3D resource_size(res) - 4; - if (!syscon_config.max_register) - syscon_config.max_register_is_0 =3D true; - - if (pdata) - syscon_config.name =3D pdata->label; - syscon->regmap =3D devm_regmap_init_mmio(dev, base, &syscon_config); - if (IS_ERR(syscon->regmap)) { - dev_err(dev, "regmap init failed\n"); - return PTR_ERR(syscon->regmap); - } - - platform_set_drvdata(pdev, syscon); - - dev_dbg(dev, "regmap %pR registered\n", res); - - return 0; -} - -static const struct platform_device_id syscon_ids[] =3D { - { "syscon", }, - { } -}; - -static struct platform_driver syscon_driver =3D { - .driver =3D { - .name =3D "syscon", - }, - .probe =3D syscon_probe, - .id_table =3D syscon_ids, -}; - -static int __init syscon_init(void) -{ - return platform_driver_register(&syscon_driver); -} -postcore_initcall(syscon_init); diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c index d34d58ce46db2ad0d53b3daeabc9d3763883b39a..ef03d6cec9ff6927668d051ca45= 9eb1d8ff7269e 100644 --- a/drivers/mfd/vexpress-sysreg.c +++ b/drivers/mfd/vexpress-sysreg.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/include/linux/platform_data/syscon.h b/include/linux/platform_= data/syscon.h deleted file mode 100644 index 2c089dd3e2bda3baf5cef201ef43bca709e12c0b..000000000000000000000000000= 0000000000000 --- a/include/linux/platform_data/syscon.h +++ /dev/null @@ -1,9 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef PLATFORM_DATA_SYSCON_H -#define PLATFORM_DATA_SYSCON_H - -struct syscon_platform_data { - const char *label; -}; - -#endif --=20 2.45.2