* [PATCH v1 0/1] clk: npcm750: fix base address and of_clk_get_by_name @ 2018-05-01 7:23 Tali Perry 2018-05-01 7:23 ` [PATCH v1 1/1] clk: npcm750: fix base address and of_clk_get_by_name error handling. Also update error messages to be more informative Tali Perry 0 siblings, 1 reply; 3+ messages in thread From: Tali Perry @ 2018-05-01 7:23 UTC (permalink / raw) To: sboyd, brendanhiggins, robh+dt, mark.rutland, linux, weiyongjunl, avifishman70, tmaimon77, raltherr Cc: devicetree, openbmc, linux-kernel, Tali Perry, Wei Yongjun, linux-arm-kernel Nuvoton NPCM7XX Clock Controller fix base address and of_clk_get_by_name error handling. Also update error messages to be more informative. In case clk_base allocation is erronoeous the return value is null. Also fix handling of of_clk_get_by_name returns an error. Print a better error message pointing to the dt-binding documention. Signed-off-by: Tali Perry <tali.perry1@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Tali Perry (2): --- Tali Perry (1): clk: npcm750: fix base address and of_clk_get_by_name error handling. Also update error messages to be more informative drivers/clk/clk-npcm7xx.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) -- 2.14.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v1 1/1] clk: npcm750: fix base address and of_clk_get_by_name error handling. Also update error messages to be more informative 2018-05-01 7:23 [PATCH v1 0/1] clk: npcm750: fix base address and of_clk_get_by_name Tali Perry @ 2018-05-01 7:23 ` Tali Perry 2018-05-15 22:15 ` Stephen Boyd 0 siblings, 1 reply; 3+ messages in thread From: Tali Perry @ 2018-05-01 7:23 UTC (permalink / raw) To: sboyd, brendanhiggins, robh+dt, mark.rutland, linux, weiyongjunl, avifishman70, tmaimon77, raltherr Cc: devicetree, openbmc, linux-kernel, Tali Perry, Wei Yongjun, linux-arm-kernel Nuvoton NPCM7XX Clock Controller fix base address and of_clk_get_by_name error handling. Also update error messages to be more informative. In case clk_base allocation is erronoeous the return value is null. Also fix handling of of_clk_get_by_name returns an error. Print a better error message pointing to the dt-binding documention. Signed-off-by: Tali Perry <tali.perry1@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Tali Perry (2): --- drivers/clk/clk-npcm7xx.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/clk/clk-npcm7xx.c b/drivers/clk/clk-npcm7xx.c index 7e4964b9e5c8..6ff97f79fcd7 100644 --- a/drivers/clk/clk-npcm7xx.c +++ b/drivers/clk/clk-npcm7xx.c @@ -583,7 +583,7 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np) clk_base = ioremap(res.start, resource_size(&res)); - if (IS_ERR(clk_base)) + if (!clk_base) goto npcm7xx_init_error; @@ -604,24 +604,27 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np) /* Read fixed clocks. These 3 clocks must be defined in DT */ clk = of_clk_get_by_name(clk_np, NPCM7XX_CLK_S_REFCLK); - if (!IS_ERR(clk)) { - pr_err("failed to find external REFCLK: %ld\n", + if (IS_ERR(clk)) { + pr_err("failed to find external REFCLK on device tree, err=%ld\n", PTR_ERR(clk)); clk_put(clk); + goto npcm7xx_init_fail_no_clk_on_dt; } clk = of_clk_get_by_name(clk_np, NPCM7XX_CLK_S_SYSBYPCK); - if (!IS_ERR(clk)) { - pr_err("failed to find external SYSBYPCK: %ld\n", + if (IS_ERR(clk)) { + pr_err("failed to find external SYSBYPCK on device tree, err=%ld\n", PTR_ERR(clk)); clk_put(clk); + goto npcm7xx_init_fail_no_clk_on_dt; } clk = of_clk_get_by_name(clk_np, NPCM7XX_CLK_S_MCBYPCK); - if (!IS_ERR(clk)) { - pr_err("failed to find external MCBYPCK: %ld\n", + if (IS_ERR(clk)) { + pr_err("failed to find external MCBYPCK on device tree, err=%ld\n", PTR_ERR(clk)); clk_put(clk); + goto npcm7xx_init_fail_no_clk_on_dt; } /* Register plls */ @@ -705,6 +708,9 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np) return; +npcm7xx_init_fail_no_clk_on_dt: + pr_err("see Documentation/devicetree/bindings/clock/" + "nuvoton,npcm750-clk.txt for details\n"); npcm7xx_init_fail: if (npcm7xx_clk_data->num) kfree(npcm7xx_clk_data->hws); -- 2.14.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1 1/1] clk: npcm750: fix base address and of_clk_get_by_name error handling. Also update error messages to be more informative 2018-05-01 7:23 ` [PATCH v1 1/1] clk: npcm750: fix base address and of_clk_get_by_name error handling. Also update error messages to be more informative Tali Perry @ 2018-05-15 22:15 ` Stephen Boyd 0 siblings, 0 replies; 3+ messages in thread From: Stephen Boyd @ 2018-05-15 22:15 UTC (permalink / raw) To: avifishman70, brendanhiggins, linux, mark.rutland, raltherr, robh+dt, tmaimon77, weiyongjunl Cc: devicetree, openbmc, linux-kernel, Tali Perry, Wei Yongjun, linux-arm-kernel Quoting Tali Perry (2018-05-01 00:23:27) > > Nuvoton NPCM7XX Clock Controller > fix base address and of_clk_get_by_name error handling. > Also update error messages to be more informative. > > In case clk_base allocation is erronoeous the return value is null. > Also fix handling of of_clk_get_by_name returns an error. > Print a better error message pointing to the dt-binding documention. > > > Signed-off-by: Tali Perry <tali.perry1@gmail.com> > Reviewed-by: Rob Herring <robh@kernel.org> > Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> > > Tali Perry (2): > This doesn't apply to clk-next so I'm not sure what's going on. Please resend if something needs to be fixed. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-15 22:15 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-05-01 7:23 [PATCH v1 0/1] clk: npcm750: fix base address and of_clk_get_by_name Tali Perry 2018-05-01 7:23 ` [PATCH v1 1/1] clk: npcm750: fix base address and of_clk_get_by_name error handling. Also update error messages to be more informative Tali Perry 2018-05-15 22:15 ` Stephen Boyd
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).