* [PATCH -next] video: ARM CLCD: fix return value check in versatile_clcd_init_panel()
@ 2016-08-13 1:26 Wei Yongjun
2016-08-19 9:07 ` Linus Walleij
2016-08-30 8:37 ` Tomi Valkeinen
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2016-08-13 1:26 UTC (permalink / raw)
To: linux-fbdev
In case of error, the function syscon_node_to_regmap() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().
Fixes: 25348160e9a4 ("video: ARM CLCD: add special panel hook for Versatiles")
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
---
drivers/video/fbdev/amba-clcd-versatile.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/amba-clcd-versatile.c b/drivers/video/fbdev/amba-clcd-versatile.c
index 9a90817..56161f9 100644
--- a/drivers/video/fbdev/amba-clcd-versatile.c
+++ b/drivers/video/fbdev/amba-clcd-versatile.c
@@ -528,9 +528,9 @@ int versatile_clcd_init_panel(struct clcd_fb *fb,
versatile_clcd_type = (enum versatile_clcd)clcd_id->data;
map = syscon_node_to_regmap(np);
- if (!map) {
+ if (IS_ERR(map)) {
dev_err(dev, "no Versatile syscon regmap\n");
- return -ENODEV;
+ return PTR_ERR(map);
}
switch (versatile_clcd_type) {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] video: ARM CLCD: fix return value check in versatile_clcd_init_panel()
2016-08-13 1:26 [PATCH -next] video: ARM CLCD: fix return value check in versatile_clcd_init_panel() Wei Yongjun
@ 2016-08-19 9:07 ` Linus Walleij
2016-08-30 8:37 ` Tomi Valkeinen
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2016-08-19 9:07 UTC (permalink / raw)
To: linux-fbdev
On Sat, Aug 13, 2016 at 3:26 AM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> In case of error, the function syscon_node_to_regmap() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
>
> Fixes: 25348160e9a4 ("video: ARM CLCD: add special panel hook for Versatiles")
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Thanks for fixing my stupid mistake Wei!
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] video: ARM CLCD: fix return value check in versatile_clcd_init_panel()
2016-08-13 1:26 [PATCH -next] video: ARM CLCD: fix return value check in versatile_clcd_init_panel() Wei Yongjun
2016-08-19 9:07 ` Linus Walleij
@ 2016-08-30 8:37 ` Tomi Valkeinen
1 sibling, 0 replies; 3+ messages in thread
From: Tomi Valkeinen @ 2016-08-30 8:37 UTC (permalink / raw)
To: linux-fbdev
[-- Attachment #1.1: Type: text/plain, Size: 1127 bytes --]
On 13/08/16 04:26, Wei Yongjun wrote:
> In case of error, the function syscon_node_to_regmap() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
>
> Fixes: 25348160e9a4 ("video: ARM CLCD: add special panel hook for Versatiles")
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
> ---
> drivers/video/fbdev/amba-clcd-versatile.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/amba-clcd-versatile.c b/drivers/video/fbdev/amba-clcd-versatile.c
> index 9a90817..56161f9 100644
> --- a/drivers/video/fbdev/amba-clcd-versatile.c
> +++ b/drivers/video/fbdev/amba-clcd-versatile.c
> @@ -528,9 +528,9 @@ int versatile_clcd_init_panel(struct clcd_fb *fb,
> versatile_clcd_type = (enum versatile_clcd)clcd_id->data;
>
> map = syscon_node_to_regmap(np);
> - if (!map) {
> + if (IS_ERR(map)) {
> dev_err(dev, "no Versatile syscon regmap\n");
> - return -ENODEV;
> + return PTR_ERR(map);
> }
>
> switch (versatile_clcd_type) {
>
Thanks, queued for v4.9.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-08-30 8:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-13 1:26 [PATCH -next] video: ARM CLCD: fix return value check in versatile_clcd_init_panel() Wei Yongjun
2016-08-19 9:07 ` Linus Walleij
2016-08-30 8:37 ` Tomi Valkeinen
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).