* [PATCH 0/6] nvmem: fixes for next rc
@ 2017-07-26 9:34 srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 1/6] nvmem: lpc18xx-eeprom: explicitly request exclusive reset control srinivas.kandagatla
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: srinivas.kandagatla @ 2017-07-26 9:34 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, Srinivas Kandagatla
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Hi Greg,
Could you please queue these patches for next possible rc.
All these patches are fixes or minor cleanups, new function
nvmem_cell_read_u32() is also added to fix a issue in
drivers/thermal/imx_thermal.c driver.
Thanks,
srini
Dan Carpenter (1):
nvmem: core: remove unneeded NULL check
Frank Wang (1):
nvmem: rockchip-efuse: amend compatible rk322x-efuse to rk3228-efuse
Leonard Crestez (1):
nvmem: core: Add nvmem_cell_read_u32
Philipp Zabel (1):
nvmem: lpc18xx-eeprom: explicitly request exclusive reset control
Rob Herring (1):
nvmem: Convert to using %pOF instead of full_name
Srinivas Kandagatla (1):
nvmem: include linux/err.h from header
.../devicetree/bindings/nvmem/rockchip-efuse.txt | 2 +-
drivers/nvmem/core.c | 43 ++++++++++++++++++++--
drivers/nvmem/lpc18xx_eeprom.c | 2 +-
drivers/nvmem/rockchip-efuse.c | 2 +-
include/linux/nvmem-consumer.h | 10 +++++
5 files changed, 53 insertions(+), 6 deletions(-)
--
2.9.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/6] nvmem: lpc18xx-eeprom: explicitly request exclusive reset control
2017-07-26 9:34 [PATCH 0/6] nvmem: fixes for next rc srinivas.kandagatla
@ 2017-07-26 9:34 ` srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 2/6] nvmem: Convert to using %pOF instead of full_name srinivas.kandagatla
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: srinivas.kandagatla @ 2017-07-26 9:34 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-kernel, Philipp Zabel, Srinivas Kandagatla,
Joachim Eastwood, linux-arm-kernel
From: Philipp Zabel <p.zabel@pengutronix.de>
Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.
No functional changes.
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Joachim Eastwood <manabian@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/nvmem/lpc18xx_eeprom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvmem/lpc18xx_eeprom.c b/drivers/nvmem/lpc18xx_eeprom.c
index c81ae4c..6c7e2c4 100644
--- a/drivers/nvmem/lpc18xx_eeprom.c
+++ b/drivers/nvmem/lpc18xx_eeprom.c
@@ -197,7 +197,7 @@ static int lpc18xx_eeprom_probe(struct platform_device *pdev)
return ret;
}
- rst = devm_reset_control_get(dev, NULL);
+ rst = devm_reset_control_get_exclusive(dev, NULL);
if (IS_ERR(rst)) {
dev_err(dev, "failed to get reset: %ld\n", PTR_ERR(rst));
ret = PTR_ERR(rst);
--
2.9.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/6] nvmem: Convert to using %pOF instead of full_name
2017-07-26 9:34 [PATCH 0/6] nvmem: fixes for next rc srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 1/6] nvmem: lpc18xx-eeprom: explicitly request exclusive reset control srinivas.kandagatla
@ 2017-07-26 9:34 ` srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 3/6] nvmem: rockchip-efuse: amend compatible rk322x-efuse to rk3228-efuse srinivas.kandagatla
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: srinivas.kandagatla @ 2017-07-26 9:34 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, Rob Herring, Srinivas Kandagatla
From: Rob Herring <robh@kernel.org>
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/nvmem/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 4c49285..b0c6033 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -794,8 +794,8 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
addr = of_get_property(cell_np, "reg", &len);
if (!addr || (len < 2 * sizeof(u32))) {
- dev_err(&nvmem->dev, "nvmem: invalid reg on %s\n",
- cell_np->full_name);
+ dev_err(&nvmem->dev, "nvmem: invalid reg on %pOF\n",
+ cell_np);
rval = -EINVAL;
goto err_mem;
}
--
2.9.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/6] nvmem: rockchip-efuse: amend compatible rk322x-efuse to rk3228-efuse
2017-07-26 9:34 [PATCH 0/6] nvmem: fixes for next rc srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 1/6] nvmem: lpc18xx-eeprom: explicitly request exclusive reset control srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 2/6] nvmem: Convert to using %pOF instead of full_name srinivas.kandagatla
@ 2017-07-26 9:34 ` srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 4/6] nvmem: core: Add nvmem_cell_read_u32 srinivas.kandagatla
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: srinivas.kandagatla @ 2017-07-26 9:34 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, Frank Wang, Srinivas Kandagatla
From: Frank Wang <frank.wang@rock-chips.com>
As the comments from Heiko Stuebner <heiko@sntech.de> that compatible
should not contain any placeholders, this patch fix it for rk3228 SoC.
Note that this is a fix for v4.13, due to fixing the current non-standard
binding name that should not become part of an official kernel release.
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Fixes: 820de1fb69f1 ("nvmem: rockchip-efuse: add support for rk322x-efuse")
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
Documentation/devicetree/bindings/nvmem/rockchip-efuse.txt | 2 +-
drivers/nvmem/rockchip-efuse.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/nvmem/rockchip-efuse.txt b/Documentation/devicetree/bindings/nvmem/rockchip-efuse.txt
index 194926f..1ff02afd 100644
--- a/Documentation/devicetree/bindings/nvmem/rockchip-efuse.txt
+++ b/Documentation/devicetree/bindings/nvmem/rockchip-efuse.txt
@@ -4,7 +4,7 @@ Required properties:
- compatible: Should be one of the following.
- "rockchip,rk3066a-efuse" - for RK3066a SoCs.
- "rockchip,rk3188-efuse" - for RK3188 SoCs.
- - "rockchip,rk322x-efuse" - for RK322x SoCs.
+ - "rockchip,rk3228-efuse" - for RK3228 SoCs.
- "rockchip,rk3288-efuse" - for RK3288 SoCs.
- "rockchip,rk3399-efuse" - for RK3399 SoCs.
- reg: Should contain the registers location and exact eFuse size
diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c
index a0d4ede..63e3eb5 100644
--- a/drivers/nvmem/rockchip-efuse.c
+++ b/drivers/nvmem/rockchip-efuse.c
@@ -170,7 +170,7 @@ static const struct of_device_id rockchip_efuse_match[] = {
.data = (void *)&rockchip_rk3288_efuse_read,
},
{
- .compatible = "rockchip,rk322x-efuse",
+ .compatible = "rockchip,rk3228-efuse",
.data = (void *)&rockchip_rk3288_efuse_read,
},
{
--
2.9.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 4/6] nvmem: core: Add nvmem_cell_read_u32
2017-07-26 9:34 [PATCH 0/6] nvmem: fixes for next rc srinivas.kandagatla
` (2 preceding siblings ...)
2017-07-26 9:34 ` [PATCH 3/6] nvmem: rockchip-efuse: amend compatible rk322x-efuse to rk3228-efuse srinivas.kandagatla
@ 2017-07-26 9:34 ` srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 5/6] nvmem: core: remove unneeded NULL check srinivas.kandagatla
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: srinivas.kandagatla @ 2017-07-26 9:34 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, Leonard Crestez, Srinivas Kandagatla
From: Leonard Crestez <leonard.crestez@nxp.com>
This function does a quick and easy read of an u32 value without any
kind of resource management code on the consumer side.
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/nvmem/core.c | 37 +++++++++++++++++++++++++++++++++++++
include/linux/nvmem-consumer.h | 7 +++++++
2 files changed, 44 insertions(+)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index b0c6033..72a60dc 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -1111,6 +1111,43 @@ int nvmem_cell_write(struct nvmem_cell *cell, void *buf, size_t len)
EXPORT_SYMBOL_GPL(nvmem_cell_write);
/**
+ * nvmem_cell_read_u32() - Read a cell value as an u32
+ *
+ * @dev: Device that requests the nvmem cell.
+ * @cell_id: Name of nvmem cell to read.
+ * @val: pointer to output value.
+ *
+ * Return: 0 on success or negative errno.
+ */
+int nvmem_cell_read_u32(struct device *dev, const char *cell_id, u32 *val)
+{
+ struct nvmem_cell *cell;
+ void *buf;
+ size_t len;
+
+ cell = nvmem_cell_get(dev, cell_id);
+ if (IS_ERR(cell))
+ return PTR_ERR(cell);
+
+ buf = nvmem_cell_read(cell, &len);
+ if (IS_ERR(buf)) {
+ nvmem_cell_put(cell);
+ return PTR_ERR(buf);
+ }
+ if (len != sizeof(*val)) {
+ kfree(buf);
+ nvmem_cell_put(cell);
+ return -EINVAL;
+ }
+ memcpy(val, buf, sizeof(*val));
+
+ kfree(buf);
+ nvmem_cell_put(cell);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(nvmem_cell_read_u32);
+
+/**
* nvmem_device_cell_read() - Read a given nvmem device and cell
*
* @nvmem: nvmem device to read from.
diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h
index c2256d7..efafccf 100644
--- a/include/linux/nvmem-consumer.h
+++ b/include/linux/nvmem-consumer.h
@@ -35,6 +35,7 @@ void nvmem_cell_put(struct nvmem_cell *cell);
void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell);
void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len);
int nvmem_cell_write(struct nvmem_cell *cell, void *buf, size_t len);
+int nvmem_cell_read_u32(struct device *dev, const char *cell_id, u32 *val);
/* direct nvmem device read/write interface */
struct nvmem_device *nvmem_device_get(struct device *dev, const char *name);
@@ -85,6 +86,12 @@ static inline int nvmem_cell_write(struct nvmem_cell *cell,
return -ENOSYS;
}
+static inline int nvmem_cell_read_u32(struct device *dev,
+ const char *cell_id, u32 *val)
+{
+ return -ENOSYS;
+}
+
static inline struct nvmem_device *nvmem_device_get(struct device *dev,
const char *name)
{
--
2.9.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 5/6] nvmem: core: remove unneeded NULL check
2017-07-26 9:34 [PATCH 0/6] nvmem: fixes for next rc srinivas.kandagatla
` (3 preceding siblings ...)
2017-07-26 9:34 ` [PATCH 4/6] nvmem: core: Add nvmem_cell_read_u32 srinivas.kandagatla
@ 2017-07-26 9:34 ` srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 6/6] nvmem: include linux/err.h from header srinivas.kandagatla
2017-08-08 11:46 ` [PATCH 0/6] nvmem: fixes for next rc Srinivas Kandagatla
6 siblings, 0 replies; 8+ messages in thread
From: srinivas.kandagatla @ 2017-07-26 9:34 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, Dan Carpenter, Srinivas Kandagatla
From: Dan Carpenter <dan.carpenter@oracle.com>
"p" is the list iterator so it can't be NULL. Static checkers complain
about this unnecessary check because we dereference the list iterator to
get the next item in the list so we'd be in trouble if it really was
NULL. I have removed the check.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/nvmem/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 72a60dc..de54c7f 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -290,7 +290,7 @@ static struct nvmem_cell *nvmem_find_cell(const char *cell_id)
mutex_lock(&nvmem_cells_mutex);
list_for_each_entry(p, &nvmem_cells, node)
- if (p && !strcmp(p->name, cell_id)) {
+ if (!strcmp(p->name, cell_id)) {
mutex_unlock(&nvmem_cells_mutex);
return p;
}
--
2.9.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 6/6] nvmem: include linux/err.h from header
2017-07-26 9:34 [PATCH 0/6] nvmem: fixes for next rc srinivas.kandagatla
` (4 preceding siblings ...)
2017-07-26 9:34 ` [PATCH 5/6] nvmem: core: remove unneeded NULL check srinivas.kandagatla
@ 2017-07-26 9:34 ` srinivas.kandagatla
2017-08-08 11:46 ` [PATCH 0/6] nvmem: fixes for next rc Srinivas Kandagatla
6 siblings, 0 replies; 8+ messages in thread
From: srinivas.kandagatla @ 2017-07-26 9:34 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, Srinivas Kandagatla
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
missing err.h header file can cause simillar errors like below
in some configurations.
"error: implicit declaration of function 'ERR_PTR'
[-Werror=implicit-function-declaration]"
This adds the missing include to ensure we can always include
the header.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
include/linux/nvmem-consumer.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h
index efafccf..4e85447 100644
--- a/include/linux/nvmem-consumer.h
+++ b/include/linux/nvmem-consumer.h
@@ -12,6 +12,9 @@
#ifndef _LINUX_NVMEM_CONSUMER_H
#define _LINUX_NVMEM_CONSUMER_H
+#include <linux/err.h>
+#include <linux/errno.h>
+
struct device;
struct device_node;
/* consumer cookie */
--
2.9.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/6] nvmem: fixes for next rc
2017-07-26 9:34 [PATCH 0/6] nvmem: fixes for next rc srinivas.kandagatla
` (5 preceding siblings ...)
2017-07-26 9:34 ` [PATCH 6/6] nvmem: include linux/err.h from header srinivas.kandagatla
@ 2017-08-08 11:46 ` Srinivas Kandagatla
6 siblings, 0 replies; 8+ messages in thread
From: Srinivas Kandagatla @ 2017-08-08 11:46 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel
Hi Greg,
On 26/07/17 10:34, srinivas.kandagatla@linaro.org wrote:
> From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
>
> Hi Greg,
>
> Could you please queue these patches for next possible rc.
> All these patches are fixes or minor cleanups, new function
> nvmem_cell_read_u32() is also added to fix a issue in
> drivers/thermal/imx_thermal.c driver.
>
> Thanks,
> srini
>
Could you please take this series for next RC, as some of thermal fixes
which depend on nvmem_cell_read_u32() are blocked for this patch.
Thanks,
srini
> Dan Carpenter (1):
> nvmem: core: remove unneeded NULL check
>
> Frank Wang (1):
> nvmem: rockchip-efuse: amend compatible rk322x-efuse to rk3228-efuse
>
> Leonard Crestez (1):
> nvmem: core: Add nvmem_cell_read_u32
>
> Philipp Zabel (1):
> nvmem: lpc18xx-eeprom: explicitly request exclusive reset control
>
> Rob Herring (1):
> nvmem: Convert to using %pOF instead of full_name
>
> Srinivas Kandagatla (1):
> nvmem: include linux/err.h from header
>
> .../devicetree/bindings/nvmem/rockchip-efuse.txt | 2 +-
> drivers/nvmem/core.c | 43 ++++++++++++++++++++--
> drivers/nvmem/lpc18xx_eeprom.c | 2 +-
> drivers/nvmem/rockchip-efuse.c | 2 +-
> include/linux/nvmem-consumer.h | 10 +++++
> 5 files changed, 53 insertions(+), 6 deletions(-)
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-08-08 11:46 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-26 9:34 [PATCH 0/6] nvmem: fixes for next rc srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 1/6] nvmem: lpc18xx-eeprom: explicitly request exclusive reset control srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 2/6] nvmem: Convert to using %pOF instead of full_name srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 3/6] nvmem: rockchip-efuse: amend compatible rk322x-efuse to rk3228-efuse srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 4/6] nvmem: core: Add nvmem_cell_read_u32 srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 5/6] nvmem: core: remove unneeded NULL check srinivas.kandagatla
2017-07-26 9:34 ` [PATCH 6/6] nvmem: include linux/err.h from header srinivas.kandagatla
2017-08-08 11:46 ` [PATCH 0/6] nvmem: fixes for next rc Srinivas Kandagatla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®