Skip to content

Commit 8826915

Browse files
dtorrobherring
authored andcommitted
of: base: make of_device_compatible_match() accept const device node
of_device_is_compatible() accepts const device node pointer, there is no reason why of_device_compatible_match() can't do the same. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Link: https://lore.kernel.org/r/YzY5MaU5N4A2st5R@google.com Signed-off-by: Rob Herring <robh@kernel.org>
1 parent f1ad533 commit 8826915

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/of/base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ EXPORT_SYMBOL(of_device_is_compatible);
561561
* a NULL terminated array of strings. Returns the best match
562562
* score or 0.
563563
*/
564-
int of_device_compatible_match(struct device_node *device,
564+
int of_device_compatible_match(const struct device_node *device,
565565
const char *const *compat)
566566
{
567567
unsigned int tmp, score = 0;

include/linux/of.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ extern int of_property_read_string_helper(const struct device_node *np,
342342
const char **out_strs, size_t sz, int index);
343343
extern int of_device_is_compatible(const struct device_node *device,
344344
const char *);
345-
extern int of_device_compatible_match(struct device_node *device,
345+
extern int of_device_compatible_match(const struct device_node *device,
346346
const char *const *compat);
347347
extern bool of_device_is_available(const struct device_node *device);
348348
extern bool of_device_is_big_endian(const struct device_node *device);
@@ -562,7 +562,7 @@ static inline int of_device_is_compatible(const struct device_node *device,
562562
return 0;
563563
}
564564

565-
static inline int of_device_compatible_match(struct device_node *device,
565+
static inline int of_device_compatible_match(const struct device_node *device,
566566
const char *const *compat)
567567
{
568568
return 0;

0 commit comments

Comments
 (0)