linux-stable/drivers/clk/at91
Dan Carpenter 43a354a21a clk: at91: remove unnecessary conditions
This code checks "if (parent_hw)" is non-NULL, but then it has more
checks if parent_hw is non-NULL on the lines inside the if statement.
It is a bit confusing.

For the else statement, keep in mind that at the start of the function
we checked:

	if (!(parent_name || parent_hw))
		return ERR_PTR(-EINVAL);

That check ensures that if parent_hw is NULL that means that parent_name
is non-NULL.  At least one must always be non-NULL.  So here again, the
checks inside the if statement can be removed.

In the original code, it was a bit confusing and you could easily get
the impression that "init.num_parents" could be zero.  When we remove
the unnecessary checking it's more obvious that it's always set to 1.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/7782b4f1-deed-49dc-8207-b6ea06d7602f@moroto.mountain
Reviewed-by: Claudiu Beznea <claudiu.beznea@tuxon.dev>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2023-10-18 17:56:13 -07:00
..
Makefile clk: at91: do not compile dt-compat.c for sama7g5 and sam9x60 2023-01-09 14:05:41 +02:00
at91rm9200.c clk: at91: clk-system: add support for parent_hw 2023-06-21 10:42:48 +03:00
at91sam9g45.c clk: at91: clk-utmi: add support for parent_hw 2023-06-21 10:42:48 +03:00
at91sam9n12.c clk: at91: clk-system: add support for parent_hw 2023-06-21 10:42:48 +03:00
at91sam9rl.c clk: at91: clk-utmi: add support for parent_hw 2023-06-21 10:42:48 +03:00
at91sam9x5.c clk: at91: clk-utmi: add support for parent_hw 2023-06-21 10:42:48 +03:00
at91sam9260.c clk: at91: clk-system: add support for parent_hw 2023-06-21 10:42:48 +03:00
clk-audio-pll.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-generated.c clk: at91: clk-generated: add support for parent_hw 2023-06-21 10:42:45 +03:00
clk-h32mx.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-i2s-mux.c clk: at91: move DT compatibility code to its own file 2018-10-17 10:45:39 -07:00
clk-main.c Merge branches 'clk-qcom' and 'clk-microchip' into clk-next 2023-06-26 16:36:14 -07:00
clk-master.c clk: at91: clk-master: add support for parent_hw 2023-06-21 10:42:45 +03:00
clk-peripheral.c clk: at91: clk-peripheral: add support for parent_hw 2023-06-21 10:42:46 +03:00
clk-pll.c clk: at91: re-factor clocks suspend/resume 2021-10-26 18:27:41 -07:00
clk-plldiv.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-programmable.c clk: at91: clk-programmable: add support for parent_hw 2023-06-21 10:42:47 +03:00
clk-sam9x60-pll.c clk: at91: clk-sam9x60-pll: add support for parent_hw 2023-06-21 10:42:48 +03:00
clk-slow.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
clk-smd.c clk: at91: smd: Switch to determine_rate 2023-06-08 18:39:32 -07:00
clk-system.c clk: at91: clk-system: add support for parent_hw 2023-06-21 10:42:48 +03:00
clk-usb.c clk: at91: re-factor clocks suspend/resume 2021-10-26 18:27:41 -07:00
clk-utmi.c clk: at91: remove unnecessary conditions 2023-10-18 17:56:13 -07:00
dt-compat.c clk: at91: clk-utmi: add support for parent_hw 2023-06-21 10:42:48 +03:00
pmc.c clk: at91: pmc: add sama7g5 to the list of available pmcs 2021-10-26 18:27:42 -07:00
pmc.h clk: at91: clk-sam9x60-pll: add support for parent_hw 2023-06-21 10:42:48 +03:00
sam9x60.c clk: at91: clk-sam9x60-pll: add support for parent_hw 2023-06-21 10:42:48 +03:00
sama5d2.c clk: at91: clk-utmi: add support for parent_hw 2023-06-21 10:42:48 +03:00
sama5d3.c clk: at91: clk-utmi: add support for parent_hw 2023-06-21 10:42:48 +03:00
sama5d4.c clk: at91: clk-utmi: add support for parent_hw 2023-06-21 10:42:48 +03:00
sama7g5.c clk: at91: sama7g5: s/ep_chg_chg_id/ep_chg_id 2023-06-21 10:42:48 +03:00
sckc.c Merge branches 'clk-qcom' and 'clk-microchip' into clk-next 2023-06-26 16:36:14 -07:00