From 28c1b6d60e3ad0aecf48aaefc6995904e2ab1b9e Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Fri, 22 Jul 2011 22:47:21 +0300 Subject: of: address: use resource_size helper that should be the approved way of calculating the size of resources. No functional changes. Cc: Grant Likely Signed-off-by: Felipe Balbi Signed-off-by: Grant Likely diff --git a/drivers/of/address.c b/drivers/of/address.c index da1f4b9..72c33fb 100644 --- a/drivers/of/address.c +++ b/drivers/of/address.c @@ -610,6 +610,6 @@ void __iomem *of_iomap(struct device_node *np, int index) if (of_address_to_resource(np, index, &res)) return NULL; - return ioremap(res.start, 1 + res.end - res.start); + return ioremap(res.start, resource_size(&res)); } EXPORT_SYMBOL(of_iomap); -- cgit v0.10.2 From 5f9288af065537be1fe6d1d5bd54ba51d6df721a Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Wed, 13 Jul 2011 15:46:21 +0200 Subject: input: xilinx_ps2: Add missing of_address.h header Add missing header. Error log: CC drivers/input/serio/xilinx_ps2.o drivers/input/serio/xilinx_ps2.c: In function 'xps2_of_probe': drivers/input/serio/xilinx_ps2.c:249: error: implicit declaration of function 'of_address_to_resource' Signed-off-by: Michal Simek Signed-off-by: Grant Likely diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c index 80baa53..d64c5a4 100644 --- a/drivers/input/serio/xilinx_ps2.c +++ b/drivers/input/serio/xilinx_ps2.c @@ -23,7 +23,7 @@ #include #include #include - +#include #include #include -- cgit v0.10.2 From aac285c6cb9622f1cc05ed162604bf5ad2da9a8d Mon Sep 17 00:00:00 2001 From: Jamie Iles Date: Tue, 2 Aug 2011 15:45:07 +0100 Subject: of: constify property name parameters for helper functions The helper functions for reading u32 integers, u32 arrays and strings should have the property name as a const pointer. Cc: Grant Likely Signed-off-by: Jamie Iles Signed-off-by: Grant Likely diff --git a/drivers/of/base.c b/drivers/of/base.c index 02ed367..3ff22e3 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -610,8 +610,9 @@ EXPORT_SYMBOL(of_find_node_by_phandle); * * The out_value is modified only if a valid u32 value can be decoded. */ -int of_property_read_u32_array(const struct device_node *np, char *propname, - u32 *out_values, size_t sz) +int of_property_read_u32_array(const struct device_node *np, + const char *propname, u32 *out_values, + size_t sz) { struct property *prop = of_find_property(np, propname, NULL); const __be32 *val; @@ -645,7 +646,7 @@ EXPORT_SYMBOL_GPL(of_property_read_u32_array); * * The out_string pointer is modified only if a valid string can be decoded. */ -int of_property_read_string(struct device_node *np, char *propname, +int of_property_read_string(struct device_node *np, const char *propname, const char **out_string) { struct property *prop = of_find_property(np, propname, NULL); diff --git a/include/linux/of.h b/include/linux/of.h index bd716f8..0085bb0 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -196,12 +196,13 @@ extern struct property *of_find_property(const struct device_node *np, const char *name, int *lenp); extern int of_property_read_u32_array(const struct device_node *np, - char *propname, + const char *propname, u32 *out_values, size_t sz); -extern int of_property_read_string(struct device_node *np, char *propname, - const char **out_string); +extern int of_property_read_string(struct device_node *np, + const char *propname, + const char **out_string); extern int of_device_is_compatible(const struct device_node *device, const char *); extern int of_device_is_available(const struct device_node *device); @@ -242,13 +243,15 @@ static inline bool of_have_populated_dt(void) } static inline int of_property_read_u32_array(const struct device_node *np, - char *propname, u32 *out_values, size_t sz) + const char *propname, + u32 *out_values, size_t sz) { return -ENOSYS; } static inline int of_property_read_string(struct device_node *np, - char *propname, const char **out_string) + const char *propname, + const char **out_string) { return -ENOSYS; } @@ -256,7 +259,7 @@ static inline int of_property_read_string(struct device_node *np, #endif /* CONFIG_OF */ static inline int of_property_read_u32(const struct device_node *np, - char *propname, + const char *propname, u32 *out_value) { return of_property_read_u32_array(np, propname, out_value, 1); -- cgit v0.10.2 From d945fa0da7db9ace61fbb2140cfdb1e2d2b24e7e Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 2 Aug 2011 14:13:26 +0900 Subject: MAINTAINERS: Add keyword match for of_match_table to device tree section If a patch is working with an of_match_table it's probably adding an OF binding to a driver in which case the binding ought to be reviewed by the device tree folks to make sure that things like the device matches are set up correctly. Signed-off-by: Mark Brown Signed-off-by: Grant Likely diff --git a/MAINTAINERS b/MAINTAINERS index c9c6324..0d2fcda 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4722,6 +4722,7 @@ S: Maintained F: drivers/of F: include/linux/of*.h K: of_get_property +K: of_match_table OPENRISC ARCHITECTURE M: Jonas Bonn -- cgit v0.10.2