mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
spi: spi-qpic-snand: remove interim 'dev_data' variable from qcom_spi_probe()
The dev_data variable in the qcom_spi_probe() function is only used to temporarily store a pointer of the device specific data before that value gets assigned to 'snandc->props'. Remove the interim variable and use 'snandc->props' directly instead in order to simplify the code. No functional changes. Signed-off-by: Gabor Juhos <j4g8y7@gmail.com> Link: https://patch.msgid.link/20260908-qpic-snand-drop-dev_data-var-v1-1-147d3fab6c48@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
34e32e9ade
commit
44d39535cd
|
|
@ -1585,7 +1585,6 @@ static int qcom_spi_probe(struct platform_device *pdev)
|
|||
struct qpic_spi_nand *qspi;
|
||||
struct qpic_ecc *ecc;
|
||||
struct resource *res;
|
||||
const void *dev_data;
|
||||
int ret;
|
||||
|
||||
ecc = devm_kzalloc(dev, sizeof(*ecc), GFP_KERNEL);
|
||||
|
|
@ -1613,14 +1612,12 @@ static int qcom_spi_probe(struct platform_device *pdev)
|
|||
snandc->qspi->ctlr = ctlr;
|
||||
snandc->qspi->ecc = ecc;
|
||||
|
||||
dev_data = of_device_get_match_data(dev);
|
||||
if (!dev_data) {
|
||||
snandc->props = of_device_get_match_data(dev);
|
||||
if (!snandc->props) {
|
||||
dev_err(&pdev->dev, "failed to get device data\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
snandc->props = dev_data;
|
||||
|
||||
snandc->core_clk = devm_clk_get_enabled(dev, "core");
|
||||
if (IS_ERR(snandc->core_clk))
|
||||
return PTR_ERR(snandc->core_clk);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user