Skip to content

Commit fae9e2e

Browse files
author
Russell King
committed
component: remove old add_components method
Now that drivers create an array of component matches at probe time, we can retire the old methods. This involves removing the add_components master method, and removing component_master_add_child() from public view. We also remove component_add_master() as that interface is no longer useful. Acked-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 8005c49 commit fae9e2e

2 files changed

Lines changed: 5 additions & 31 deletions

File tree

‎drivers/base/component.c‎

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static void component_detach_master(struct master *master, struct component *c)
8484
* function and compare data. This is safe to call for duplicate matches
8585
* and will not result in the same component being added multiple times.
8686
*/
87-
int component_master_add_child(struct master *master,
87+
static int component_master_add_child(struct master *master,
8888
int (*compare)(struct device *, void *), void *compare_data)
8989
{
9090
struct component *c;
@@ -104,22 +104,13 @@ int component_master_add_child(struct master *master,
104104

105105
return ret;
106106
}
107-
EXPORT_SYMBOL_GPL(component_master_add_child);
108107

109108
static int find_components(struct master *master)
110109
{
111110
struct component_match *match = master->match;
112111
size_t i;
113112
int ret = 0;
114113

115-
if (!match) {
116-
/*
117-
* Search the list of components, looking for components that
118-
* belong to this master, and attach them to the master.
119-
*/
120-
return master->ops->add_components(master->dev, master);
121-
}
122-
123114
/*
124115
* Scan the array of match functions and attach
125116
* any components which are found to this master.
@@ -290,15 +281,10 @@ int component_master_add_with_match(struct device *dev,
290281
struct master *master;
291282
int ret;
292283

293-
if (ops->add_components && match)
294-
return -EINVAL;
295-
296-
if (match) {
297-
/* Reallocate the match array for its true size */
298-
match = component_match_realloc(dev, match, match->num);
299-
if (IS_ERR(match))
300-
return PTR_ERR(match);
301-
}
284+
/* Reallocate the match array for its true size */
285+
match = component_match_realloc(dev, match, match->num);
286+
if (IS_ERR(match))
287+
return PTR_ERR(match);
302288

303289
master = kzalloc(sizeof(*master), GFP_KERNEL);
304290
if (!master)
@@ -326,13 +312,6 @@ int component_master_add_with_match(struct device *dev,
326312
}
327313
EXPORT_SYMBOL_GPL(component_master_add_with_match);
328314

329-
int component_master_add(struct device *dev,
330-
const struct component_master_ops *ops)
331-
{
332-
return component_master_add_with_match(dev, ops, NULL);
333-
}
334-
EXPORT_SYMBOL_GPL(component_master_add);
335-
336315
void component_master_del(struct device *dev,
337316
const struct component_master_ops *ops)
338317
{

‎include/linux/component.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,13 @@ void component_unbind_all(struct device *, void *);
1717
struct master;
1818

1919
struct component_master_ops {
20-
int (*add_components)(struct device *, struct master *);
2120
int (*bind)(struct device *);
2221
void (*unbind)(struct device *);
2322
};
2423

25-
int component_master_add(struct device *, const struct component_master_ops *);
2624
void component_master_del(struct device *,
2725
const struct component_master_ops *);
2826

29-
int component_master_add_child(struct master *master,
30-
int (*compare)(struct device *, void *), void *compare_data);
31-
3227
struct component_match;
3328

3429
int component_master_add_with_match(struct device *,

0 commit comments

Comments
 (0)