Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8a3b9b5 authored by Joel Stanley's avatar Joel Stanley
Browse files

soc: aspeed: lpc-ctrl: Fix probe error handling



gcc warns that a mising "flash" phandle node leads to undefined
behavior later:

drivers/soc/aspeed/aspeed-lpc-ctrl.c: In function 'aspeed_lpc_ctrl_probe':
drivers/soc/aspeed/aspeed-lpc-ctrl.c:201:18: error: '*((void *)&resm+8)' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Only set the flash base and size if we find a phandle in the device
tree.

Reported-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarAndrew Jeffery <andrew@aj.id.au>
Reviewed-by: default avatarVijay Khemka <vijaykhemka@fb.com>
Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
parent e4272af4
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -223,10 +223,11 @@ static int aspeed_lpc_ctrl_probe(struct platform_device *pdev)
			dev_err(dev, "Couldn't address to resource for flash\n");
			return rc;
		}
	}

		lpc_ctrl->pnor_size = resource_size(&resm);
		lpc_ctrl->pnor_base = resm.start;
	}


	dev_set_drvdata(&pdev->dev, lpc_ctrl);