Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  *	linux/arch/alpha/kernel/gct.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) #include <linux/errno.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <asm/hwrpb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <asm/gct.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) int
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) gct6_find_nodes(gct6_node *node, gct6_search_struct *search)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) 	gct6_search_struct *wanted;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 	int status = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 	/* First check the magic number.  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 	if (node->magic != GCT_NODE_MAGIC) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 		printk(KERN_ERR "GCT Node MAGIC incorrect - GCT invalid\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 		return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 	/* Check against the search struct.  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 	for (wanted = search; 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 	     wanted && (wanted->type | wanted->subtype); 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	     wanted++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 		if (node->type != wanted->type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 		if (node->subtype != wanted->subtype)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 			continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 		/* Found it -- call out.  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 		if (wanted->callout)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 			wanted->callout(node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 	/* Now walk the tree, siblings first.  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 	if (node->next) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 		status |= gct6_find_nodes(GCT_NODE_PTR(node->next), search);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 	/* Then the children.  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 	if (node->child) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 		status |= gct6_find_nodes(GCT_NODE_PTR(node->child), search);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 	return status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) }