From patchwork Wed Dec 23 12:56:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lunn X-Patchwork-Id: 560514 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 76FFA140BEE for ; Wed, 23 Dec 2015 23:57:21 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756195AbbLWM5R (ORCPT ); Wed, 23 Dec 2015 07:57:17 -0500 Received: from vps0.lunn.ch ([178.209.37.122]:48667 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755456AbbLWM5P (ORCPT ); Wed, 23 Dec 2015 07:57:15 -0500 Received: from andrew by vps0.lunn.ch with local (Exim 4.80) (envelope-from ) id 1aBiyg-0005PQ-Dr; Wed, 23 Dec 2015 13:57:14 +0100 From: Andrew Lunn To: Florian Fainelli , narmstrong@baylibre.com, vivien.didelot@savoirfairelinux.com Cc: netdev , Russell King Subject: [PATCH RFC 01/28] component: remove old add_components method Date: Wed, 23 Dec 2015 13:56:15 +0100 Message-Id: <1450875402-20740-2-git-send-email-andrew@lunn.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1450875402-20740-1-git-send-email-andrew@lunn.ch> References: <1450875402-20740-1-git-send-email-andrew@lunn.ch> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Russell King 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. Signed-off-by: Russell King --- drivers/base/component.c | 31 +++++-------------------------- include/linux/component.h | 5 ----- 2 files changed, 5 insertions(+), 31 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) * 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) { diff --git a/include/linux/component.h b/include/linux/component.h index c00dcc302611..71c434a6a5ee 100644 --- a/include/linux/component.h +++ b/include/linux/component.h @@ -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 *,