Skip to content

Commit 75341b3

Browse files
fancerarndb
authored andcommitted
bus: bt1-apb: Use PTR_ERR_OR_ZERO to return from request-regs method
Indeed it's more optimal to use the PTR_ERR_OR_ZERO() macro there instead of having two return points. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Serge Semin <[email protected]> Cc: Alexey Malahov <[email protected]> Cc: Olof Johansson <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: [email protected] Signed-off-by: Arnd Bergmann <[email protected]>
1 parent b19dc1b commit 75341b3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/bus/bt1-apb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,10 @@ static int bt1_apb_request_regs(struct bt1_apb *apb)
164164
}
165165

166166
apb->res = devm_platform_ioremap_resource_byname(pdev, "nodev");
167-
if (IS_ERR(apb->res)) {
167+
if (IS_ERR(apb->res))
168168
dev_err(apb->dev, "Couldn't map reserved region\n");
169-
return PTR_ERR(apb->res);
170-
}
171169

172-
return 0;
170+
return PTR_ERR_OR_ZERO(apb->res);
173171
}
174172

175173
static int bt1_apb_request_rst(struct bt1_apb *apb)

0 commit comments

Comments
 (0)