component: remove old add_components method
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 18 Apr 2014 21:10:32 +0000 (22:10 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 7 Dec 2015 00:02:00 +0000 (00:02 +0000)
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>
drivers/base/component.c
include/linux/component.h

index f748430bb654154918ae67984405021835f44ec8..2ca22738ae92d12ac71bbaca0085d1aa1e1eb83d 100644 (file)
@@ -84,7 +84,7 @@ static void component_detach_master(struct master *master, struct component *c)
  * function and compare data.  This is safe to call for duplicate matches
  * and will not result in the same component being added multiple times.
  */
-int component_master_add_child(struct master *master,
+static int component_master_add_child(struct master *master,
        int (*compare)(struct device *, void *), void *compare_data)
 {
        struct component *c;
@@ -104,7 +104,6 @@ int component_master_add_child(struct master *master,
 
        return ret;
 }
-EXPORT_SYMBOL_GPL(component_master_add_child);
 
 static int find_components(struct master *master)
 {
@@ -112,14 +111,6 @@ static int find_components(struct master *master)
        size_t i;
        int ret = 0;
 
-       if (!match) {
-               /*
-                * Search the list of components, looking for components that
-                * belong to this master, and attach them to the master.
-                */
-               return master->ops->add_components(master->dev, master);
-       }
-
        /*
         * Scan the array of match functions and attach
         * any components which are found to this master.
@@ -290,15 +281,10 @@ int component_master_add_with_match(struct device *dev,
        struct master *master;
        int ret;
 
-       if (ops->add_components && match)
-               return -EINVAL;
-
-       if (match) {
-               /* Reallocate the match array for its true size */
-               match = component_match_realloc(dev, match, match->num);
-               if (IS_ERR(match))
-                       return PTR_ERR(match);
-       }
+       /* Reallocate the match array for its true size */
+       match = component_match_realloc(dev, match, match->num);
+       if (IS_ERR(match))
+               return PTR_ERR(match);
 
        master = kzalloc(sizeof(*master), GFP_KERNEL);
        if (!master)
@@ -326,13 +312,6 @@ int component_master_add_with_match(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(component_master_add_with_match);
 
-int component_master_add(struct device *dev,
-       const struct component_master_ops *ops)
-{
-       return component_master_add_with_match(dev, ops, NULL);
-}
-EXPORT_SYMBOL_GPL(component_master_add);
-
 void component_master_del(struct device *dev,
        const struct component_master_ops *ops)
 {
index c00dcc3026116370681a9701d36e2202c61b9107..71c434a6a5ee68166d96edebeea561aa0913bc8b 100644 (file)
@@ -17,18 +17,13 @@ void component_unbind_all(struct device *, void *);
 struct master;
 
 struct component_master_ops {
-       int (*add_components)(struct device *, struct master *);
        int (*bind)(struct device *);
        void (*unbind)(struct device *);
 };
 
-int component_master_add(struct device *, const struct component_master_ops *);
 void component_master_del(struct device *,
        const struct component_master_ops *);
 
-int component_master_add_child(struct master *master,
-       int (*compare)(struct device *, void *), void *compare_data);
-
 struct component_match;
 
 int component_master_add_with_match(struct device *,
This page took 0.02703 seconds and 5 git commands to generate.