[PATCH] of: Fix constantness of of_n_size_cells

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




The of_n_size_cells() routine only does a read-only operation on the device tree
passed in, so add the const keyword to that argument so that of_n_size_cells()
can be called with read-only data without casting.

Signed-off-by: Geoff Levand <geoff@xxxxxxxxxxxxx>
---
The following changes since commit 7d1311b93e58ed55f3a31cc8f94c4b8fe988a2b9:

  Linux 3.17-rc1 (2014-08-16 10:40:26 -0600)

are available in the git repository at:

  git://git.linaro.org/people/geoff.levand/linux-kexec.git for-of

for you to fetch changes up to e7667576c053daedba1da0b14d4476bc25a86a11:

  of: Fix constantness of of_n_size_cells (2014-08-22 10:33:59 -0700)

----------------------------------------------------------------
Geoff Levand (1):
      of: Fix constantness of of_n_size_cells
 drivers/of/base.c  | 4 ++--
 include/linux/of.h | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index d8574ad..f773679 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -53,7 +53,7 @@ DEFINE_MUTEX(of_mutex);
  */
 DEFINE_RAW_SPINLOCK(devtree_lock);
 
-int of_n_addr_cells(struct device_node *np)
+int of_n_addr_cells(const struct device_node *np)
 {
 	const __be32 *ip;
 
@@ -69,7 +69,7 @@ int of_n_addr_cells(struct device_node *np)
 }
 EXPORT_SYMBOL(of_n_addr_cells);
 
-int of_n_size_cells(struct device_node *np)
+int of_n_size_cells(const struct device_node *np)
 {
 	const __be32 *ip;
 
diff --git a/include/linux/of.h b/include/linux/of.h
index 6c4363b..6eebcf6 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -285,8 +285,8 @@ extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
 #define for_each_property_of_node(dn, pp) \
 	for (pp = dn->properties; pp != NULL; pp = pp->next)
 
-extern int of_n_addr_cells(struct device_node *np);
-extern int of_n_size_cells(struct device_node *np);
+extern int of_n_addr_cells(const struct device_node *np);
+extern int of_n_size_cells(const struct device_node *np);
 extern const struct of_device_id *of_match_node(
 	const struct of_device_id *matches, const struct device_node *node);
 extern int of_modalias_node(struct device_node *node, char *modalias, int len);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux