Skip to content

Commit c5a55e4

Browse files
committed
Merge branch 'pm-misc'
Merge two commits removing unused helper functions related to power management (David Alan Gilbert). * pm-misc: PM: clk: Remove unused pm_clk_remove() PM: clk: remove unused of_pm_clk_add_clk()
2 parents 5a98796 + 3efeeaf commit c5a55e4

File tree

2 files changed

+0
-78
lines changed

2 files changed

+0
-78
lines changed

drivers/base/power/clock_ops.c

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -259,39 +259,6 @@ int pm_clk_add_clk(struct device *dev, struct clk *clk)
259259
}
260260
EXPORT_SYMBOL_GPL(pm_clk_add_clk);
261261

262-
263-
/**
264-
* of_pm_clk_add_clk - Start using a device clock for power management.
265-
* @dev: Device whose clock is going to be used for power management.
266-
* @name: Name of clock that is going to be used for power management.
267-
*
268-
* Add the clock described in the 'clocks' device-tree node that matches
269-
* with the 'name' provided, to the list of clocks used for the power
270-
* management of @dev. On success, returns 0. Returns a negative error
271-
* code if the clock is not found or cannot be added.
272-
*/
273-
int of_pm_clk_add_clk(struct device *dev, const char *name)
274-
{
275-
struct clk *clk;
276-
int ret;
277-
278-
if (!dev || !dev->of_node || !name)
279-
return -EINVAL;
280-
281-
clk = of_clk_get_by_name(dev->of_node, name);
282-
if (IS_ERR(clk))
283-
return PTR_ERR(clk);
284-
285-
ret = pm_clk_add_clk(dev, clk);
286-
if (ret) {
287-
clk_put(clk);
288-
return ret;
289-
}
290-
291-
return 0;
292-
}
293-
EXPORT_SYMBOL_GPL(of_pm_clk_add_clk);
294-
295262
/**
296263
* of_pm_clk_add_clks - Start using device clock(s) for power management.
297264
* @dev: Device whose clock(s) is going to be used for power management.
@@ -376,46 +343,6 @@ static void __pm_clk_remove(struct pm_clock_entry *ce)
376343
kfree(ce);
377344
}
378345

379-
/**
380-
* pm_clk_remove - Stop using a device clock for power management.
381-
* @dev: Device whose clock should not be used for PM any more.
382-
* @con_id: Connection ID of the clock.
383-
*
384-
* Remove the clock represented by @con_id from the list of clocks used for
385-
* the power management of @dev.
386-
*/
387-
void pm_clk_remove(struct device *dev, const char *con_id)
388-
{
389-
struct pm_subsys_data *psd = dev_to_psd(dev);
390-
struct pm_clock_entry *ce;
391-
392-
if (!psd)
393-
return;
394-
395-
pm_clk_list_lock(psd);
396-
397-
list_for_each_entry(ce, &psd->clock_list, node) {
398-
if (!con_id && !ce->con_id)
399-
goto remove;
400-
else if (!con_id || !ce->con_id)
401-
continue;
402-
else if (!strcmp(con_id, ce->con_id))
403-
goto remove;
404-
}
405-
406-
pm_clk_list_unlock(psd);
407-
return;
408-
409-
remove:
410-
list_del(&ce->node);
411-
if (ce->enabled_when_prepared)
412-
psd->clock_op_might_sleep--;
413-
pm_clk_list_unlock(psd);
414-
415-
__pm_clk_remove(ce);
416-
}
417-
EXPORT_SYMBOL_GPL(pm_clk_remove);
418-
419346
/**
420347
* pm_clk_remove_clk - Stop using a device clock for power management.
421348
* @dev: Device whose clock should not be used for PM any more.

include/linux/pm_clock.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ extern int pm_clk_create(struct device *dev);
4141
extern void pm_clk_destroy(struct device *dev);
4242
extern int pm_clk_add(struct device *dev, const char *con_id);
4343
extern int pm_clk_add_clk(struct device *dev, struct clk *clk);
44-
extern int of_pm_clk_add_clk(struct device *dev, const char *name);
4544
extern int of_pm_clk_add_clks(struct device *dev);
46-
extern void pm_clk_remove(struct device *dev, const char *con_id);
4745
extern void pm_clk_remove_clk(struct device *dev, struct clk *clk);
4846
extern int pm_clk_suspend(struct device *dev);
4947
extern int pm_clk_resume(struct device *dev);
@@ -76,9 +74,6 @@ static inline int of_pm_clk_add_clks(struct device *dev)
7674
{
7775
return -EINVAL;
7876
}
79-
static inline void pm_clk_remove(struct device *dev, const char *con_id)
80-
{
81-
}
8277
#define pm_clk_suspend NULL
8378
#define pm_clk_resume NULL
8479
static inline void pm_clk_remove_clk(struct device *dev, struct clk *clk)

0 commit comments

Comments
 (0)