* [PATCH 1/6] clk: asm9260: Fix of_io_request_and_map error check
[not found] <1430579006-32702-1-git-send-email-maxime.ripard@free-electrons.com>
@ 2015-05-02 15:03 ` Maxime Ripard
2015-05-11 19:43 ` Maxime Ripard
2015-05-02 15:03 ` [PATCH 2/6] clk: sunxi: " Maxime Ripard
1 sibling, 1 reply; 5+ messages in thread
From: Maxime Ripard @ 2015-05-02 15:03 UTC (permalink / raw)
To: linux-kernel; +Cc: Maxime Ripard, Mike Turquette, Stephen Boyd, linux-clk
of_io_request_and map returns an error pointer, but the current code assumes
that on error the returned pointer will be NULL.
Obviously, that makes the check completely useless. Change the test to actually
check for the proper error code.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-clk@vger.kernel.org
---
drivers/clk/clk-asm9260.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/clk-asm9260.c b/drivers/clk/clk-asm9260.c
index 88f4ff6916fe..90897af8d9f7 100644
--- a/drivers/clk/clk-asm9260.c
+++ b/drivers/clk/clk-asm9260.c
@@ -274,7 +274,7 @@ static void __init asm9260_acc_init(struct device_node *np)
u32 accuracy = 0;
base = of_io_request_and_map(np, 0, np->name);
- if (!base)
+ if (IS_ERR(base))
panic("%s: unable to map resource", np->name);
/* register pll */
--
2.3.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/6] clk: sunxi: Fix of_io_request_and_map error check
[not found] <1430579006-32702-1-git-send-email-maxime.ripard@free-electrons.com>
2015-05-02 15:03 ` [PATCH 1/6] clk: asm9260: Fix of_io_request_and_map error check Maxime Ripard
@ 2015-05-02 15:03 ` Maxime Ripard
2015-05-05 15:44 ` Maxime Ripard
1 sibling, 1 reply; 5+ messages in thread
From: Maxime Ripard @ 2015-05-02 15:03 UTC (permalink / raw)
To: linux-kernel; +Cc: Maxime Ripard, Mike Turquette, Stephen Boyd, linux-clk
of_io_request_and map returns an error pointer, but the current code assumes
that on error the returned pointer will be NULL.
Obviously, that makes the check completely useless. Change the test to actually
check for the proper error code.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Mike Turquette <mturquette@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-clk@vger.kernel.org
---
drivers/clk/sunxi/clk-sun9i-core.c | 10 +++++-----
drivers/clk/sunxi/clk-sunxi.c | 2 ++
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/sunxi/clk-sun9i-core.c b/drivers/clk/sunxi/clk-sun9i-core.c
index d8da77d72861..887f4ea161bb 100644
--- a/drivers/clk/sunxi/clk-sun9i-core.c
+++ b/drivers/clk/sunxi/clk-sun9i-core.c
@@ -93,7 +93,7 @@ static void __init sun9i_a80_pll4_setup(struct device_node *node)
void __iomem *reg;
reg = of_io_request_and_map(node, 0, of_node_full_name(node));
- if (!reg) {
+ if (IS_ERR(reg)) {
pr_err("Could not get registers for a80-pll4-clk: %s\n",
node->name);
return;
@@ -154,7 +154,7 @@ static void __init sun9i_a80_gt_setup(struct device_node *node)
struct clk *gt;
reg = of_io_request_and_map(node, 0, of_node_full_name(node));
- if (!reg) {
+ if (IS_ERR(reg)) {
pr_err("Could not get registers for a80-gt-clk: %s\n",
node->name);
return;
@@ -218,7 +218,7 @@ static void __init sun9i_a80_ahb_setup(struct device_node *node)
void __iomem *reg;
reg = of_io_request_and_map(node, 0, of_node_full_name(node));
- if (!reg) {
+ if (IS_ERR(reg)) {
pr_err("Could not get registers for a80-ahb-clk: %s\n",
node->name);
return;
@@ -244,7 +244,7 @@ static void __init sun9i_a80_apb0_setup(struct device_node *node)
void __iomem *reg;
reg = of_io_request_and_map(node, 0, of_node_full_name(node));
- if (!reg) {
+ if (IS_ERR(reg)) {
pr_err("Could not get registers for a80-apb0-clk: %s\n",
node->name);
return;
@@ -310,7 +310,7 @@ static void __init sun9i_a80_apb1_setup(struct device_node *node)
void __iomem *reg;
reg = of_io_request_and_map(node, 0, of_node_full_name(node));
- if (!reg) {
+ if (IS_ERR(reg)) {
pr_err("Could not get registers for a80-apb1-clk: %s\n",
node->name);
return;
diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 7e1e2bd189b6..9a82f17d2d73 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -198,6 +198,8 @@ static void __init sun6i_ahb1_clk_setup(struct device_node *node)
int i = 0;
reg = of_io_request_and_map(node, 0, of_node_full_name(node));
+ if (IS_ERR(reg))
+ return;
/* we have a mux, we will have >1 parents */
while (i < SUN6I_AHB1_MAX_PARENTS &&
--
2.3.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/6] clk: sunxi: Fix of_io_request_and_map error check
2015-05-02 15:03 ` [PATCH 2/6] clk: sunxi: " Maxime Ripard
@ 2015-05-05 15:44 ` Maxime Ripard
0 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2015-05-05 15:44 UTC (permalink / raw)
To: linux-kernel; +Cc: Mike Turquette, Stephen Boyd, linux-clk
[-- Attachment #1: Type: text/plain, Size: 658 bytes --]
On Sat, May 02, 2015 at 05:03:22PM +0200, Maxime Ripard wrote:
> of_io_request_and map returns an error pointer, but the current code assumes
> that on error the returned pointer will be NULL.
>
> Obviously, that makes the check completely useless. Change the test to actually
> check for the proper error code.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Mike Turquette <mturquette@linaro.org>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: linux-clk@vger.kernel.org
Applied on my tree.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/6] clk: asm9260: Fix of_io_request_and_map error check
2015-05-02 15:03 ` [PATCH 1/6] clk: asm9260: Fix of_io_request_and_map error check Maxime Ripard
@ 2015-05-11 19:43 ` Maxime Ripard
2015-05-13 7:35 ` Stephen Boyd
0 siblings, 1 reply; 5+ messages in thread
From: Maxime Ripard @ 2015-05-11 19:43 UTC (permalink / raw)
To: linux-kernel; +Cc: Mike Turquette, Stephen Boyd, linux-clk
[-- Attachment #1: Type: text/plain, Size: 765 bytes --]
Mike, Stephen,
On Sat, May 02, 2015 at 05:03:21PM +0200, Maxime Ripard wrote:
> of_io_request_and map returns an error pointer, but the current code assumes
> that on error the returned pointer will be NULL.
>
> Obviously, that makes the check completely useless. Change the test to actually
> check for the proper error code.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> Cc: Mike Turquette <mturquette@linaro.org>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Cc: linux-clk@vger.kernel.org
There doesn't seem to be a sub-maintainer for that driver, I guess it
should go through your tree?
Thanks,
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/6] clk: asm9260: Fix of_io_request_and_map error check
2015-05-11 19:43 ` Maxime Ripard
@ 2015-05-13 7:35 ` Stephen Boyd
0 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2015-05-13 7:35 UTC (permalink / raw)
To: Maxime Ripard; +Cc: linux-kernel, Mike Turquette, linux-clk
On 05/11, Maxime Ripard wrote:
> Mike, Stephen,
>
> On Sat, May 02, 2015 at 05:03:21PM +0200, Maxime Ripard wrote:
> > of_io_request_and map returns an error pointer, but the current code assumes
> > that on error the returned pointer will be NULL.
> >
> > Obviously, that makes the check completely useless. Change the test to actually
> > check for the proper error code.
> >
> > Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> > Cc: Mike Turquette <mturquette@linaro.org>
> > Cc: Stephen Boyd <sboyd@codeaurora.org>
> > Cc: linux-clk@vger.kernel.org
>
> There doesn't seem to be a sub-maintainer for that driver, I guess it
> should go through your tree?
>
Yep. Applied to clk-next.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-05-13 7:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1430579006-32702-1-git-send-email-maxime.ripard@free-electrons.com>
2015-05-02 15:03 ` [PATCH 1/6] clk: asm9260: Fix of_io_request_and_map error check Maxime Ripard
2015-05-11 19:43 ` Maxime Ripard
2015-05-13 7:35 ` Stephen Boyd
2015-05-02 15:03 ` [PATCH 2/6] clk: sunxi: " Maxime Ripard
2015-05-05 15:44 ` Maxime Ripard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox