diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-04-18 17:10:32 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-12-06 19:02:00 -0500 |
commit | fae9e2e07af07baabb8c26a31b3f7d8fdf89809e (patch) | |
tree | f17848b1656f499576da43807f40aef5645cfb66 /drivers/base/component.c | |
parent | 8005c49d9aea74d382f474ce11afbbc7d7130bec (diff) |
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>
Diffstat (limited to 'drivers/base/component.c')
-rw-r--r-- | drivers/base/component.c | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/drivers/base/component.c b/drivers/base/component.c index f748430bb654..2ca22738ae92 100644 --- a/drivers/base/component.c +++ b/drivers/base/component.c | |||
@@ -84,7 +84,7 @@ static void component_detach_master(struct master *master, struct component *c) | |||
84 | * function and compare data. This is safe to call for duplicate matches | 84 | * function and compare data. This is safe to call for duplicate matches |
85 | * and will not result in the same component being added multiple times. | 85 | * and will not result in the same component being added multiple times. |
86 | */ | 86 | */ |
87 | int component_master_add_child(struct master *master, | 87 | static int component_master_add_child(struct master *master, |
88 | int (*compare)(struct device *, void *), void *compare_data) | 88 | int (*compare)(struct device *, void *), void *compare_data) |
89 | { | 89 | { |
90 | struct component *c; | 90 | struct component *c; |
@@ -104,7 +104,6 @@ int component_master_add_child(struct master *master, | |||
104 | 104 | ||
105 | return ret; | 105 | return ret; |
106 | } | 106 | } |
107 | EXPORT_SYMBOL_GPL(component_master_add_child); | ||
108 | 107 | ||
109 | static int find_components(struct master *master) | 108 | static int find_components(struct master *master) |
110 | { | 109 | { |
@@ -112,14 +111,6 @@ static int find_components(struct master *master) | |||
112 | size_t i; | 111 | size_t i; |
113 | int ret = 0; | 112 | int ret = 0; |
114 | 113 | ||
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 | |||
123 | /* | 114 | /* |
124 | * Scan the array of match functions and attach | 115 | * Scan the array of match functions and attach |
125 | * any components which are found to this master. | 116 | * any components which are found to this master. |
@@ -290,15 +281,10 @@ int component_master_add_with_match(struct device *dev, | |||
290 | struct master *master; | 281 | struct master *master; |
291 | int ret; | 282 | int ret; |
292 | 283 | ||
293 | if (ops->add_components && match) | 284 | /* Reallocate the match array for its true size */ |
294 | return -EINVAL; | 285 | match = component_match_realloc(dev, match, match->num); |
295 | 286 | if (IS_ERR(match)) | |
296 | if (match) { | 287 | return PTR_ERR(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 | } | ||
302 | 288 | ||
303 | master = kzalloc(sizeof(*master), GFP_KERNEL); | 289 | master = kzalloc(sizeof(*master), GFP_KERNEL); |
304 | if (!master) | 290 | if (!master) |
@@ -326,13 +312,6 @@ int component_master_add_with_match(struct device *dev, | |||
326 | } | 312 | } |
327 | EXPORT_SYMBOL_GPL(component_master_add_with_match); | 313 | EXPORT_SYMBOL_GPL(component_master_add_with_match); |
328 | 314 | ||
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 | |||
336 | void component_master_del(struct device *dev, | 315 | void component_master_del(struct device *dev, |
337 | const struct component_master_ops *ops) | 316 | const struct component_master_ops *ops) |
338 | { | 317 | { |