forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm
Pull ARM and clkdev fixes from Russell King: "Two patches for clkdev which resolve the long standing issue that the devm_* versions were dependent on clkdev, which they shouldn't have been. Instead, they're dependent on HAVE_CLK instead, which implies that you're providing clk_get() and clk_put(). A small fix to the ARM decompressor to ensure that the page tables are properly interpreted by the CPU, and reserve syscall 378 for kcmp (the checksyscalls.sh script is unfortunately currently broken so arch maintainers aren't getting notified of new syscalls...) Lastly, a larger fix for an issue between the common clk subsystem and smp_twd which causes warnings to be spat out." * 'fixes' of git://git.linaro.org/people/rmk/linux-arm: ARM: reserve syscall 378 for kcmp ARM: 7535/1: Reprogram smp_twd based on new common clk framework notifiers ARM: 7537/1: clk: Fix release in devm_clk_put() ARM: 7532/1: decompressor: reset SCTLR.TRE for VMSA ARMv7 cores ARM: 7534/1: clk: Make the managed clk functions generically available
- Loading branch information
Showing
8 changed files
with
106 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#include <linux/clk.h> | ||
#include <linux/device.h> | ||
#include <linux/export.h> | ||
#include <linux/gfp.h> | ||
|
||
static void devm_clk_release(struct device *dev, void *res) | ||
{ | ||
clk_put(*(struct clk **)res); | ||
} | ||
|
||
struct clk *devm_clk_get(struct device *dev, const char *id) | ||
{ | ||
struct clk **ptr, *clk; | ||
|
||
ptr = devres_alloc(devm_clk_release, sizeof(*ptr), GFP_KERNEL); | ||
if (!ptr) | ||
return ERR_PTR(-ENOMEM); | ||
|
||
clk = clk_get(dev, id); | ||
if (!IS_ERR(clk)) { | ||
*ptr = clk; | ||
devres_add(dev, ptr); | ||
} else { | ||
devres_free(ptr); | ||
} | ||
|
||
return clk; | ||
} | ||
EXPORT_SYMBOL(devm_clk_get); | ||
|
||
static int devm_clk_match(struct device *dev, void *res, void *data) | ||
{ | ||
struct clk **c = res; | ||
if (!c || !*c) { | ||
WARN_ON(!c || !*c); | ||
return 0; | ||
} | ||
return *c == data; | ||
} | ||
|
||
void devm_clk_put(struct device *dev, struct clk *clk) | ||
{ | ||
int ret; | ||
|
||
ret = devres_release(dev, devm_clk_release, devm_clk_match, clk); | ||
|
||
WARN_ON(ret); | ||
} | ||
EXPORT_SYMBOL(devm_clk_put); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters