Unverified Commit b8e3d15e authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'memory-controller-drv-5.19-2' of...

Merge tag 'memory-controller-drv-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers

Memory controller drivers for v5.19, part two

1. Cleanup: simplify platform_get_resource() calls by using
   devm_platform_get_and_ioremap_resource() helper.
2. OMAP: allow building omap-gpmc as module and make it visible (it is
   not selected by platform anymore).

* tag 'memory-controller-drv-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
  memory: omap-gpmc: Allow building as a module
  memory: omap-gpmc: Make OMAP_GPMC config visible and selectable
  memory: renesas-rpc-if: simplify platform_get_resource_byname()
  memory: brcmstb_dpfe: simplify platform_get_resource_byname()
  memory: tegra: mc: simplify platform_get_resource()
  memory: ti-emif-pm: simplify platform_get_resource()
  memory: ti-emif: simplify platform_get_resource()
  memory: emif: simplify platform_get_resource()
  memory: da8xx-ddrctl: simplify platform_get_resource()

Link: https://lore.kernel.org/r/20220503070652.54091-1-krzysztof.kozlowski@linaro.org


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 54711ee4 854fd920
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ config TI_EMIF
	  temperature changes

config OMAP_GPMC
	bool "Texas Instruments OMAP SoC GPMC driver" if COMPILE_TEST
	tristate "Texas Instruments OMAP SoC GPMC driver"
	depends on OF_ADDRESS
	select GPIOLIB
	help
+3 −7
Original line number Diff line number Diff line
@@ -857,7 +857,6 @@ static int brcmstb_dpfe_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	struct brcmstb_dpfe_priv *priv;
	struct resource *res;
	int ret;

	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -869,22 +868,19 @@ static int brcmstb_dpfe_probe(struct platform_device *pdev)
	mutex_init(&priv->lock);
	platform_set_drvdata(pdev, priv);

	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dpfe-cpu");
	priv->regs = devm_ioremap_resource(dev, res);
	priv->regs = devm_platform_ioremap_resource_byname(pdev, "dpfe-cpu");
	if (IS_ERR(priv->regs)) {
		dev_err(dev, "couldn't map DCPU registers\n");
		return -ENODEV;
	}

	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dpfe-dmem");
	priv->dmem = devm_ioremap_resource(dev, res);
	priv->dmem = devm_platform_ioremap_resource_byname(pdev, "dpfe-dmem");
	if (IS_ERR(priv->dmem)) {
		dev_err(dev, "Couldn't map DCPU data memory\n");
		return -ENOENT;
	}

	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dpfe-imem");
	priv->imem = devm_ioremap_resource(dev, res);
	priv->imem = devm_platform_ioremap_resource_byname(pdev, "dpfe-imem");
	if (IS_ERR(priv->imem)) {
		dev_err(dev, "Couldn't map DCPU instruction memory\n");
		return -ENOENT;
+1 −2
Original line number Diff line number Diff line
@@ -115,8 +115,7 @@ static int da8xx_ddrctl_probe(struct platform_device *pdev)
		return -EINVAL;
	}

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	ddrctl = devm_ioremap_resource(dev, res);
	ddrctl = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
	if (IS_ERR(ddrctl)) {
		dev_err(dev, "unable to map memory controller registers\n");
		return PTR_ERR(ddrctl);
+1 −3
Original line number Diff line number Diff line
@@ -1107,7 +1107,6 @@ static struct emif_data *__init_or_module get_device_details(
static int __init_or_module emif_probe(struct platform_device *pdev)
{
	struct emif_data	*emif;
	struct resource		*res;
	int			irq, ret;

	if (pdev->dev.of_node)
@@ -1126,8 +1125,7 @@ static int __init_or_module emif_probe(struct platform_device *pdev)
	emif->dev = &pdev->dev;
	platform_set_drvdata(pdev, emif);

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	emif->base = devm_ioremap_resource(emif->dev, res);
	emif->base = devm_platform_ioremap_resource(pdev, 0);
	if (IS_ERR(emif->base))
		goto error;

+23 −20
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include <linux/cpu_pm.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/clk.h>
@@ -1889,16 +1890,6 @@ int gpmc_cs_program_settings(int cs, struct gpmc_settings *p)
}

#ifdef CONFIG_OF
static const struct of_device_id gpmc_dt_ids[] = {
	{ .compatible = "ti,omap2420-gpmc" },
	{ .compatible = "ti,omap2430-gpmc" },
	{ .compatible = "ti,omap3430-gpmc" },	/* omap3430 & omap3630 */
	{ .compatible = "ti,omap4430-gpmc" },	/* omap4430 & omap4460 & omap543x */
	{ .compatible = "ti,am3352-gpmc" },	/* am335x devices */
	{ .compatible = "ti,am64-gpmc" },
	{ }
};

static void gpmc_cs_set_name(int cs, const char *name)
{
	struct gpmc_cs_data *gpmc = &gpmc_cs[cs];
@@ -2257,8 +2248,6 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
	if (!of_platform_device_create(child, NULL, &pdev->dev))
		goto err_child_fail;

	/* is child a common bus? */
	if (of_match_node(of_default_bus_match_table, child))
	/* create children and other common bus children */
	if (of_platform_default_populate(child, NULL, &pdev->dev))
		goto err_child_fail;
@@ -2278,6 +2267,8 @@ static int gpmc_probe_generic_child(struct platform_device *pdev,
	return ret;
}

static const struct of_device_id gpmc_dt_ids[];

static int gpmc_probe_dt(struct platform_device *pdev)
{
	int ret;
@@ -2644,6 +2635,19 @@ static int gpmc_resume(struct device *dev)

static SIMPLE_DEV_PM_OPS(gpmc_pm_ops, gpmc_suspend, gpmc_resume);

#ifdef CONFIG_OF
static const struct of_device_id gpmc_dt_ids[] = {
	{ .compatible = "ti,omap2420-gpmc" },
	{ .compatible = "ti,omap2430-gpmc" },
	{ .compatible = "ti,omap3430-gpmc" },	/* omap3430 & omap3630 */
	{ .compatible = "ti,omap4430-gpmc" },	/* omap4430 & omap4460 & omap543x */
	{ .compatible = "ti,am3352-gpmc" },	/* am335x devices */
	{ .compatible = "ti,am64-gpmc" },
	{ }
};
MODULE_DEVICE_TABLE(of, gpmc_dt_ids);
#endif

static struct platform_driver gpmc_driver = {
	.probe		= gpmc_probe,
	.remove		= gpmc_remove,
@@ -2654,8 +2658,7 @@ static struct platform_driver gpmc_driver = {
	},
};

static __init int gpmc_init(void)
{
	return platform_driver_register(&gpmc_driver);
}
postcore_initcall(gpmc_init);
module_platform_driver(gpmc_driver);

MODULE_DESCRIPTION("Texas Instruments GPMC driver");
MODULE_LICENSE("GPL");
Loading