Commit c35ffce8 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

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

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

Memory controller drivers for v5.11, part two

1. Several fixes for Renesas RPC-IF driver.
2. Correct compile testing of TI EMIF SRAM driver.
3. Fix potential NULL pointer in JZ4780 NEMC driver.

* tag 'memory-controller-drv-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl:
  memory: jz4780_nemc: Fix potential NULL dereference in jz4780_nemc_probe()
  memory: ti-emif-sram: only build for ARMv7
  memory: renesas-rpc-if: Make rpcif_enable/disable_rpm() as static inline
  memory: renesas-rpc-if: Fix a node reference leak in rpcif_probe()
  memory: renesas-rpc-if: Fix unbalanced pm_runtime_enable in rpcif_{enable,disable}_rpm
  memory: renesas-rpc-if: Return correct value to the caller of rpcif_manual_xfer()

Link: https://lore.kernel.org/r/20201207075758.5501-1-krzk@kernel.org


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 9ccd9ef3 4bfa0730
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ config OMAP_GPMC_DEBUG

config TI_EMIF_SRAM
	tristate "Texas Instruments EMIF SRAM driver"
	depends on SOC_AM33XX || SOC_AM43XX || (ARM && COMPILE_TEST)
	depends on SOC_AM33XX || SOC_AM43XX || (ARM && CPU_V7 && COMPILE_TEST)
	depends on SRAM
	help
	  This driver is for the EMIF module available on Texas Instruments
+2 −0
Original line number Diff line number Diff line
@@ -291,6 +291,8 @@ static int jz4780_nemc_probe(struct platform_device *pdev)
	nemc->dev = dev;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res)
		return -EINVAL;

	/*
	 * The driver currently only uses the registers up to offset
+4 −14
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/reset.h>

@@ -204,18 +203,6 @@ int rpcif_sw_init(struct rpcif *rpc, struct device *dev)
}
EXPORT_SYMBOL(rpcif_sw_init);

void rpcif_enable_rpm(struct rpcif *rpc)
{
	pm_runtime_enable(rpc->dev);
}
EXPORT_SYMBOL(rpcif_enable_rpm);

void rpcif_disable_rpm(struct rpcif *rpc)
{
	pm_runtime_put_sync(rpc->dev);
}
EXPORT_SYMBOL(rpcif_disable_rpm);

void rpcif_hw_init(struct rpcif *rpc, bool hyperflash)
{
	u32 dummy;
@@ -508,7 +495,8 @@ exit:
	return ret;

err_out:
	ret = reset_control_reset(rpc->rstc);
	if (reset_control_reset(rpc->rstc))
		dev_err(rpc->dev, "Failed to reset HW\n");
	rpcif_hw_init(rpc, rpc->bus_size == 2);
	goto exit;
}
@@ -560,9 +548,11 @@ static int rpcif_probe(struct platform_device *pdev)
	} else if (of_device_is_compatible(flash, "cfi-flash")) {
		name = "rpc-if-hyperflash";
	} else	{
		of_node_put(flash);
		dev_warn(&pdev->dev, "unknown flash type\n");
		return -ENODEV;
	}
	of_node_put(flash);

	vdev = platform_device_alloc(name, pdev->id);
	if (!vdev)
+11 −2
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#ifndef __RENESAS_RPC_IF_H
#define __RENESAS_RPC_IF_H

#include <linux/pm_runtime.h>
#include <linux/types.h>

enum rpcif_data_dir {
@@ -77,11 +78,19 @@ struct rpcif {

int  rpcif_sw_init(struct rpcif *rpc, struct device *dev);
void rpcif_hw_init(struct rpcif *rpc, bool hyperflash);
void rpcif_enable_rpm(struct rpcif *rpc);
void rpcif_disable_rpm(struct rpcif *rpc);
void rpcif_prepare(struct rpcif *rpc, const struct rpcif_op *op, u64 *offs,
		   size_t *len);
int rpcif_manual_xfer(struct rpcif *rpc);
ssize_t rpcif_dirmap_read(struct rpcif *rpc, u64 offs, size_t len, void *buf);

static inline void rpcif_enable_rpm(struct rpcif *rpc)
{
	pm_runtime_enable(rpc->dev);
}

static inline void rpcif_disable_rpm(struct rpcif *rpc)
{
	pm_runtime_disable(rpc->dev);
}

#endif // __RENESAS_RPC_IF_H