if (IS_ERR(hw))
return ERR_CAST(hw);
+++++ if (!hw)
+++++ return NULL;
+++++
return hw->core;
}
}
EXPORT_SYMBOL_GPL(clk_rate_exclusive_get);
+++++ static void devm_clk_rate_exclusive_put(void *data)
+++++ {
+++++ struct clk *clk = data;
+++++
+++++ clk_rate_exclusive_put(clk);
+++++ }
+++++
+++++ int devm_clk_rate_exclusive_get(struct device *dev, struct clk *clk)
+++++ {
+++++ int ret;
+++++
+++++ ret = clk_rate_exclusive_get(clk);
+++++ if (ret)
+++++ return ret;
+++++
+++++ return devm_add_action_or_reset(dev, devm_clk_rate_exclusive_put, clk);
+++++ }
+++++ EXPORT_SYMBOL_GPL(devm_clk_rate_exclusive_get);
+++++
static void clk_core_unprepare(struct clk_core *core)
{
lockdep_assert_held(&prepare_lock);
*/
int clk_rate_exclusive_get(struct clk *clk);
+++++ /**
+++++ * devm_clk_rate_exclusive_get - devm variant of clk_rate_exclusive_get
+++++ * @dev: device the exclusivity is bound to
+++++ * @clk: clock source
+++++ *
+++++ * Calls clk_rate_exclusive_get() on @clk and registers a devm cleanup handler
+++++ * on @dev to call clk_rate_exclusive_put().
+++++ *
+++++ * Must not be called from within atomic context.
+++++ */
+++++ int devm_clk_rate_exclusive_get(struct device *dev, struct clk *clk);
+++++
/**
* clk_rate_exclusive_put - release exclusivity over the rate control of a
* producer
int __must_check devm_clk_bulk_get_all(struct device *dev,
struct clk_bulk_data **clks);
+++++/**
+++++ * devm_clk_bulk_get_all_enable - Get and enable all clocks of the consumer (managed)
+++++ * @dev: device for clock "consumer"
+++++ * @clks: pointer to the clk_bulk_data table of consumer
+++++ *
+++++ * Returns success (0) or negative errno.
+++++ *
+++++ * This helper function allows drivers to get all clocks of the
+++++ * consumer and enables them in one operation with management.
+++++ * The clks will automatically be disabled and freed when the device
+++++ * is unbound.
+++++ */
+++++
+++++int __must_check devm_clk_bulk_get_all_enable(struct device *dev,
+++++ struct clk_bulk_data **clks);
+++++
/**
* devm_clk_get - lookup and obtain a managed reference to a clock producer.
* @dev: device for clock "consumer"
return 0;
}
+++++static inline int __must_check devm_clk_bulk_get_all_enable(struct device *dev,
+++++ struct clk_bulk_data **clks)
+++++{
+++++ return 0;
+++++}
+++++
static inline struct clk *devm_get_clk_from_child(struct device *dev,
struct device_node *np, const char *con_id)
{