Skip to content

Commit

Permalink
spi: ti-qspi: Use syscon_regmap_lookup_by_phandle_args
Browse files Browse the repository at this point in the history
Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
syscon_regmap_lookup_by_phandle() combined with getting the syscon
argument.  Except simpler code this annotates within one line that given
phandle has arguments, so grepping for code would be easier.

There is also no real benefit in printing errors on missing syscon
argument, because this is done just too late: runtime check on
static/build-time data.  Dtschema and Devicetree bindings offer the
static/build-time check for this already.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250111185400.183760-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Krzysztof Kozlowski authored and Mark Brown committed Jan 14, 2025
1 parent fd85b6b commit 40ba3c9
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/spi/spi-ti-qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,20 +831,12 @@ static int ti_qspi_probe(struct platform_device *pdev)

if (of_property_present(np, "syscon-chipselects")) {
qspi->ctrl_base =
syscon_regmap_lookup_by_phandle(np,
"syscon-chipselects");
syscon_regmap_lookup_by_phandle_args(np, "syscon-chipselects",
1, &qspi->ctrl_reg);
if (IS_ERR(qspi->ctrl_base)) {
ret = PTR_ERR(qspi->ctrl_base);
goto free_host;
}
ret = of_property_read_u32_index(np,
"syscon-chipselects",
1, &qspi->ctrl_reg);
if (ret) {
dev_err(&pdev->dev,
"couldn't get ctrl_mod reg index\n");
goto free_host;
}
}

qspi->fclk = devm_clk_get(&pdev->dev, "fck");
Expand Down

0 comments on commit 40ba3c9

Please sign in to comment.