Merge branch 'icc-get-by-index' into icc-next
authorGeorgi Djakov <georgi.djakov@linaro.org>
Fri, 15 May 2020 07:46:18 +0000 (10:46 +0300)
committerGeorgi Djakov <georgi.djakov@linaro.org>
Fri, 15 May 2020 07:46:18 +0000 (10:46 +0300)
This is an immutable branch shared with the OPP tree. It contains also
the patches to convert the interconnect framework from tristate to bool
after Greg agreed with that. This will make the integration between
the OPP layer and interconnect much easier.

* icc-get-by-index:
  interconnect: Add of_icc_get_by_index() helper function
  interconnect: Disallow interconnect core to be built as a module
  interconnect: Remove unused module exit code from core

Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
1  2 
drivers/interconnect/Kconfig
drivers/interconnect/core.c
include/linux/interconnect.h

Simple merge
index f9dd55a632ddfbae970fa48187263039d45ba6f2,2d2e497805119b266cdf5207452063afdbd83ba1..ece2a579a9b0486c420f9b551ed2e9f47873a3bc
@@@ -354,35 -350,10 +354,35 @@@ static struct icc_node *of_icc_get_from
        return node;
  }
  
 +static void devm_icc_release(struct device *dev, void *res)
 +{
 +      icc_put(*(struct icc_path **)res);
 +}
 +
 +struct icc_path *devm_of_icc_get(struct device *dev, const char *name)
 +{
 +      struct icc_path **ptr, *path;
 +
 +      ptr = devres_alloc(devm_icc_release, sizeof(**ptr), GFP_KERNEL);
 +      if (!ptr)
 +              return ERR_PTR(-ENOMEM);
 +
 +      path = of_icc_get(dev, name);
 +      if (!IS_ERR(path)) {
 +              *ptr = path;
 +              devres_add(dev, ptr);
 +      } else {
 +              devres_free(ptr);
 +      }
 +
 +      return path;
 +}
 +EXPORT_SYMBOL_GPL(devm_of_icc_get);
 +
  /**
-  * of_icc_get() - get a path handle from a DT node based on name
+  * of_icc_get_by_index() - get a path handle from a DT node based on index
   * @dev: device pointer for the consumer device
-  * @name: interconnect path name
+  * @idx: interconnect path index
   *
   * This function will search for a path between two endpoints and return an
   * icc_path handle on success. Use icc_put() to release constraints when they
index e56a95e3cf2576be4830014ad9790992a95214d8,34e97231a6abbf38323f553d28801c5ea6a7f756..d8c29049f066af87677105edc1357591beb27169
@@@ -28,10 -28,8 +28,11 @@@ struct device
  struct icc_path *icc_get(struct device *dev, const int src_id,
                         const int dst_id);
  struct icc_path *of_icc_get(struct device *dev, const char *name);
 +struct icc_path *devm_of_icc_get(struct device *dev, const char *name);
+ struct icc_path *of_icc_get_by_index(struct device *dev, int idx);
  void icc_put(struct icc_path *path);
 +int icc_enable(struct icc_path *path);
 +int icc_disable(struct icc_path *path);
  int icc_set_bw(struct icc_path *path, u32 avg_bw, u32 peak_bw);
  void icc_set_tag(struct icc_path *path, u32 tag);
  
@@@ -49,12 -47,11 +50,17 @@@ static inline struct icc_path *of_icc_g
        return NULL;
  }
  
 +static inline struct icc_path *devm_of_icc_get(struct device *dev,
 +                                              const char *name)
 +{
 +      return NULL;
 +}
 +
+ static inline struct icc_path *of_icc_get_by_index(struct device *dev, int idx)
+ {
+       return NULL;
+ }
  static inline void icc_put(struct icc_path *path)
  {
  }