Commit 9e37532b authored by Florian Fainelli's avatar Florian Fainelli Committed by Miquel Raynal
Browse files

mtd: rawnand: brcmnand: Assign soc as early as possible



In order to key off the brcmnand_probe() code in subsequent changes
depending upon ctrl->soc, assign that variable as early as possible,
instead of much later when we have checked that it is non-NULL.

Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220107184614.2670254-2-f.fainelli@gmail.com
parent 65a01be4
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2998,6 +2998,7 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)

	dev_set_drvdata(dev, ctrl);
	ctrl->dev = dev;
	ctrl->soc = soc;

	init_completion(&ctrl->done);
	init_completion(&ctrl->dma_done);
@@ -3138,8 +3139,6 @@ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
	 * interesting ways
	 */
	if (soc) {
		ctrl->soc = soc;

		ret = devm_request_irq(dev, ctrl->irq, brcmnand_irq, 0,
				       DRV_NAME, ctrl);