Skip to content

Commit dd018a9

Browse files
author
Georgi Djakov
committed
interconnect: Move internal structs into a separate file
Move the interconnect framework internal structs into a separate file, so that it can be included and used by ftrace code. This will allow us to expose some more useful information in the traces. Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Georgi Djakov <[email protected]>
1 parent ad3703a commit dd018a9

File tree

2 files changed

+42
-28
lines changed

2 files changed

+42
-28
lines changed

drivers/interconnect/core.c

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,39 +19,13 @@
1919
#include <linux/of.h>
2020
#include <linux/overflow.h>
2121

22+
#include "internal.h"
23+
2224
static DEFINE_IDR(icc_idr);
2325
static LIST_HEAD(icc_providers);
2426
static DEFINE_MUTEX(icc_lock);
2527
static struct dentry *icc_debugfs_dir;
2628

27-
/**
28-
* struct icc_req - constraints that are attached to each node
29-
* @req_node: entry in list of requests for the particular @node
30-
* @node: the interconnect node to which this constraint applies
31-
* @dev: reference to the device that sets the constraints
32-
* @tag: path tag (optional)
33-
* @avg_bw: an integer describing the average bandwidth in kBps
34-
* @peak_bw: an integer describing the peak bandwidth in kBps
35-
*/
36-
struct icc_req {
37-
struct hlist_node req_node;
38-
struct icc_node *node;
39-
struct device *dev;
40-
u32 tag;
41-
u32 avg_bw;
42-
u32 peak_bw;
43-
};
44-
45-
/**
46-
* struct icc_path - interconnect path structure
47-
* @num_nodes: number of hops (nodes)
48-
* @reqs: array of the requests applicable to this path of nodes
49-
*/
50-
struct icc_path {
51-
size_t num_nodes;
52-
struct icc_req reqs[];
53-
};
54-
5529
static void icc_summary_show_one(struct seq_file *s, struct icc_node *n)
5630
{
5731
if (!n)

drivers/interconnect/internal.h

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/*
3+
* Interconnect framework internal structs
4+
*
5+
* Copyright (c) 2019, Linaro Ltd.
6+
* Author: Georgi Djakov <[email protected]>
7+
*/
8+
9+
#ifndef __DRIVERS_INTERCONNECT_INTERNAL_H
10+
#define __DRIVERS_INTERCONNECT_INTERNAL_H
11+
12+
/**
13+
* struct icc_req - constraints that are attached to each node
14+
* @req_node: entry in list of requests for the particular @node
15+
* @node: the interconnect node to which this constraint applies
16+
* @dev: reference to the device that sets the constraints
17+
* @tag: path tag (optional)
18+
* @avg_bw: an integer describing the average bandwidth in kBps
19+
* @peak_bw: an integer describing the peak bandwidth in kBps
20+
*/
21+
struct icc_req {
22+
struct hlist_node req_node;
23+
struct icc_node *node;
24+
struct device *dev;
25+
u32 tag;
26+
u32 avg_bw;
27+
u32 peak_bw;
28+
};
29+
30+
/**
31+
* struct icc_path - interconnect path structure
32+
* @num_nodes: number of hops (nodes)
33+
* @reqs: array of the requests applicable to this path of nodes
34+
*/
35+
struct icc_path {
36+
size_t num_nodes;
37+
struct icc_req reqs[];
38+
};
39+
40+
#endif

0 commit comments

Comments
 (0)