mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
pinctrl: starfive: jh7110: Avoid ifdeffery
Use IS_ENABLED() inline assigning a variable instead of ifdeffery. Cc: Rosen Penev <rosenp@gmail.com> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/linux-gpio/CAMuHMdX7t7VHTzybjYo3s8SU3XLEH9GKsxmLBbh7p4D1CT3H_Q@mail.gmail.com/ Signed-off-by: Linus Walleij <linusw@kernel.org>
This commit is contained in:
parent
50bb01954a
commit
e0a17856f2
|
|
@ -845,6 +845,7 @@ int jh7110_pinctrl_probe(struct platform_device *pdev)
|
|||
struct jh7110_pinctrl *sfp;
|
||||
struct pinctrl_desc *jh7110_pinctrl_desc;
|
||||
struct reset_control *rst;
|
||||
unsigned int num_saved_regs;
|
||||
struct clk *clk;
|
||||
int ret;
|
||||
|
||||
|
|
@ -857,15 +858,12 @@ int jh7110_pinctrl_probe(struct platform_device *pdev)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_PM_SLEEP)
|
||||
sfp = devm_kzalloc(dev, struct_size(sfp, saved_regs, info->nsaved_regs),
|
||||
GFP_KERNEL);
|
||||
#else
|
||||
sfp = devm_kzalloc(dev, sizeof(*sfp), GFP_KERNEL);
|
||||
#endif
|
||||
num_saved_regs = IS_ENABLED(CONFIG_PM_SLEEP) ? info->nsaved_regs : 0;
|
||||
sfp = devm_kzalloc(dev, struct_size(sfp, saved_regs, num_saved_regs),
|
||||
GFP_KERNEL);
|
||||
if (!sfp)
|
||||
return -ENOMEM;
|
||||
sfp->num_saved_regs = info->nsaved_regs;
|
||||
sfp->num_saved_regs = num_saved_regs;
|
||||
|
||||
sfp->base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(sfp->base))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user