device property: Drop fwnode_graph_get_remote_node()
authorSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 1 Dec 2021 13:01:15 +0000 (15:01 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 17 Dec 2021 17:41:29 +0000 (18:41 +0100)
fwnode_graph_get_remote_node() is only used by the tegra-video driver.
Convert it to use newer fwnode_graph_get_endpoint_by_id() and drop
now-unused fwnode_graph_get_remote_node().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/property.c
drivers/staging/media/tegra-video/vi.c
include/linux/property.h

index 3ff44dd92e521611a7fee813a49fe68946cd4b79..5379eae478b1add7661dee3efedbc133c9001a9a 100644 (file)
@@ -1011,44 +1011,6 @@ fwnode_graph_get_remote_endpoint(const struct fwnode_handle *fwnode)
 }
 EXPORT_SYMBOL_GPL(fwnode_graph_get_remote_endpoint);
 
-/**
- * fwnode_graph_get_remote_node - get remote parent node for given port/endpoint
- * @fwnode: pointer to parent fwnode_handle containing graph port/endpoint
- * @port_id: identifier of the parent port node
- * @endpoint_id: identifier of the endpoint node
- *
- * Return: Remote fwnode handle associated with remote endpoint node linked
- *        to @node. Use fwnode_node_put() on it when done.
- */
-struct fwnode_handle *
-fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port_id,
-                            u32 endpoint_id)
-{
-       struct fwnode_handle *endpoint;
-
-       fwnode_graph_for_each_endpoint(fwnode, endpoint) {
-               struct fwnode_endpoint fwnode_ep;
-               struct fwnode_handle *remote;
-               int ret;
-
-               ret = fwnode_graph_parse_endpoint(endpoint, &fwnode_ep);
-               if (ret < 0)
-                       continue;
-
-               if (fwnode_ep.port != port_id || fwnode_ep.id != endpoint_id)
-                       continue;
-
-               remote = fwnode_graph_get_remote_port_parent(endpoint);
-               if (!remote)
-                       return NULL;
-
-               return fwnode_device_is_available(remote) ? remote : NULL;
-       }
-
-       return NULL;
-}
-EXPORT_SYMBOL_GPL(fwnode_graph_get_remote_node);
-
 static bool fwnode_graph_remote_available(struct fwnode_handle *ep)
 {
        struct fwnode_handle *dev_node;
index 69d9787d53384279dfbf8bcd35cde15b6dae55c5..d1f43f465c2243ffb3d6edd6cdc7d021472bcd02 100644 (file)
@@ -1845,7 +1845,6 @@ static int tegra_vi_graph_init(struct tegra_vi *vi)
        struct tegra_vi_channel *chan;
        struct fwnode_handle *fwnode = dev_fwnode(vi->dev);
        int ret;
-       struct fwnode_handle *remote = NULL;
 
        /*
         * Walk the links to parse the full graph. Each channel will have
@@ -1857,11 +1856,16 @@ static int tegra_vi_graph_init(struct tegra_vi *vi)
         * next channels.
         */
        list_for_each_entry(chan, &vi->vi_chans, list) {
-               remote = fwnode_graph_get_remote_node(fwnode, chan->portnos[0],
-                                                     0);
-               if (!remote)
+               struct fwnode_handle *ep, *remote;
+
+               ep = fwnode_graph_get_endpoint_by_id(fwnode,
+                                                    chan->portnos[0], 0, 0);
+               if (!ep)
                        continue;
 
+               remote = fwnode_graph_get_remote_port_parent(ep);
+               fwnode_handle_put(ep);
+
                ret = tegra_vi_graph_parse_one(chan, remote);
                fwnode_handle_put(remote);
                if (ret < 0 || list_empty(&chan->notifier.asd_list))
index 8c010487125218aab7d33a9345ee5fd062f3935f..8355f99ebd47930e5d5c13df17efd1f76cf7f5fb 100644 (file)
@@ -397,9 +397,6 @@ struct fwnode_handle *fwnode_graph_get_remote_port(
        const struct fwnode_handle *fwnode);
 struct fwnode_handle *fwnode_graph_get_remote_endpoint(
        const struct fwnode_handle *fwnode);
-struct fwnode_handle *
-fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port,
-                            u32 endpoint);
 
 static inline bool fwnode_graph_is_endpoint(struct fwnode_handle *fwnode)
 {