From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E1F4918A922 for ; Wed, 18 Dec 2024 10:11:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734516663; cv=none; b=qONh4s6UmCLgWqS8vW/+TN5VY8VWSsfO/zpzxVXQt8mVUesp2jKfExoC4CQYJPqwHZ7vR2y5bSbAQh/fHPl9D+XlhkyMbRnr7hEwY2FlfbNH/WVAbPQ1zLlPy2e4lSGCfv45TgcL5mCNLqNKpM8+fQMTS+BnsoGqG7/9BBMwIa8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734516663; c=relaxed/simple; bh=/wwrRGeQbcIQkiVQR392qiOT27LaWladENMOKaIdQcQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cvtM+3ArP5PYWIsW5uKbX4PRb1Nhm62/bbvRiT7YU+hk1iREWyM3w23MRRnGeys6bDkZYRuxKp4yCteU4mMuXiFIPPS6OlEOpzH7IT6wI8EoE5kvhWVmzzvKe4XM0kTqlUJb7/JdWsd7vLK1y5X5DZEEUVX5Y0Tt8X1x2QqaEJw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7A0501063 for ; Wed, 18 Dec 2024 02:11:29 -0800 (PST) Received: from e110455-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 34B3F3F720 for ; Wed, 18 Dec 2024 02:11:01 -0800 (PST) Date: Wed, 18 Dec 2024 10:10:48 +0000 From: Liviu Dudau To: "Rob Herring (Arm)" Cc: Lee Jones , Arnd Bergmann , Pankaj Dubey , Heiko Stuebner , Sudeep Holla , Lorenzo Pieralisi , Peter Griffin , Will McVicker , John Madieu , Krzysztof Kozlowski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 2/3] mfd: syscon: Remove the platform driver support Message-ID: References: <20241217-syscon-fixes-v2-0-4f56d750541d@kernel.org> <20241217-syscon-fixes-v2-2-4f56d750541d@kernel.org> 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20241217-syscon-fixes-v2-2-4f56d750541d@kernel.org> On Tue, Dec 17, 2024 at 12:11:41PM -0600, Rob Herring (Arm) wrote: > 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) (Mostly for the vexpress-sysreg.c part, but hey, it's all code being removed): Acked-by: Liviu Dudau Best regards, Liviu > --- > 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..bfb1f69fcff1d3cd35cf04ccd4c449e7d0395c79 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 > > -static struct platform_driver syscon_driver; > - > static DEFINE_MUTEX(syscon_list_lock); > static LIST_HEAD(syscon_list); > > @@ -337,62 +330,3 @@ struct regmap *syscon_regmap_lookup_by_phandle_optional(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 = &pdev->dev; > - struct syscon_platform_data *pdata = dev_get_platdata(dev); > - struct syscon *syscon; > - struct regmap_config syscon_config = syscon_regmap_config; > - struct resource *res; > - void __iomem *base; > - > - syscon = devm_kzalloc(dev, sizeof(*syscon), GFP_KERNEL); > - if (!syscon) > - return -ENOMEM; > - > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - if (!res) > - return -ENOENT; > - > - base = devm_ioremap(dev, res->start, resource_size(res)); > - if (!base) > - return -ENOMEM; > - > - syscon_config.max_register = resource_size(res) - 4; > - if (!syscon_config.max_register) > - syscon_config.max_register_is_0 = true; > - > - if (pdata) > - syscon_config.name = pdata->label; > - syscon->regmap = 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[] = { > - { "syscon", }, > - { } > -}; > - > -static struct platform_driver syscon_driver = { > - .driver = { > - .name = "syscon", > - }, > - .probe = syscon_probe, > - .id_table = 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..ef03d6cec9ff6927668d051ca459eb1d8ff7269e 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..0000000000000000000000000000000000000000 > --- 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 > > -- > 2.45.2 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯