Skip to content

Commit 2676958

Browse files
robherringlag-linaro
authored andcommitted
mfd: syscon: Remove the platform driver support
The platform driver is dead code. It is not used by DT platforms since commit bdb0066 ("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. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Tested-by: Will McVicker <willmcvicker@google.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Reviewed-by: Pankaj Dubey <pankaj.dubey@samsung.com> Tested-by: Pankaj Dubey <pankaj.dubey@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20241217-syscon-fixes-v2-2-4f56d750541d@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 805f7aa commit 2676958

File tree

3 files changed

+0
-76
lines changed

3 files changed

+0
-76
lines changed

drivers/mfd/syscon.c

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,15 @@
1212
#include <linux/clk.h>
1313
#include <linux/err.h>
1414
#include <linux/hwspinlock.h>
15-
#include <linux/io.h>
16-
#include <linux/init.h>
1715
#include <linux/list.h>
1816
#include <linux/mutex.h>
1917
#include <linux/of.h>
2018
#include <linux/of_address.h>
21-
#include <linux/of_platform.h>
22-
#include <linux/platform_data/syscon.h>
23-
#include <linux/platform_device.h>
2419
#include <linux/regmap.h>
2520
#include <linux/reset.h>
2621
#include <linux/mfd/syscon.h>
2722
#include <linux/slab.h>
2823

29-
static struct platform_driver syscon_driver;
30-
3124
static DEFINE_MUTEX(syscon_list_lock);
3225
static LIST_HEAD(syscon_list);
3326

@@ -337,62 +330,3 @@ struct regmap *syscon_regmap_lookup_by_phandle_optional(struct device_node *np,
337330
return regmap;
338331
}
339332
EXPORT_SYMBOL_GPL(syscon_regmap_lookup_by_phandle_optional);
340-
341-
static int syscon_probe(struct platform_device *pdev)
342-
{
343-
struct device *dev = &pdev->dev;
344-
struct syscon_platform_data *pdata = dev_get_platdata(dev);
345-
struct syscon *syscon;
346-
struct regmap_config syscon_config = syscon_regmap_config;
347-
struct resource *res;
348-
void __iomem *base;
349-
350-
syscon = devm_kzalloc(dev, sizeof(*syscon), GFP_KERNEL);
351-
if (!syscon)
352-
return -ENOMEM;
353-
354-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
355-
if (!res)
356-
return -ENOENT;
357-
358-
base = devm_ioremap(dev, res->start, resource_size(res));
359-
if (!base)
360-
return -ENOMEM;
361-
362-
syscon_config.max_register = resource_size(res) - 4;
363-
if (!syscon_config.max_register)
364-
syscon_config.max_register_is_0 = true;
365-
366-
if (pdata)
367-
syscon_config.name = pdata->label;
368-
syscon->regmap = devm_regmap_init_mmio(dev, base, &syscon_config);
369-
if (IS_ERR(syscon->regmap)) {
370-
dev_err(dev, "regmap init failed\n");
371-
return PTR_ERR(syscon->regmap);
372-
}
373-
374-
platform_set_drvdata(pdev, syscon);
375-
376-
dev_dbg(dev, "regmap %pR registered\n", res);
377-
378-
return 0;
379-
}
380-
381-
static const struct platform_device_id syscon_ids[] = {
382-
{ "syscon", },
383-
{ }
384-
};
385-
386-
static struct platform_driver syscon_driver = {
387-
.driver = {
388-
.name = "syscon",
389-
},
390-
.probe = syscon_probe,
391-
.id_table = syscon_ids,
392-
};
393-
394-
static int __init syscon_init(void)
395-
{
396-
return platform_driver_register(&syscon_driver);
397-
}
398-
postcore_initcall(syscon_init);

drivers/mfd/vexpress-sysreg.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <linux/mfd/core.h>
1111
#include <linux/module.h>
1212
#include <linux/of_platform.h>
13-
#include <linux/platform_data/syscon.h>
1413
#include <linux/platform_device.h>
1514
#include <linux/slab.h>
1615
#include <linux/stat.h>

include/linux/platform_data/syscon.h

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)