[UBOOT PATCH v3] mtd: nand: arasan: Print warning for unsupported ecc modes

Dan Carpenter dan.carpenter at linaro.org
Fri Mar 1 12:32:56 CET 2024


On Fri, Mar 01, 2024 at 04:42:54PM +0530, Venkatesh Yadav Abbarapu wrote:
> @@ -1263,6 +1264,12 @@ static int arasan_probe(struct udevice *dev)
>  		goto fail;
>  	}
>  
> +	str = ofnode_read_string(nand_chip->flash_node, "nand-ecc-mode");
> +	if (strcmp(str, "hw")) {
> +		printf("%s ecc is not supported, switch to hw ecc\n", str);

I'm a newbie to device trees, but the two other callers assume that it's
possible for ofnode_read_string(nand->flash_node, "nand-ecc-mode") to
return NULL so probably we should add a NULL check here too.

	if (!str || strcmp(str, "hw") != 0) {

regards,
dan carpenter



More information about the U-Boot mailing list